Problem/Motivation
When a user doesn't have the "Access fontawesome additional settings" permission he can't save the page becaus an "invalid icon" error is thrown. This happens because even tho the "Additional Font Awesome Settings" are not shown, a validation hook on the mask field is still active. The "FontAwesomeIconpickerWidget.php" file overrids the default value for the mask but it does not check if it is actually empty. So the default value becomes "fas fa-", which is invalid.
Steps to reproduce
- Add a Fontawesome field to an entity with the form widget for that field set to "Font Awesome Iconpicker Widget"
- Create a use with the "Access fontawesome additional settings" permission disabled.
- Log in with that user and try to edit a page that allready has an icon and try to change it.
Proposed resolution
Expand check to set the default value to also check if the mask and mask style are not an emtpy string.
Issue fork fontawesome-3315138
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
kaduk CreditAttribution: kaduk at SQLI - Belgium commentedCan confirm patch in #2 works!
Comment #5
Daniel.Moberly CreditAttribution: Daniel.Moberly commentedCommitted. Thanks!