standardize DraggableListBuilder / DraggableListBuilderTrait and ConfigEntityListBuilder's handling of rows returned by buildRow()

Created on 6 March 2024, 10 months ago
Updated 3 September 2024, 4 months ago

Problem/Motivation

ConfigEntityListBuilder and DraggableListBuilder / DraggableListBuilderTrait both have a buildRow() method which appears to expect the same thing -- a child class for a specific entity type should return rows for the table element.

However, they handle the return value completely differently.

- ConfigEntityListBuilder puts the rows into the table element's #data
- DraggableListBuilder / DraggableListBuilderTrait put the rows into the table element as child render elements.

This means that the following rows will work in ConfigEntityListBuilder but will produce warnings (and no output) with DraggableListBuilderTrait:

  public function buildRow(EntityInterface $entity) {
    $row['data']['name'] = $entity->label();
// OR:
    $row['data']['name'] = [
      'data' => $entity->label(),
    ];
}

There is more background in the related docs issue, 🐛 DraggableListBuilder / DraggableListBuilderTrait need to document that buildRow() behaves completely differently from the parent class Active .

This issue is for finding a way to standardize both to use child render elements, in a backwards-compatible manner for classes that use ConfigEntityListBuilder.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component
Entity 

Last updated about 2 hours ago

Created by

🇬🇧United Kingdom joachim

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

Comments & Activities

Production build 0.71.5 2024