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.

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jeroenbegyn created an issue. See original summary.

kaduk’s picture

Status: Active » Reviewed & tested by the community

Can confirm patch in #2 works!

  • Daniel.Moberly committed 725f3a3 on 8.x-2.x
    Issue #3315138 by jeroenbegyn: Icon Picker Widget validation error when...
Daniel.Moberly’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.