Problem/Motivation

#3398891: Do not require the config in #config_target to be listed in getEditableConfigNames() makes implementing getEditableConfigNames() on a form that extends Drupal\Core\Form\ConfigFormBase unnecessary. We should deprecate it somehow.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

alexpott created an issue. See original summary.

catch’s picture

What if we made it non-abstract and returned an array by default in ConfigFormBaseTrait? At least to start with.

feuerwagen’s picture

Title: PP-1: Deprecate \Drupal\Core\Form\ConfigFormBase::getEditableConfigNames() - use #config_target instead » Deprecate \Drupal\Core\Form\ConfigFormBase::getEditableConfigNames() - use #config_target instead
Status: Postponed » Active

Blocker is in.

wim leers’s picture

Ohai, @Feuerwagen, welcome to the merry land of all things config validation — looking forward to seeing you around more hopefully! 😊

@catch: that sounds reasonable to me!

feuerwagen’s picture

Hi @Wim Leers, just doing some drive-by housekeeping while following the latest and greatest updates in core.

In awe of what you wizards are doing – I hope I can contribute something useful in the future. 😅

wim leers’s picture

No real wizardry going on, just chipping away at things one step at a time 😄 Let me know what kinds of things you'd be interested in exploring, and I'll find you something that matches that 😊

wim leers’s picture

Status: Active » Needs review

Quoting myself from #3384782-7: [PP-1] Follow-up for #3364506: add deprecation once all simple config forms in core implement:

#5 didn't explain how we could implement this deprecation in the >=10.2.x world.

Thanks to #3398891: Do not require the config in #config_target to be listed in getEditableConfigNames(), I see how we can now do that:

I propose that we make ConfigFormBase detect:

  1. when getEditableConfigNames() returns anything other than the empty array
  2. a deprecation is triggered in Drupal 11

Tricky thing here: for example \Drupal\search\SearchPageListBuilder uses not the base class, but the trait … and the trait does NOT have the #config_target functionality 🤔

AFAICT we'll need to deprecate in Drupal 11 only \Drupal\Core\Form\ConfigFormBase::getEditableConfigNames, not \Drupal\Core\Form\ConfigFormBaseTrait::getEditableConfigNames?

Tricky edge case: already (thanks to #3398891), a number of subclasses do not implement that method at all, and instead use RedundantEditableConfigNamesTrait;. That trait will become obsolete too!

Finally: is this issue now effectively a duplicate of #3400033: Deprecate \Drupal\Core\Form\ConfigFormBase::getEditableConfigNames() - use #config_target instead? Or vice versa?

Which issue do we keep? AFAICT the scopes are so tightly intertwined that it's easier to do together?

borisson_’s picture

The other issue is older; let's keep that.

smustgrave’s picture

Status: Needs review » Needs work

@Wim you linked to this issue, so not sure what the duplicate could be?

borisson_’s picture

borisson_’s picture