@return docs for EntityListBuilder::buildRow() are wrong

Created on 30 November 2022, about 2 years ago
Updated 10 November 2023, about 1 year ago

Problem/Motivation

The docs say:

   * @return array
   *   A render array structure of fields for this entity.

The documentation for a specific method, "@return array", suggests that the method should return an array structure for the entity fields. However, the actual return value of this method and its child classes' implementations appears to resemble table cell data for the table template instead. This discrepancy between the expected return value outlined in the documentation and the practical implementation needs to be addressed. This issue may lead to confusion for developers trying to utilize the method as per the provided documentation.

E.g. in MediaListBuilder:

    $row['status'] = $entity->isPublished() ? $this->t('Published') : $this->t('Unpublished');

      $row['language'] = $this->languageManager->getLanguageName($entity->language()->getId());

Steps to reproduce

Proposed resolution

Revise the method's documentation to accurately reflect the current output. Provide a more precise description of the data structure being returned,
Conduct thorough testing to verify that the revised implementation accurately reflects the updated documentation.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Documentationย  โ†’

Last updated 1 day ago

No maintainer
Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim

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

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