[beta1] ⚠️ Fix compatibility with layout builder

Created on 12 February 2023, over 1 year ago
Updated 14 March 2023, over 1 year ago

Problem/Motivation

Some patterns are buggy when used as layout plugins in layout builder.

This must be fixed for 2 reasons:

  • Layout Builder is a popular core module
  • Even for the people not using layout builder, it will make the patterns cleaners, splitting the "slots" (as fields) and the "props" (as settings)

Steps to reproduce

Tested in Layout Builder Drupal 10.0:

  • Alert: close_title is printed in attribute
  • Button: url & title are printed in attribute
  • Card: title_tag default value doesn't work
  • Download block: description is wrapping everything and preventing clicks
  • Download link: url is printed in attribute & details is wrapping stuff and preventing clicks
  • Newsletter & Follow us: title_tag default value doesn't work
  • Header: TypeError: strip_tags(): Argument #1 ($string) must be of type string, array given in strip_tags()
  • Link: TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in strpos()
  • Menu - Main navigation: menu_name is printed in attribute
  • Responsive medias: caption is printed in attribute
  • Side menu: " id="sidemenu-450344150">
  • Skiplinks: label is printed in attribute
  • Tabs: label is printed in attribute
  • Tag: url is printed in attribute

Proposed resolution

  • Field printed in attributes must be settings
  • Secure default values
  • Don't use Twig filers on slots

API changes

Yes, big ones, that's why ⚠️ is in the issue title.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France pdureau Paris

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024