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.

CommentFileSizeAuthor
views-entity-reference.JPG41.54 KBsophron

Issue fork drupal-3457768

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Sophron created an issue. See original summary.

misterdidi made their first commit to this issue’s 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.

misterdidi’s picture

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.

I do not have the rights to create a MR, though.

misterdidi’s picture

Status: Active » Needs review
lolgm’s picture

I believe this issue is a part of #3444998: Secondary tabs design is distorted on block view page.

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

smustgrave’s picture

Status: Needs review » Postponed (maintainer needs more info)

@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.

traviscarden’s picture

Title: Views fieldset labels do not render css when adding entity reference. » Views "display menu tabs" styling breaks when adding an "Entity Reference" display
Version: 10.3.x-dev » 11.0.x-dev
Component: views.module » views_ui.module
Status: Postponed (maintainer needs more info) » Closed (duplicate)

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