admin/config/development/configuration/features
PHP error
8.x-3.0-alpha5
Recoverable fatal error: Argument 1 passed to Drupal\features\FeaturesAssigner::setCurrent() must implement interface Drupal\features\FeaturesBundleInterface, null given, called in /$SITEROOT/modules/features/src/FeaturesAssigner.php on line 414 and defined in /$SITEROOT/modules/features/src/FeaturesAssigner.php on line 242 request_id="v-36e6b364-acc3-11e5-a506-22000a880cb5"
8.x-3.x
Recoverable fatal error: Argument 1 passed to Drupal\features\FeaturesAssigner::setCurrent() must implement interface Drupal\features\FeaturesBundleInterface, null given, called in /$SITEROOT/modules/features/src/FeaturesAssigner.php on line 404 and defined in /$SITEROOT/modules/features/src/FeaturesAssigner.php on line 232 request_id="v-29b09202-acc1-11e5-9cb0-22000a880cb5"
white screen of death, wsod
The website encountered an unexpected error. Please try again later.
Cannot access the Features tab in Configuration Synchronization tab.
Comments
Comment #2
jacov commentedand it looks like it is broken in drush8 as well...
Comment #3
jacov commentederrors on the following commands as well...
Comment #4
jacov commentedlooks like this is the code that is failing...
$enabled is a non-object and getEnabledAssignments() is struggling
...diving deeper...
Comment #5
jacov commenteduploading patch to fix the multiple fatal php errors caused by bundle variables not being set properly. fixes white screen of death and fixed drush8
Comment #6
jacov commentedComment #7
jacov commented@nedjo && @dawehner && @mpotter please review patch #6 attached.
fixes multiple fatal errors including drush.
main issue was that variable $bundle was being initiated based on null objects and not being checked. i added conditional statements to check and set null where applicable.
Comment #9
nedjo@jacov: Thanks for posting. I can't reproduce the issue. Can you please provide steps to reproduce this error from a clean install?
Comment #10
jacov commented@nedjo sure...
create a Feature bundle, in my case i created a Feature that exports my custom content type & its related views.
then download this feature through the web interface, and put the extracted archive in your /modules folder.
this should put you in the state to reproduce the errors.
(in a few versions back, before converting to objects?, i was able to see the new module / feature the features gui and use the Write button, now that doesn't work, but at least the patch gets me passed the wsod errors)
also, once you have your feature in your /modules dir, you can run the drush8 commands to see the error too.
Comment #11
nedjoI followed those steps starting with a clean install of core 8.0.1 and of the current Features dev but couldn't reproduce the issue. Please ensure you're starting with a fresh install of core and Features (in particular, that you have not updated from any previous version of Features) and list exactly the steps you've taken to reproduce the error. Thanks.
Comment #12
nedjoClosing due to lack of response, but please feel free to reopen with new information. Thanks.
Comment #13
arh1 commentedFor posterity, I saw this error when I'd enabled Features, created a Bundle and Feature and deployed them, but failed to deploy related core config (in my case, features.settings.yml and features.bundle.mybundle.yml).
Comment #14
sandboxplI was struggling with the same problem for a long time on project where features module was used since very long and updated continously.
For some reason I did get stucked with 8.x-3.x versions, I was unable to revert my features with drush, and to visit features admin page.
After debugging the code I've found that FeaturesAssigner is trying to use FeaturesBundleInterface::DEFAULT_BUNDLE constant and set default bundle, for features which are not assigned to any other bundle.
Then I've started to look for corresponding config object for features.bundle.default and for some reason it was missing, even in config table.
To restore that config object I had to reimport contents config/install/features.bundle.default.yml file, module reinstallation would wor kas well, but I was unable to go this way,
so I've used following code to consume single config file and write it into config storage again:
After restoring default bundle, everything works well and I can find this bundle in config table again
I've went through the repository, and I've found that this config wile was added with tag 8.x-3.0-alpha6
http://cgit.drupalcode.org/features/commit/?h=8.x-3.x&id=731b97fddf1ee04d836dc1d1b131881b39494b2f
The question is - is it possible that this config file is not getting installed for project with features module used since old version like 8.x.2-x ?
Maybe we should have some update hook in v 8.x-3.x to make sure default bundle exists? Example patch attached
Comment #15
nedjoThis looks like a support request that was answered. Please feel free to reopen if otherwise.