Problem/Motivation

We want to hide the additional settings details element for our editors, since all we need is for them to select an icon. Our theming handles the rest. But if the field is hidden (by setting #access to FALSE) any new field data will not have an icon style set, causing those icons not to render at all.

Steps to reproduce

Hide the additional settings field on the field widget by altering it's form and setting the #access key to FALSE. Attempt to set an icon on a field that does not yet have one set. The icon will not render.

Proposed resolution

Attached is a patch that modified the form widget so that it uses the first available style value as the default style. The filtering of the style list is moved so that it can be used to select a default from.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dennis_meuwissen created an issue. See original summary.

dennis_meuwissen’s picture

manuel.adan’s picture

I extended the patch to fully achieve the intended behaviour. A new user permission has been introduced to manage access to the additional settings area. The new permission is granted by default to authenticated users, both after updating or installing the module, and should be adjusted according to the site preferences.

manuel.adan’s picture

Status: Active » Needs review
Daniel.Moberly’s picture

Status: Needs review » Needs work

Can you re-roll this patch against the latest dev? It doesn't apply.

chrisck’s picture

@Daniel.Moberly I was able to apply the patch today to the latest dev-2.x f4a4ba8. I'm not able to much of a code review, however I can confirm the new permission is available as "Access fontawesome additional settings" and it does indeed work as intended. Thank you dennis_meuwissen and manuel.adan.

Daniel.Moberly’s picture

Ah yes, my mistake - I was applying against the dev build for Font Awesome 6.

I would like to push the Font Awesome 6 changes and then re-roll this patch against the new version as there is some collision here.

Daniel.Moberly’s picture

Version 6 is out. Can you re-roll this against the new release?

chrisck’s picture

Status: Needs work » Needs review
FileSize
16.96 KB

@Daniel.Moberly Here is the patch re-rolled against the new release. I've tested the new permissions setting and it is working.

Daniel.Moberly’s picture

Status: Needs review » Reviewed & tested by the community

This looks good - thanks to all for their hard work!

Daniel.Moberly’s picture

Status: Reviewed & tested by the community » Fixed
Daniel.Moberly’s picture

Added a little info to the readme file

  • Daniel.Moberly committed 2da35a9 on 8.x-2.x authored by chrisck
    Issue #3219579 by manuel.adan, dennis_meuwissen, chrisck, Daniel.Moberly...

Status: Fixed » Closed (fixed)

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

juanpablomitriatti’s picture

Hi
This patch solved the issue for fontawesome8.x-2.22 version. Given that, the last fontawesome version works only for Drupal 9.4 or higher, then I created a patch for 8.x-2.22 version that hides the additional icon settings form and is not necessary to have that Drupal version.

URL :https://www.drupal.org/files/issues/2022-11-20/hidding_font_awesome_addi...

JuanMitriatti’s picture

Hi,
I made a correction to the comment patch #16

JuanMitriatti’s picture

Hi,
In my previous comment, I left a patch that only works for the FontAwesome version 8.x-2.22 #17

At this comment, I leave attached a new patch that works for the latest FontAwesome version (8.x-2.24).