Problem/Motivation
We have a special form at /farm/settings/modules that allows users with permission to enable farmOS modules. This provides a simpler UI than Drupal's core /admin/modules, with a more limited set of options, and it's own dedicated permission.
However, this currently uses a hard-coded list of modules that are included with farmOS core: https://github.com/farmOS/farmOS/blob/ddff82052a8d522752c1de4d7ed529b55e...
This means that contrib farmOS modules will not appear in this list, even if they are present in the filesystem.
Proposed resolution
TBD
Remaining tasks
TBD
User interface changes
TBD
API changes
TBD
Data model changes
TBD
Issue fork farm-3220609
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:
- 3220609-add-a-mechanism changes, plain diff MR !22
Comments
Comment #2
m.stentaComment #5
paul121 CreditAttribution: paul121 commentedThis simply adds separate Core and Contrib details elements with checkboxes for each. A minor improvement is that the submit button is disabled until an uninstalled module becomes checked.
I only included the module name, but it might be nice to include descriptions for contrib modules too? Even a link? Maybe this can be a follow up.
I didn't add any tests for this, mostly because we don't have any existing tests for this form. Would it be good to add some?
Comment #6
paul121 CreditAttribution: paul121 commentedComment #7
paul121 CreditAttribution: paul121 commentedOkay, I added functional javascript tests that should cover everything that happens in this module settings form - user permissions, module installation, and form #states behavior.
Comment #8
paul121 CreditAttribution: paul121 commentedThe javascript tests are dependent on the changes in this PR: https://github.com/farmOS/farmOS/pull/437
Comment #10
m.stentaPerfect! Thanks @paul121!
I added a few small commits to the end and merged it.
Quick summary of my changes:
FarmSettingsModulesForm::moduleOptions()
since{@inheritdoc}
no longer applies.disabled
logic from FarmModulesForm (no longer needed).hook_help()
text at the top of the page.My motivation for the last two were mainly aimed at simplifying translateable text, so they wouldn't need to include the
@type
placeholder, which would be replaced with "core" or "contrib". I'd rather use the word "Community" instead of "Contrib" because it's less Drupal-y. :-)