State required asterisk doesn't show

Created on 27 September 2017, about 7 years ago
Updated 18 August 2023, over 1 year ago

Problem/Motivation

When using state required, the asterisk doesn't show.

Proposed resolution

- Modify state.js on required to add classes "js-form-required form-required" on label or legend.

Remaining tasks

- Review patch

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Ajax 

Last updated 1 day ago

Created by

🇫🇷France vqgr

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

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

  • Status changed to Needs work almost 2 years ago
  • 🇫🇮Finland lauriii Finland

    It would be great if we could write some tests for this, just to make sure that this continues to work in future 😇

  • 🇺🇦Ukraine voleger Ukraine, Rivne

    Needs reroll as in 10.0.x branch *.es6.js files exists anymore

  • 🇮🇳India _utsavsharma

    Patch for 10.1.x.

  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
  • Status changed to Needs work almost 2 years ago
  • 🇺🇸United States smustgrave

    Still needs test coverage so this is not ready for review yet.

  • fathima.asmat London, UK

    Rerolled patch 54 to resolve warning "Undefined index: title_display in template_preprocess_text_format_wrapper".

  • 🇨🇦Canada mdolnik

    Patch doesn't seem to apply cleanly to 9.5, so I've rerolled.

    Sorry about my failing patch in #52 🐛 State required asterisk doesn't show Needs work not sure why it was not applying when I submitted it.

    It seems that many of the subsequent re-rolls have introduced issues or omitted patch changes that were present in #52 that are no longer present in the latest #65.

    I have provided updated patch files for D8, D9, and D10/11 (10-1-x currently applies to both versions).

    Patches 8.9.x and 9.5.x provide the same changes.

    The main differences between 9.5.x and 10.1.x:

    1. Removes the states.es6.js which no longer exists.
    2. Removes the bartik template changes as the theme no longer exists.
    3. Removes the classy template changes as the theme no longer exists.
    4. Removes the seven template changes as the theme no longer exists.
    5. Removes the stable template changes as the theme no longer exists.
    6. Alters the new claro template to be changed in the same fashion as other templates.
    7. Alters the new olivero template to be changed in the same fashion as other templates.
    8. Alters the new stable9 template to be changed in the same fashion as other templates.
    9. Alters the new starterkit_theme template to be changed in the same fashion as other templates.

    Besides the re-rolling only a single change has been made to states.js which is to add the lines:

    // Labels within a summary.
    + ', details > summary'
    
  • last update over 1 year ago
    Custom Commands Failed
  • last update over 1 year ago
    Custom Commands Failed
  • last update over 1 year ago
    Custom Commands Failed
  • 🇨🇦Canada mdolnik

    edit: Ok \Drupal\KernelTests\Core\Theme\ConfirmClassyCopiesTest tests are failing since text-format-wrapper.html.twig got changed here which changes the hash. This patch changes Stable and Stable9. Is that allowed? I was under the impression that it wasn't... I also notice that not all text-format-wrapper.html.twig files were changed (e.g: claro, bartik, etc).

    I am not sure about this, I may need someone with more knowledge as to what is allowed to be changed when it comes to base theme templates.

    Regardless whether it's allowed or not, one would need to make the same changes to overridden templates in their own themes as the title_display variable should be provided to all text-format-wrapper.html.twig templates, the theme will need to ensure that the value is utilize to add the form-no-label class or not.

    To clarify on these template changes, these are only to fix asterisks on formatted text widgets, so if this needs to be cut from the issue then it's not the end of the world and can be manually fixed on a site-by-site basis.

Production build 0.71.5 2024