A crossroads: how to resolve warnings when a module adds new diff plugins?

Created on 26 March 2025, 19 days ago

Problem/Motivation

This is a related issue to https://www.drupal.org/project/diff_plus/issues/3485245 πŸ’¬ Warning in first installation Active

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:

I'm looking for some upstream guidance here. Thanks!

Steps to reproduce

  1. Install the diff module.
  2. Install the diff_plus module.
  3. Visit the diff general settings page. Observe warnings.
  4. Save the diff general settings page. Warnings are now gone (because the diff settings were updated).

Proposed resolution

Now there are a couple ways to approach this problem:

  • Adjust the diff module settings from a third party module on install

    I don't necessarily like this as I've not seen the pattern before. It seems very weird for a module to go and alter other module's settings on install.

  • 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).

    I do think this is a safer route than making assumptions about weights and such in a third party install hook.

Remaining tasks

See what the diff maintainers think.

User interface changes

None

API changes

None

Data model changes

None

πŸ’¬ Support request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States luke.leber Pennsylvania

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024