Problem/Motivation
When a field is empty, its label shouldn't appear.
However, when a node contains a Paragraph field that allows unlimited values but has no values entered, the label appears (with no values below it).
Note: this issue involves regular node display, not Views.
Steps to reproduce
Add a Paragraph field ( Entity reference revisions, Reference type: Paragraph) to a content type
Set the Allowed number of values to Unlimited
Add a new node of this new content type
Enter content in the Title and Body, but not in the paragraph field
Click Save
Result: the label for the paragraph field appears, even though there's no content to go with it.
Proposed resolution
Hide the field label when there's no content in the field, so it works the way other fields do.
I've tested this behavior in a custom theme and Olivero.
Thanks very much for this incredibly useful module!
Issue fork paragraphs-3561795
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
Comment #3
miroslavstankov commentedI can take a look at this
Comment #4
miroslavstankov commentedI'm trying to reproduce this issue, but I'm not seeing the label appear when the field is truly empty.
Here's what I did:
Then I tested the "partially empty" case:
I had to clear cache (drush cr) after those changes to see the correct output.
This seems to work as expected: label hidden only when zero paragraphs are referenced.
Comment #5
miroslavstankov commentedComment #6
yashaswi18 commentedI also tried to replicate this issue on my local setup using Drupal 11.3.3 by testing different scenarios with Paragraph fields (including cases with no referenced items and partially empty paragraphs), but I was not able to reproduce the reported behavior. The field label does not appear when there are no paragraph items, and appears only when at least one paragraph is present, which seems to be the expected behavior.
Closing this issue as “Cannot reproduce” for now. If the issue still persists, please feel free to reopen it and share the exact steps to replicate, including any specific configurations that might be involved.