- Issue created by @andrewbelcher
- ๐จ๐ญSwitzerland berdir Switzerland
Just cross-referencing things, I did run into the same error, but for me, โจ SDC ComponentElement: Transform slots TranslatableMarkup values to #markup instead of throwing an exception Active helps because it's a TranslatableMarkup object, not null.
I assume SDC has optional slots, but I think this is a navigation issue. I think an label should either fall back to some fallback string like "- No label -" or possibly skip the whole plugin as it can't really provide meaningful information?
- ๐จ๐ฆCanada m4olivei Grimsby, ON
Good find. Tagging as Needs test, it's not obvious how to reproduce it. I was able to reproduce it in a very hacky way by adding the following implementation of
label()
to\Drupal\node\Entity\Node
, just to illustrate the issue:/** * {@inheritdoc} */ public function label() { return NULL; }
IMO, the plugin should be skipped if there isn't a useful title or badge. We skip the badge, avoiding this issue if there isn't one. We should do the same for the label.
- Merge request !11390Issue #3505182: Avoid rendering a label in the top bar if its NULL โ (Open) created by m4olivei
- ๐ฎ๐นItaly viappidu
Fork is a little bit behind...
This patch applies to 11.2.0 (tested)
- ๐จ๐ฆCanada xmacinfo Canada
The Commerce Invoice module encounters this bug.
- ๐ฎ๐ณIndia abhijith s
abhijith s โ made their first commit to this issueโs fork.
- ๐จ๐ฆCanada xmacinfo Canada
Moving to major since this issue essentially blocks displaying content when en entity without label is used.
- ๐ญ๐ทCroatia ivan zugec
Getting the same error when I view the logs using the AI logging sub-module with Drupal CMS.
Drupal: 11.2.2
- ๐บ๐ธUnited States tars16
We are running into this issue when trying to translate content. The updated check for the label didn't solve our issue, however, casting $label to a string got us past our issue. Not sure if this introduces additional translation issues, but so far it has been working.
'#slots' => [ 'content' => Element::isRenderArray($label) ? $label : (string) $label, ],
Tested with 11.2
- First commit to issue fork.
- ๐ช๐ธSpain plopesc Valladolid
Added new iteration to latest MR including code from #12
- ๐ง๐ชBelgium tijsdeboeck Antwerp ๐ง๐ช ๐ช๐บ ๐
@plopsec, your MR works perfectly and solved the issue for me.