Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When running drush fr feature_foo
, warnings are emitted, like
[warning] Undefined array key 1 FeaturesCommands.php:728
Steps to reproduce
- Create a feature called
feature_foo
in a bundle calledbar
. - Run
drush fr feature_foo
- Observe the above-mentioned warning
Data is actually correct in spite of the warning, because $component
is set to empty, and handled as such anyway.
Proposed resolution
Avoid the warning by appending, probably by appending an extra ":" at the end of the featureString.
Remaining tasks
Do it.
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork features-3202711
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 #3
fgmSetting CNR.
Comment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commentedThe solution works but it took me a second to understanding it.
@see https://stackoverflow.com/questions/2867310/php-explode-and-set-to-empty...
I think the empty string instead of null for $component is fine.
The online alternative I can think of allow $component to be NULL is...
Here is my sandbox for playing with the other solutions.
https://onlinephp.io/c/d10ee
Comment #5
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commentedComment #6
Dave ReidComing to this because we started seeing this happening on our Pantheon deployments:
Comment #10
nedjoMerged, thanks!
Comment #12
rwam CreditAttribution: rwam commentedHi @nedjo,
any chance to see a minor release in the next time? Because 8.x-3.12 was released two years ago and I'd like to see some fixes in a new version.
Thanks & bye
Ralf
Comment #13
matthandFeatures Version 8.x-3.13 was just released and includes this fix. Thank you for your contribution.