(I hope critical status is appropriate for this).

Problem/Motivation

Unable to save nodes.

Steps to reproduce:

  1. Install Drupal 8.4.x head on Ubuntu 14.04 which provides PHP-5.5.9.
  2. Go to node/add/page
  3. Enter title and body.
  4. Click "Save and Publish".

This results in the following:

Fatal error: Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection has colliding constructor definitions coming from traits in /vagrant/www/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php on line 375

As you can see, I'm running this in Vagrant but I have also tried it on a clean install of Ubuntu 14.04 at Digital Ocean with the same result.

It appears to be related to this https://www.drupal.org/node/2787873

The problem is solved if I roll back to commit 3225473ddddf23fbfd9d22fe27190165a701c744
It returns if I go to b0900c73b120bdec147393423266e27d0209ee9d

I haven't tried it on a later version of PHP yet but I suspect this is PHP version related because it obviously passes the tests on 5.6.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tetranz created an issue. See original summary.

tetranz’s picture

Title: Fatal error when saving a node. Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection has colliding constructor definitions coming from traits » Fatal error when saving a node. colliding constructor definitions coming from traits
cilefen’s picture

Title: Fatal error when saving a node. colliding constructor definitions coming from traits » Fatal DefaultSelection has colliding constructor definitions coming from traits on PHP 5.5.9

I am ok with this being critical as written. There is no data loss, but a principal product feature—adding content—is broken apparently. There is no fatal on PHP 7.1.4.

xjm’s picture

We do have nightly tests on 5.5, but they have not run yet:
https://www.drupal.org/pift-ci-job/681697

So I am going to manually trigger them now and see what happens.

xjm’s picture

@tetranz, are you sure this is a core installation only with no contributed modules?

tetranz’s picture

@xjm Yes. No contrib modules.

tetranz’s picture

Those tests have passed so ... I'm not sure what to make of that. Maybe it's just the Ubuntu version.

For what it's worth, this patch fixes the problem for me. I guess it partially defeats the purpose of the trait. I'm not sure if {@inheritdoc} is really correct there.

I followed the suggestions from the first answer here:
https://stackoverflow.com/questions/12478124/how-to-overload-class-const...

cilefen’s picture

Status: Active » Needs review
cilefen’s picture

I am confirming this fatal on PHP 5.5.9.

cilefen’s picture

Status: Needs review » Fixed

I reverted the problem commit.

xjm’s picture

Thanks @tetranz for the prompt issue report! We'll try to figure out what broke things over in #2787873: Add a base class for entity reference selection handlers and fix the structure of their configuration before recommitting that.

Adding credit for cilefen since he reproduced the fix as well.

Status: Fixed » Closed (fixed)

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

xjm’s picture

Status: Closed (fixed) » Closed (duplicate)