Views "display menu tabs" styling breaks when adding an "Entity Reference" display

Created on 28 June 2024, 8 months ago
Updated 1 July 2024, 8 months ago

Problem/Motivation

views fieldset labels do not render css when adding entity reference.

Steps to reproduce

Add View => /admin/structure/views/add then continue to add entity reference

Proposed resolution

Correct Views fieldset labels to render css when adding entity reference.

πŸ› Bug report
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
Views UIΒ  β†’

Last updated about 8 hours ago

Created by

πŸ‡¦πŸ‡ΊAustralia sophron

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

Comments & Activities

  • Issue created by @sophron
  • First commit to issue fork.
  • misterdidi β†’ changed the visibility of the branch 3457768-views-fieldset-labels to hidden.

  • misterdidi β†’ changed the visibility of the branch 3457768-views-fieldset-labels to active.

  • After digging into the code, I found out that :
    - Claro module moved its file responsible for the styling of tabs css/components/views-ui.css from global-styling library to a new one called views_ui which extends views/views.module library.
    - views/views.module is attached to any new ViewExecutable object through its $element property and used in the render array of Drupal\views\Plugin\views\display\DisplayPluginBase::render().
    - for Entity Reference display, the display plugin Drupal\views\Plugin\views\display\EntityReference overrides its parent render() function and does not attach the view $element property to the render array. Hence, views/views.module is never attached and the claro/views_ui never used for an Entity Reference display.

    I wrote a patch in which I chose to alter the render() method of EntityReference to mimic DisplayPluginBase::render() and always return the view $element['#attached'] value with the render array.

  • Status changed to Needs review 8 months ago
  • πŸ‡΅πŸ‡ΉPortugal lolgm

    I believe this issue is a part of πŸ› Secondary tabs design is distorted on block view page Active .

    If it really is, I believe this is a duplicate.

  • Status changed to Postponed: needs info 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    @misterdidi can you confirm if this is a duplicate? If not it should go back to Needs work though as will need an MR to review.

  • Status changed to Closed: duplicate 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States traviscarden

    Confirmed: This is a duplicate of πŸ› Secondary tabs design is distorted on block view page Active . The problem there (view-ui.css is missing) is the cause here, too, and adding it fixes the problem in both cases.

Production build 0.71.5 2024