EntityListBuilder::getTitle() seems pointless -> rethink it

Created on 13 February 2024, 5 months ago

Problem/Motivation

The EntityLIstBuilder class has a method ::getTitle() which by default returns nothing (null/void).

The method is called from EntityListBuilder::render(), to set the '#title' within a 'table' element.
But really, a `'#type' => 'table'` element does not use the '#title' property.

It is overridden in BlockContentTypeListBuilder::getTitle(), but the return value has no real effect.
We can change this return value to something else, but the page title on admin/structure/block-content remains the same, it is defined in the route definition.

Steps to reproduce

Edit core/modules/block_content/src/BlockContentTypeListBuilder.php.
Change the return value from getTitle().
Visit admin/structure/block-content.
Title is still the same.

Proposed resolution

There could be a use case for a title method to fill the _page title_ for a list page.
The current getTitle() method does not do that.

This would be mostly relevant for list pages that need a dynamic title.
Especially if the page title should be different from the route title that is used in the breadcrumb.

But, tbh, now I am not sure what we should do with this method, as it already exists.
I just report it.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated 1 minute ago

Created by

πŸ‡©πŸ‡ͺGermany donquixote

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

Comments & Activities

Production build 0.69.0 2024