Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

joachim’s picture

Issue summary: View changes
socketwench’s picture

Looks like we're only failing on 8.4.x and PHP7. Which is...an interesting combination of things. Maybe something with arrays changed.

joachim’s picture

The tests are probably failing for everything, it's just that that's the only combination I requested a retest for.

jhedstrom’s picture

There are far fewer fails on 8.3.x. I wonder what changed in 8.4.x...

jhedstrom’s picture

It's just the js tests failing on 8.3.x from what I can tell. Not sure if that is a problem with my local or not...

jhedstrom’s picture

Wow, something very odd is going on. The js tests pass if run with the vendor/bin/phpunit runner, but are failing when run with run-tests.sh. I wonder if there's a core issue for this?

socketwench’s picture

At least I can fix some of the notices...

andypost’s picture

Status: Needs work » Needs review
andypost’s picture

+++ b/src/Plugin/Flag/EntityFlagType.php
@@ -166,7 +166,7 @@ class EntityFlagType extends FlagTypeBase {
-      '#default_value' => $this->configuration['extra_permissions'],
+      '#default_value' => $this->configuration['extra_permissions'] ?? [],

This should use \Drupal\Component\Plugin\ConfigurablePluginInterface::defaultConfiguration()

Status: Needs review » Needs work

The last submitted patch, 8: 2856619.8.flogizblork.patch, failed testing.

socketwench’s picture

So the funny thing about most of these failures is that, as Andypost points out, we should be using ::defaultConfiguration(). With the exception of extra_permissions, we *are* using defaultConfiguration() for all the classes that throw the notice.

When I dug around, we do call defaultConfiguration in the FlagTypeBase constructor:

$this->configuration += $this->defaultConfiguration();

But for some reason this isn't calling the child class, but the base class's defaultConfiguration(). We then get an empty array, and all those notices pop up.

jhedstrom’s picture

Status: Needs work » Needs review
FileSize
766 bytes

Ah, this is the issue: https://www.drupal.org/node/2852190

Here's a fix to do just that.

Status: Needs review » Needs work

The last submitted patch, 13: 2856619-13.patch, failed testing.

jhedstrom’s picture

Status: Needs review » Needs work

The last submitted patch, 15: 2856619-15.patch, failed testing.

jhedstrom’s picture

The fix above put the array merge in the wrong method (getConfiguration() rather than setConfiguration()).

Status: Needs review » Needs work

The last submitted patch, 17: 2856619-17.patch, failed testing.

jhedstrom’s picture

Ok, this time! Typo in that last patch using $this->configuration instead of the passed parameter!

martin107’s picture

Title: Tests are failing » Failing Tests: Configurable plugins should merge default configuration.
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Not sure how this has happened

It is nice to have an answer ... I have updated the issue summary to make the change record prominent.

The patch looks like a good solution.

Tests are happy so +1 from me.

joachim’s picture

Thanks for the detective work everyone!

(And nice to know that it's core that changed, rather than us that screwed up!)

What CR https://www.drupal.org/node/2852190 doesn't make clear is whether the new code that plugins should implement is backwards-compatible with 8.3.x.

jhedstrom’s picture

I just queued the tests to run against 8.3.x. I think they will be backward compatible since no new methods that might not have existed on 8.3.x are added here.

socketwench’s picture

  • joachim committed 4e768db on 8.x-4.x authored by jhedstrom
    Issue #2856619 by jhedstrom: Fixed failing tests due to core change with...
joachim’s picture

Status: Reviewed & tested by the community » Fixed

Committed!

Thanks everyone!

Status: Fixed » Closed (fixed)

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