Problem/Motivation

Module upgrade from 3.7 to 3.8

TypeError: Argument 1 passed to Drupal\Core\Condition\ConditionPluginBase::setConfiguration() must be of the type array, null given, called in /web/modules/contrib/lazy/src/Form/LazyForm.php on line 324 in Drupal\Core\Condition\ConditionPluginBase->setConfiguration() (line 99 of /web/core/lib/Drupal/Core/Condition/ConditionPluginBase.php)

Steps to reproduce

When hitting the Configuration form.
URL: admin/config/content/lazy

Comments

ThirstySix created an issue. See original summary.

thirstysix’s picture

Version: 8.x-3.7 » 8.x-3.8
henry.odiete’s picture

looks like the issue has been solved in 3.8 see https://www.drupal.org/project/lazy/issues/3212294

osman’s picture

Hi @ThirstySix

I was able to reproduce the same error while upgrading from 3.6 to 3.7 (3.8 returns some other error).

But only if I don't run the updates (/updates.php or drush updb) after the upgrade.

After running the updates, the Lazy settings page refreshes without an error.

Could you check whether the updates ran successfully?

sunil.yadav’s picture

Hi @Osman,
I am getting same issue on version 3.8

ypeError: Argument 1 passed to Drupal\Core\Condition\ConditionPluginBase::setConfiguration() must be of the type array, null given, called in /app/web/modules/contrib/lazy/src/Form/LazyForm.php on line 324 in Drupal\Core\Condition\ConditionPluginBase->setConfiguration() (line 99 of /app/web/core/lib/Drupal/Core/Condition/ConditionPluginBase.php)

When i am reinstalling It is working.

The issue is array
// Set the default condition configuration.
$this->condition->setConfiguration($lazy_settings->get('visibility'));
is having empty value.

Kindly suggest me.

keithdoyle9’s picture

I get the same error on 3.8 (after upgrading from 3.6) when trying to access /admin/config/content/lazy.

The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\Core\Condition\ConditionPluginBase::setConfiguration() must be of the type array, null given, called in /app/web/modules/contrib/lazy/src/Form/LazyForm.php on line 324 in Drupal\Core\Condition\ConditionPluginBase->setConfiguration() (line 99 of core/lib/Drupal/Core/Condition/ConditionPluginBase.php).

When looking at the site itself, I get the following error:

Notice: Undefined index: minified in /app/web/modules/contrib/lazy/lazy.module on line 281 Notice: Undefined index: libraryPath in /app/web/modules/contrib/lazy/lazy.module on line 282
stevenpatz’s picture

Chiming in that I am also seeing these errors. drush updb was run. drush cim was run. On the status page I see this

Not installed
The lazySizes library needs to be downloaded and extracted into the folder in your Drupal installation directory. The name of the extracted folder has to be lazysizes. If you manage assets via Composer, you can use composer require bower-asset/lazysizes to download the library.

But the lazysizes library does exist.

I can't get to the lazy settings.

  • osman committed 0c50076 on 8.x-3.x
    Issue #3213124: TypeError: Argument 1 passed - must be of the type array...
keithdoyle9’s picture

@StevenPatz - Same here even though it's required and installed in the exact place it was previously.

keithdoyle9’s picture

Just tried the dev branch with the latest commit 0c50076 from above and I am able to get to the config settings page , but the error is still there in the status page.

The lazySizes library needs to be installed at the folder in your Drupal installation directory.

If you manage assets via Composer, you can use composer require bower-asset/lazysizes to download the library.

If you manually download the library, make sure the folder name is lazysizes.
keithdoyle9’s picture

This seems to have worked for me on the dev branch:

  1. Go to lazy config page
  2. Save configuration
  3. Export configuration

After that, the warning is gone on the Status Report.

thirstysix’s picture

Issue summary: View changes
thirstysix’s picture

Yes @keithdoyle9, It works well with 8.x-3.x-dev.

Here is the Patch for 8.x-3.8 version only,

osman’s picture

Status: Active » Fixed

Hi, thank you all for feedback. I understand the dev release fixes the issue for all. This will be included in upcoming 3.9 release.

Status: Fixed » Closed (fixed)

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