Validation plugin icons

alisamii

Member
I have a question about validation plugin icons and the latest github branch for 3.1rc2

We updated our fabrik from github on the 17th. Prior to the update, validation plugins had defined icons (for example, the username validation displayed the icon-user icon).

After updating to the latest github version, all validations display the icon-star icon. However, looking in the plugin's settings through Extensions > Plugin Manager > Fabrik Validation - User Exists > Options, I see that the icon is defined as "user".

Furthermore, within the form, if I want to use a font-awesome icon somewhere, such as in a "display" element, the only icon that works is the font-awesome icon-star icon. For example, if I set a span with class="icon icon-envelope", it doesn't display.

Can you help us find a solution so that validation plugin icons are shown as defined in the plugin settings and other icons can be displayed in elements?
 
Ack phffft. I keep letting J! catch me out on this one. It's a J! bug / feature.

Short answer - edit the actual plugin settings (in the J! plugin manager, not in the Fabrik element / validation settings) and save them. You should see the icon name to use as an option, and it should be (say) "user" for the "userexists" validation plugin. After saving the plugin settings one time, the icon should start working.

Long answer - it's a J! "feature" (personally I think it's a bug). After installing any plugin in J!, anything which winds up as a "param", i.e. an option name/value pair in the 'params' field in the #__extensions table, which you see as an option to set in the J! plugin manager for that plugin, will NOT have a value in the #__extensions table until that plugin has had the settings saved one time. Until it's been saved, the default value only exists in the original XML manifest file for the plugin.

So the reason it works on your test server and not on your live server is that you must have at one point have edited and saved the settings in the plugin manager. Either that, or it's possible there's a subtle difference in the way J! creates plugin params, depending on whether a plugin is directly installed through a ZIP, or gets "discovered".

Anyway ... to account for this, we'll have to put some code in to detect an empty param list for validations, and if necessary manually read the package XML and set up the defaults that way.

I'm working on that, but it's not an entirely trivial thing to do, so for now you'll just have to use the workaround of saving the settings one time.

-- hugh
 
BTW, just to illustrate how insidious this "feature" is ... it's not just us that occasionally get caught out by it. J! themselves just got bitten by it in the 3.2 release. It was a large part of why the main user authentication in J! got borked up pretty badly.

They added 'strong authentication' as a new option, in the com_user plugin, to enable J! to use a new, stronger password authentication method. But forgot that until people went and edited and saved the com_user plugin settings one time, the new "use_strong_auth" param wouldn't actually be set for real. And the default they assumed in the code ("no") was different to the one in the manifest XML ("yes").

End result, all kinds of bizarre issues where different chunks of code assumed different defaults for strong auth, and passwords getting encoded one way, and decoded the other, which doesn't work too well!

Anyway ... I'm testing a fix now. But don't hold your breath for it, as I really need to find a better way of doing it.

-- hugh
 
As an alternative, perhaps we should move this option out from the manifest and make it YAFO in the Fabrik Validation settings? That way it can be set on a validation by validation basis rather than being global for the site.
 
Hi Hugh,

Your point would be valid if I had not gone ahead and opened and saved the plugins in the plugin manager (J! side) already.

Furthermore, even is I try to include, for example, <i class="icon-envelope"></i>, inside a display element (which only renders the content as formatted) the only icon that works is <i class="icon-star"></i>. <i class="icon-envelope"></i> does not work and renders a blank space. Change it to <i class="icon-star"></i> and it renders in the display element content.

However, in any other J! core or 3rd Party component, module or other element, I do not have this issue.

Thus, this issue is somehow core to how fabrik, at its basic level, is handling icon-fonts.
 
If you are certain that this change is definitely associated with your Fabrik upgrade, then I guess we need to look into it. However, I have done quite a lot of looking into Joomla / Bootstrap / Font-Awesome icons in the past, and it is all a bit of a mess.

Firstly, the icon names in Joomla, Bootstrap and Font-Awesome are not all the same - whilst there is quite a lot of overlap, there are e.g. some icon names in Joomla which are not set in Bootstrap / Font-Awesome, and there are lots of new icons in Bootstrap (and even more in Font Awesome) which are not in Joomla. To make it worse, there are some icon names which are associated with different looking icons. (At least Font-Awesome seems to be a superset of Bootstrap which avoids 3-way difficulties.)

I did do some work (for the T3 framework) to add mappings from the missing Joomla icon names to Font-Awesome icons - and this can probably be applied to other templates / frameworks. I did a post in the Joomla forums somewhere with instructions on how to do it, or you can look in the T3 github repo for my PR for the precise details.

This might be of help - or it might be something else that is indeed introduced by Fabrik.

S
 
If you are certain that this change is definitely associated with your Fabrik upgrade, then I guess we need to look into it. However, I have done quite a lot of looking into Joomla / Bootstrap / Font-Awesome icons in the past, and it is all a bit of a mess.

Hi Paul,

Well, I resaved the validation plugins a few times, and after the 3rd save on each plugin, the icons began to work again. So, I have no idea now whether this is my specific J! instance that is having a problem, if it has something to do with the github update/upgrade, or if something else is fundamentally messed up somewhere. The only plugin I cannot get it to work on is the the "email exists in Joomla" and "is email" validations which continue to display the icon-star icon font rather than the icon-envelope.

However, I still cannot manually embed an icon font in, for example, the rendered text of a Display Element. The only icon-font that works is the icon-star font.

On the other hand, and this is more a feature request than an error issue, I think it could be a good idea to make it YAFO in the validation settings so that you can manually override the default icon of the plugin with a specific one. For example, I believe the regex default icon is the icon-star, however, regex can be used for multiple different uses, often to define custom phone-number validations. But on the same form, or in the same on a different form, you may use regex for a different purpose. If you set the icon to icon-phone on the regex validation plugin at a global level, the icon would no longer accurately reflect the value being validated in the regex when you have defined a rule that is not a phone number. It would be nice to be able to set per-element validation rule icons.

Another issue I am having with validation rules on dropboxes is that the tooltip doesn't display the proper message on the "isnot" validation. For example, I have 4 dropdown items on my form here : http://conf.kfggroup.com/en/register . On the Organisation dropdown, I have set the validation rule to "is not" with the following parameters:

Action: isnot
Status: Published
Show Validation Icon: Yes
Error Message: This is a required field.
Condition:
Is Not: Select?
Tip text: Please select the organisation you represent.

Yet the tip text on the front-end does not display the tip text entered above, but rather displays : "Tests if not 'Select?'" which isn't too user friendly. See screenshot below:

http://d.pr/i/qOiG

Finally, I don't seem to see a way to add a validation icon to the password element that is specific to the password / confirm password combination. It would be nice to be able to add an icon to that element, and also to toggle enable/disable the strength meter as it may not always fit in the design of the site. I have disabled it by hiding that dom element through CSS, but being able to just disable it with YAFO in the element settings.
 
Re: the password icon, I am referring to the fact that the password element has a built-in default validation which compares the two input elements to ensure they are the same, thus there is no need to add a validation rule as a separate option. So, it would be nice to have an automatic option to display the validation icon.

As regards per validation rule custom icons, it would be nice to be able to set it using a multi-button toggle such as:

Show Validation Icon: None/Default/Custom

Such that none displays no icon at all, default displays the icon set in the plugin's own settings, and custom shows an input field where the user can define the icon they want to use specifically for that validation instance.

Right now, I find the "Show Validation Icon" toggle of Yes/No as a bit misleading because "Yes" shows the icon defined in the plugin and "No" still displays an icon, but defaults to the star.
 
Hi Rob,

Well, it appears that the icon font issue has something to do with Gantry 4.1.x and it's implementation of JUI overrides.

The icons for icon-delete and a whole series of other icons are overridden by Gantry and even adding i.icon-delete.icon-remove {font-family: 'FontAwesome' !important;} in the template CSS is disregarded by Gantry. The only solution seems to be to modify the /libraries/gantry/assets/jui/less/bootstrap-overrides.less and comment-out the specific icons that need to be displayed. These are located on line 141 of this file.

This is one of the frustrations I have noticed with Gantry, which, although a powerful and well thought-out framework, at times, it overrides things so completely that it becomes a pain to find where and what the problem is.

Having said that, the validation icon problem for email exists in Joomla" and "is email" are not affected by Gantry's overrides, and I still am not able to get the icon-envelope to show for them.

The isnot validation tip-text issue for dropdowns is still a problem however, and one which I have not found a solution to.

Best regards,

Ali

BTW, Happy New Year
 
Happy new year :)

It would be nice to be able to set per-element validation rule icons.
I agree that the reg-ex icon needs to be definable due to it being a multi-purpose validation. I've added that in this commit https://github.com/Fabrik/fabrik/commit/ad91d757a37d192176242ef11d6df824c4c0bb3b and the same for php validation rules with :
https://github.com/Fabrik/fabrik/commit/8b3d8bc2cd13d94a176a92cde36245642d40bc96

Well, it appears that the icon font issue has something to do with Gantry 4.1.x and it's implementation of JUI overrides.
Yes I thought about that this morning when I got up, each Bootstrap template may or may not implement all the icons.
I also spotted that if you have 2 validation rules on the same element then the icons were not showing, that's fixed with this commit https://github.com/Fabrik/fabrik/commit/2e01cfe656979b251acb125507751e6ad21114b5 might that be what you were seeing with the envelope icon issue (as for me I can definately use it with the protostar template and it does seem that it should be in fontawesome)

Re: the password icon, I am referring to the fact that the password element has a built-in default validation which compares the two input elements to ensure they are the same, thus there is no need to add a validation rule as a separate option. So, it would be nice to have an automatic option to display the validation icon.
Yes I completely agree there - any element with a validation - be that an internal one as in the case of the password element, or one assigned to it should be shown. I've had a first stab at doing that with this commit - its not that configurable (although the text message can be over-ridden in Joomla's language section)
https://github.com/Fabrik/fabrik/commit/b692d4686611af7afa452b965d6000033eb41d82

It would be nice to be able to add an icon to that element, and also to toggle enable/disable the strength meter as it may not always fit in the design of the site. I have disabled it by hiding that dom element through CSS, but being able to just disable it with YAFO in the element settings.
Yes thats a simple one, I've done that here.
https://github.com/Fabrik/fabrik/commit/5063db9860e7cf3be5188a7c9b1ac2341423a292


Another issue I am having with validation rules on dropboxes is that the tooltip doesn't display the proper message on the "isnot" validation.
Oh yes, seems we were trying to be too clever there - you are right in that the user assigned tip message should take preference over the default one the plugin is generating. I've fixed that with this commit
https://github.com/Fabrik/fabrik/commit/c9fbd5f4e5ab4a64c0585ff6336ac760614bff9f

I hope I've covered all your points, If I've missed out anything or something is not working as advertised let me know

-Rob
 
Hi Rob. Thank you.

What is the easiest way to update only the specific files associated with the changes you have implemented above. This is to avoid having to update ALL the 3.1rc2 files as detailed in the "Update from github" page as that process leaves a lot of build files and other such "extras" which I have to then manually clean up?

Thanks
 
Hi Rob.

What is the simplest way to update just these plugins? I want to avoid having to update all of fabrik and then have to go about deleting all the build files?

Thanks,

Ali
 
Not a great idea to update some parts of Fabrik from Github and not others. There are sometimes changes to main part of Fabrik needed and made at the same time as changes to plugins.

You should make a support request to RocketTheme to get them to implement the same changes that I had done to T3 to make it more compatible with JUI icons. There is also a post I did in the Joomla forums explaining how to do it.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top