If an install profile (like config_installer) has no dependencies, then this warning will be produced.

Warning: array_diff(): Argument #1 is not an array config_installer.profile:193[warning]
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frankcarey created an issue. See original summary.

frankcarey’s picture

Status: Active » Needs review
FileSize
978 bytes

This does some checking to make sure dependencies is set and is an array, and it sets a default value if it isn't.

SchnWalter’s picture

Title: Warning: array_diff(): Argument #1 is not an array config_installer.profile:193[warning] » array_diff warning during profile installation
Version: 8.x-1.3 » 8.x-1.x-dev
Assigned: frankcarey » Unassigned
Status: Needs review » Reviewed & tested by the community

The patch also works against latest commit in 8.x-1.x branch.

heddn’s picture

Fixes the problem. Let's get this merged.

cronos0’s picture

I have encountered the same issue, another error in the same function, because some times
`_config_installer_get_original_install_profile` doesn't return the profile name but return `NULL` (like docs on function say)

But in `config_installer_install_uninstalled_profile_dependencies` doesn't check the returned value at all.

i attach another patch.

mchelen’s picture

What is the status on getting this patch merged in?

alexpott’s picture

Is this testable? The config_installer does have tests - they can only be run locally because of d.o issues.

alexpott’s picture

FileSize
23.15 KB

Here's a test.

Without the fix

Drupal test run
---------------

Tests to be run:
  - \Drupal\config_installer\Tests\ConfigInstallerNoDependenciesProfile

Test run started:
  Saturday, February 25, 2017 - 17:45

Test summary
------------

\Drupal\config_installer\Tests\ConfigInstallerNoDependencies  27 passes             2 exceptions
- Found database prefix 'test32631747' for test ID 15.

Test run duration: 8 sec

With the fix

Drupal test run
---------------

Tests to be run:
  - \Drupal\config_installer\Tests\ConfigInstallerNoDependenciesProfile

Test run started:
  Saturday, February 25, 2017 - 17:49

Test summary
------------

\Drupal\config_installer\Tests\ConfigInstallerNoDependencies  27 passes

Test run duration: 9 sec
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

  • alexpott committed bbd7a73 on 8.x-1.x authored by frankcarey
    Issue #2760923 by frankcarey, alexpott: array_diff warning during...
mchelen’s picture

Great, thanks!

Status: Fixed » Closed (fixed)

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