- π«π·France PhilY πͺπΊπ«π· Paris, France
The fact is Claro table structure is different than expected by required_field_display module.
One solution is to rewrite required_field_display code to target Claro's structure (keeping existing code as it works for others admin themes).
Other solution is to add some CSS:
#block-claro-content .form-required .tabledrag-cell-content__item::after { content: '*'; color: #e32700; margin-left: 4px; }
If you're already using a child theme of Claro as your admin theme or a custom module, you can add the above lines to your css (which will do nothing in a custom front theme because we're in the admin space).
If not, attached patch will add these lines to required_field_display module as a temporary fix.BTW, I'm not sure about the best solution nor about which of Claro or required_field_display should be modified...
- Assigned to AstonVictor
- Status changed to Needs work
about 1 year ago 3:38pm 17 November 2023 - πΊπ¦Ukraine AstonVictor
It doesn't work with Olivero theme as well. So, adding
#block-claro-content
theme-related selector is not correct. - Status changed to Needs review
about 1 year ago 8:51am 21 November 2023 - πΊπ¦Ukraine AstonVictor
Created a new MR.
Implemented it in the following way:
- added a new custom wrapper to the 'Manage form display' form and 'Manage fields' table;
- added an additional class to cells with required fields (.required-field
);
- created a new library with styles for required fields;
- attached the library to both the form and table.Tested with all default themes for D10 themes (Olivero, Claro, Stark) and some contrib themes (Barrio Bootstrap 5, Bootstrap 5 admin).
- First commit to issue fork.
- Status changed to RTBC
about 1 year ago 11:44am 21 November 2023 - thakurnishant_06 India
Hi @Aston Victor,
I hope you are doing well. I reviewed and tested MR7 on my Drupal 9.4.0 setup, and the patch applied cleanly. Before applying the patch, the required fields were not showing on the manage field in the Claro theme. However, after applying the patch, it successfully resolved the issue, and now the required fields are visible in the manage fields section. I'm attaching screenshots for reference.
Moving it to RTBC.Thanks for your work on this.
- Issue was unassigned.
- Status changed to Fixed
about 1 year ago 11:49am 21 November 2023 - πΊπ¦Ukraine AstonVictor
Thanks for the review.
Merged and will be released in the next version.
Automatically closed - issue fixed for 2 weeks with no activity.