This is a quick follow-up to #2639526: Calling BlockDisplayVariant::setConfiguration() won't change results returned from plugin collections

The code that was committed works great if your calling BlockDisplayVariant::setConfiguration($config) with a config array that you got from calling BlockDisplayVariant::getConfiguartion() - however, it's actually quite common to call setConfiguration([]) when creating a new variant! In that case, there are some (harmless) PHP warnings.

Basically, we need to use the configuration after the defaults are mixed in to prevent these warnings. I'll attach a patch in a moment.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dsnopek created an issue. See original summary.

dsnopek’s picture

Status: Active » Needs review
FileSize
858 bytes

Here's the patch!

Status: Needs review » Needs work

The last submitted patch, 2: ctools-block-display-warnings-2639926-2.patch, failed testing.

The last submitted patch, 2: ctools-block-display-warnings-2639926-2.patch, failed testing.

dsnopek’s picture

Status: Needs work » Needs review
FileSize
4.85 KB

Bah! I think that was actually a problem with the test: it depended on the container (which isn't initialized in a unit test), rather than injecting its dependencies. This one runs for me locally!

EclipseGc’s picture

Status: Needs review » Fixed

looks good!

fixed

Eclipse

  • EclipseGc committed 00f5f03 on 8.x-3.x authored by dsnopek
    Issue #2639926 by dsnopek: PHP warnings on BlockDisplayVariant::...

Status: Fixed » Closed (fixed)

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