Hi,

I have the last drupal version "8.0.0-beta11" and when I go to "admin/config/development/configuration/features" this error appear:

Recoverable fatal error: Argument 1 passed to Drupal\Core\Config\InstallStorage::getComponentNames() must be of the type array, string given, called in /drupal/modules/contrib/features/src/FeaturesInstallStorage.php on line 102 and defined in Drupal\Core\Config\InstallStorage->getComponentNames() (line 193 of core/lib/Drupal/Core/Config/InstallStorage.php).

Best regards

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

benjy’s picture

Status: Active » Needs review
FileSize
2.49 KB

Try the attached.

Anonymous’s picture

Hi
I get similar error

Recoverable fatal error: Argument 1 passed to Drupal\Core\Config\InstallStorage::getComponentNames() must be of the type array, string given, called in /var/www/caruro/htdocs/modules/contrib/features/src/FeaturesManager.php on line 816 and defined in Drupal\Core\Config\InstallStorage->getComponentNames() (line 193 of core/lib/Drupal/Core/Config/InstallStorage.php).

SpadXIII’s picture

Status: Needs review » Reviewed & tested by the community

Patch solves this issue!
Just did a clean install with latest beta and installed latest dev of features. Ran into the same problem, which is gone after the patch was applied.

SpadXIII’s picture

Status: Reviewed & tested by the community » Needs work

And as mokone91 mentioned (at the same minute), there's still a few places with the same/similar problem.

nedjo’s picture

Thanks for the draft patch.

The change that triggers this bug was this commit for #1081266: Avoid re-scanning module directory when a filename or a module is missing. Specifically, the patch changed the arguments to ExtensionInstallStorage::getComponentNames().

-   * @param string $type
-   *   Type of components: 'module' | 'theme' | 'profile'
-   * @param array $list
-   *   Array of theme or module names.
+   * @param \Drupal\Core\Extension\Extension[] $list
+   *   An associative array of Extension objects, keyed by extension name.

We call this method in two places. First, in FeaturesInstallStorage.php, we override two methods of ExtensionInstallStorage, and in each case we call getComponentNames(). This is what @benjy has addressed, adapting the relevant sections from the patch that introduced these changes.

The second is in FeaturesManager::listExtensionConfig(), which is what is triggering the remaining bug. It looks straightforward to address; the method already receives an Extension object as an argument.

mglaman’s picture

Status: Needs work » Needs review
FileSize
2.97 KB

Here's a patch to update usage of ExtensionInstallStorage::getComponentNames().

leewillis77’s picture

I'm still seeing the following error with patch #6 which I think relates to the call in FeaturesManager::listExtensionConfig()?

Recoverable fatal error: Argument 1 passed to Drupal\Core\Config\InstallStorage::getComponentFolder() must be an instance of Drupal\Core\Extension\Extension, string given, called in /core/lib/Drupal/Core/Config/InstallStorage.php on line 202 and defined in Drupal\Core\Config\InstallStorage->getComponentFolder() (line 241 of core/lib/Drupal/Core/Config/InstallStorage.php).

marthinal’s picture

FileSize
3.28 KB

I can confirm that it works. Rerolled.

To reproduce the last change from #6 you can use "drush fd MY_CUSTOM_MODULE" for example, and the method listExtensionConfig() will be executed. Also you can debug with xdebug and drush.

Should we start covering with some tests ?

Added

+bundle:
+  settings: []

See #2505787: Bundle settings is null, not array for FeatureBundleInterface::setSettings

thanks guys :)

  • nedjo committed dbaa834 on 8.x-3.x authored by benjy
    Issue #2497155 by mglaman, benjy, marthinal: getComponentNames must be...
nedjo’s picture

Thanks! Applied the fix from #6, as the settings array is fixed in #2505787: Bundle settings is null, not array for FeatureBundleInterface::setSettings.

nedjo’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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