Problem

When a webform is placed as a block with a custom label configured, the custom element output uses the webform's native
title instead of the block's custom label.

Steps to reproduce:

1. Place a webform block in layout builder
2. Configure a custom label (e.g., "My Custom Title") with "Display title" enabled
3. View the page with custom elements format

Expected behavior:
- "Display title" checked → display the block's configured "Title"
- "Display title" unchecked → display no title

Actual behavior:
- "Display title" checked → displays the webform entity's native title (wrong)
- "Display title" unchecked → displays no title (correct)

Code is at CustomElementsWebformBlock::getCustomElementsWebformBlock()

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

fago created an issue. See original summary.

fago’s picture

Status: Active » Needs review
fago’s picture

Title: Webform block title does not follow block configuration » Webform block title ignores configured block label

updating MR to follow this logic:
- title = '' when label_display is off (backwards compatible)
- title = block label when label_display is visible and label is given

while I'd not design the API like this right now, this is a backwards-compatible fix to the block-label being ignored.

  • fago committed 4226d0bc on 1.x
    fix: #3568578 Webform block title ignores configured block label
    
    By:...
fago’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.