Does not work on default Drupal 9.4 Admin Theme - Claro

Created on 21 June 2022, over 2 years ago
Updated 21 November 2023, about 1 year ago

If you intall this module on Drupal 9.4 with the default admin theme - Claro, it does not show the * next to required fields. However, the moment I switch to the Bootstrap5 theme, they are shown.

Since Claro is now the default Admin theme, I marked this issue as a bug.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany NWOM

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡«πŸ‡·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
  • πŸ‡ΊπŸ‡¦Ukraine AstonVictor

    It doesn't work with Olivero theme as well. So, adding #block-claro-content theme-related selector is not correct.

  • Merge request !73291650 - Add new styles β†’ (Merged) created by AstonVictor
  • Status changed to Needs review about 1 year ago
  • πŸ‡ΊπŸ‡¦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
  • 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
  • πŸ‡ΊπŸ‡¦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.

Production build 0.71.5 2024