Problem/Motivation
In DraggableListBuilderTrait:
protected $weightKey = FALSE;
If a using class tries to do:
protected $weightKey = 'weight';
then you get this crash:
> Fatal error: Drupal\finders_facets\Entity\Handler\FindersFacetListBuilder and Drupal\Core\Entity\DraggableListBuilderTrait define the same property ($weightKey) in the composition of Drupal\finders_facets\Entity\Handler\FindersFacetListBuilder. However, the definition differs and is considered incompatible. Class was composed in /var/www/html/repos/finders/modules/finders_facets/src/Entity/Handler/FindersFacetListBuilder.php on line 12
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3590729
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
joachim commentedI was thinking it was because of the type changing, but it's not even that, it's just the differing value -- this crashes too:
Comment #5
ishani patel commentedHello @joachim,
I've raised MR.
Could you please review it.
Thank you!
Comment #6
nitinkumar_7 commentedReplacing the property with getWeightKey() is the right approach.
A few things to fix before this is ready:
1. Remove $weightKey from the trait entirely. If the property stays, the original crash still happens for classes using the trait directly.
2. Check for remaining $this->weightKey references with grep -rn 'weightKey' core/ — any direct property reads left behind will cause "undefined property" errors once the property is removed.
3. Investigate the failing tests.