After exporting a package, went to Extends page to enable the module. Got this error:

Call to a member function getBundle() on a non-object in /var/www/docroot/modules/contrib/features/src/FeaturesManager.php on line 878

Comments

mpotter created an issue. See original summary.

  • mpotter committed 43b881c on 8.x-3.x
    Issue #2598246: Enabling an exported feature module causes error
    
mpotter’s picture

Status: Active » Fixed

I fixed this in commit 43b881c, but not actually sure the method is correct.

It seems that in #2596047: Duplicate packages generated there were a lot of changes around short and full names that require getting the current Bundle. When a module is installed and the FeaturesConfigInstaller::findPreExistingConfiguration() function tries to listExistingConfig() it was trying to get the bundle from "$this->assigner" which wasn't set yet.

So I added a condition to getAssigner() to use the standard service if none is defined. Then changed all references of "$this->assigner" to "$this->getAssigner()".

Not really sure how to properly handle the dependency injection here. I think the FeaturesManager and FeaturesAssigner aren't quite modular enough because they both depend on each other. This kind of circular reference is probably bad.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.