Website URL webform css classes replaced with site url in webform placed as a block when site domain starts with web.

Created on 14 October 2023, about 1 year ago
Updated 6 April 2024, 7 months ago

Problem/Motivation

When placing a webform as a block, either via layout builder or Structure Block Layout, the 'webform' css name is being replaced with my dev url for some reason .. I've tried switching to a stock theme and it's still replacing the CSS. And the theme hook is also my site url.

This breaks all webform css, flex layouts etc.

This only happens with placing a webform block, other block types don't include the URL.

I can fix it by changing my dev url to dev.chandonin.localhost instead of web.chandonin.localhost. Something to do with the beginning part of my URL that starts with web.

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'web.chandonin.localhost:3000form' -->
<!-- FILE NAME SUGGESTIONS:
   * webform--make-a-booking.html.twig
   x webform.html.twig
-->
<!-- BEGIN OUTPUT from 'modules/contrib/webform/templates/webform.html.twig' -->
<form class="web.chandonin.localhost:3000form-submission-form webform-submission-add-form webform-submission-make-a-booking-form webform-submission-make-a-booking-add-form webform-submission-make-a-booking-node-8-form webform-submission-make-a-booking-node-8-add-form js-webform-details-toggle webform-details-toggle" data-drupal-selector="web.chandonin.localhost:3000form-submission-make-a-booking-node-8-add-form" action="/make-booking" method="post" id="web.chandonin.localhost:3000form-submission-make-a-booking-node-8-add-form" accept-charset="UTF-8" data-once="form-updated webform-details-toggle" data-drupal-form-fields="edit-first-name,edit-last-name,edit-email,edit-mobile-number,edit-booking-type,edit-booking-date-day,edit-booking-date-month,edit-booking-date-year,edit-comments,edit-actions-submit"></form>

Steps to reproduce

Use a drupal installation with the URL starting with web. subdomain
Create a webform and place it as a block in a layout builder or via Structure -> Block layout

πŸ› Bug report
Status

Closed: cannot reproduce

Version

6.2

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia neubreed

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

Comments & Activities

  • Issue created by @neubreed
  • Status changed to Closed: cannot reproduce 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    This feels like an edge-case issue that no one else has reproduced.

    The below THEME HOOK throws me off because it implies the domain name is being used as the form ID.

    <!-- THEME HOOK: 'web.chandonin.localhost:3000form' -->

Production build 0.71.5 2024