Issue with rendering unlimited cardinality fields in Views

Created on 3 July 2021, over 3 years ago
Updated 5 January 2024, 12 months ago

Problem/Motivation

When using a multiple value field in a view, I expect to have one result row for each value in multiple field, but that field is not rendered.

Steps to reproduce

Create an entity with a File field which allows multiple values.


    $fields['sprint_file'] = BaseFieldDefinition::create('file')
      ->setLabel(t('File'))
      ->setRequired(false)
      ->setDescription(t('File'))
      ->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED)
      ->setSettings(array(
          'uri_scheme' => 'private',
          'file_directory' => 'sprintfiles',
          'file_extensions' => 'png jpg jpeg pdf'
        ))
      ->setDisplayOptions('view', array(
          'label' => 'above',
          'type' => 'file',
          'weight' => -3,
      ))
      ->setDisplayOptions('form', array(
          'type' => 'file',
          'weight' => -1,
      ))
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayConfigurable('view', TRUE);

Create a view of the custom entity with "Table" format.
Include the File field in "Fields" and be sure to uncheck "Display all values in the same row"

Expected result

Actual result

๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Viewsย  โ†’

Last updated 2 days ago

Created by

๐Ÿ‡ช๐Ÿ‡ธSpain dtamajon

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

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