Problem/Motivation
\Drupal\feeds\Plugin\Type\PluginBase::getConfiguration() has an optional parameter with which a certain configuration item can be retrieved. However, this does not comply with the interface \Drupal\Component\Plugin\ConfigurableInterface in which it is stated that the method getConfiguration() always returns an array. When PluginBase::getConfiguration() is called with the optional parameter set, an array won't always be returned. There will be even returned nothing if the requested configuration key does not exist.
This also causes the following warning in PHPStan:
Method Drupal\feeds\Plugin\Type\PluginBase::getConfiguration() should return array but return statement is missing.
The warning is ignored (or will be) in phpstan.neon.
Proposed resolution
Deprecate the optional parameter $key of \Drupal\feeds\Plugin\Type\PluginBase::getConfiguration().
Update all calling code in the Feeds code base by no longer passing a parameter to that method.
$plugin->getConfiguration('foo')
would then be replaced with:
$plugin->getConfiguration()['foo']
Write a change record about this change, but keep supporting the method to be called with a parameter for now.
The deprecation message would be:
Calling PluginBase::getConfiguration() with the $key argument is deprecated in feeds:3.0.0-rc1 and will be removed from feeds:4.0.0. Use $plugin->getConfiguration()['foo'] instead. See https://www.drupal.org/node/xxx'
Where 'xxx' will be the node ID of the change record.
Code:
if (isset($key)) {
@trigger_error('Calling ' . __METHOD__ . '() with the $key argument is deprecated in feeds:3.0.0-rc1 and will be removed from feeds:4.0.0. Use $plugin->getConfiguration()[\'foo\'] instead. See https://www.drupal.org/node/xxx', E_USER_DEPRECATED);
}
Remaining tasks
- Draft a change record about this change.
- Trigger an error with a deprecation message when
\Drupal\feeds\Plugin\Type\PluginBase::getConfiguration()is called with a parameter. - Update all calls to
PluginBase::getConfiguration()to no longer pass a parameter (but do ensure that the same data is retrieved). - Commit.
- Publish the change record.
User interface changes
None.
API changes
The parameter $key in \Drupal\feeds\Plugin\Type\PluginBase::getConfiguration() is kept, but will trigger an error when used.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Schermafbeelding 2026-06-05 om 15.35.00.png | 35.95 KB | megachriz |
Issue fork feeds-3461140
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 #4
benstallings commentedI apologize, I don't know how to go about filing a change record.
Comment #5
megachriz@benstallings
Thanks for helping on this issue! :)
Change record
A change record describes a change. If it is about a deprecation, it describes the situation before the change and the situation after the change.

To add a change record, you can click on the link "add change notice" on this page. Keep the option "Published" unticked.
For a list of all Feeds change records, see:
https://www.drupal.org/list-changes/feeds
You can perhaps use some of them as examples.
I'll be on holiday in a few days, so I likely won't respond to issues in the next few weeks.
Comment #6
benstallings commentedhttps://www.drupal.org/node/3593934 is the draft change record.