Problem/Motivation
This is a related issue to https://www.drupal.org/project/diff_plus/issues/3485245
There's a bit of an odd design pattern that I've not encountered before with the diff module configuration. Essentially, when a third party module adds a new diff layout plugin type, unless the third party module also adjusts diff.settings:layout_plugins on install, the next time a site owner visits the diff general settings form they'll encounter a pile of warnings:

Steps to reproduce
- Install the diff module.
- Install the diff_plus module.
- Visit the diff general settings page. Observe warnings.
- Save the diff general settings page. Warnings are now gone (because the diff settings were updated).
Proposed resolution
Update the diff module settings form to be more lenient and assume that new plugins are disabled by default (and may not yet exist in active configuration).
If the diff module encounters any unknown plugin types, it should assume that they are disabled and that their weights are greater than the highest known plugin weight.
Remaining tasks
Fork, MR, review, merge, profit.
User interface changes
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| diff-warnings.png | 465.24 KB | luke.leber |
Issue fork diff-3515557
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 #2
luke.leberComment #3
acbramley commentedDefinitely should be doing the second proposed solution, there should be defense in that buildForm method for when
$config->get('general_settings.layout_plugins')[$id]returns NULLComment #4
luke.leberUpdate title + IS.
Thanks Adam.
Comment #6
luke.leberNW for phpstan fails that I don't quite understand.
Seems unrelated to this MR; possibly something to fix in HEAD?
Comment #8
acbramley commentedFixed!