Problem/Motivation
Some standard Drupal infrastructure is missing or has minor issues.
1. Missing composer.json
The module has no composer.json. drupal.org generates one automatically, but having it in the repo is good practice for declaring metadata and PHP version requirements.
2. Missing package key in info.yml
Without a package key, the module shows up under "Other" on the Extend page. Something like package: Accessibility would make it easier to find.
3. Typo in phpcs.xml
Line 17:
<!-- Apply"Drupal" and "DrupalPractice coding standards. -->
Missing space after "Apply" and missing opening quote before "DrupalPractice".
4. hook_theme() has conflicting keys
In progressive_accessibility_widget.module, the theme definition for asw_widget sets both render element and variables:
'asw_widget' => [
'render element' => 'element',
'variables' => [
'widget_icon' => NULL,
],
],
These two keys are mutually exclusive. When variables is set, render element is ignored. Since the template uses {{ widget_icon }}, only variables should be kept.
Proposed resolution
- Add
composer.jsonwith correct metadata and license - Add
package: Accessibilitytoinfo.yml - Fix the phpcs.xml comment
- Remove
render elementfrom hook_theme()
Issue fork progressive_accessibility_widget-3584416
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
scontzen commentedPushed the fix to the branch. Changes:
composer.jsonwith metadata, keywords and license.package: Accessibilitytoinfo.yml.phpcs.xmlcomment.render elementfromhook_theme().Comment #5
guido_sTested with Drupal 11 and reviewed the code.
Looks good to me.
Comment #7
guido_sMerged and will be added in a new release.