Problem/Motivation
Reported by Drupal (10.5) in the generated HTML source:
<!-- INVALID FILE NAME SUGGESTIONS:
See https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!theme.api.php/function/hook_theme_suggestions_alter
form_options_attributes__select__options_attributes
-->
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!theme.api.... states:
New suggestions must begin with the value of HOOK, followed by two underscores to be discoverable.
That means that the suggestion should started with the theme hook it extends, and not with the module name as is currently the case.
Proposed resolution
Rename:
- the theme implementation from
form_options_attributes__select__options_attributestoselect__form_options_attributes - the associated template file from
form-options-attributes--select--options-attributes.html.twigtoselect--form-options-attributes.html.twig - the preprocess function from
form_options_attributes_preprocess_form_options_attributes__select__options_attributestoform_options_attributes_preprocess_select__form_options_attributes
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | AfterMR.png | 60.96 KB | anirudhsingh19 |
| #6 | BeforeMR.png | 69.8 KB | anirudhsingh19 |
Issue fork form_options_attributes-3554473
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:
Comments
Comment #3
berliner commentedComment #4
berliner commentedTh MR does the changes proposed in the issue description, tests are still passing.
Comment #5
anirudhsingh19 commentedreviewing this!
Comment #6
anirudhsingh19 commentedI installed the module on D10 and can confirm the issue exists (See the screenshot). For reproducing the issue, I created a custom module and a new select field in a form. I applied the MR and issue was fixed. Hence, moving to RTBC.
Comment #8
zengenuity commentedMerged. Thanks!
Comment #10
zengenuity commentedThis is now part of the 2.1.1 release.