Extract DraggableListBuilderTrait from DraggableListBuilder for use with content entities

Created on 1 August 2018, over 6 years ago
Updated 20 March 2024, 8 months ago

Problem/Motivation

Content entities may support weights and may want to use a list builder with drag-and-drop capabilities. Unfortunately DraggableListBuilder is only available for config entities.

While it probably doesn't make sense to add a draggable list builder for content entities in core without actually having an example implementation, a lot of the logic is not really specific to config entities so it would be unfortunate to duplicate it.

Proposed resolution

Extract the common logic into a trait. The only config-entity specific bits are extracted into public function getWeight($entity) and public function setWeight($entity, $weight) which DraggableListBuilder implements for config entities. This will ease adding a draggable content entity list builder in contrib. In fact I hope to add it Entity API.

πŸ“Œ Task
Status

Fixed

Version

10.3 ✨

Component
EntityΒ  β†’

Last updated about 5 hours ago

Created by

πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024