- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
I've seen same issue with menu links provided by modules. IMHO @Berdir suggestion at #18 is the way to go.
- πΊπΈUnited States m.stenta
Does it make sense to update the title and component of this issue since it is not block-specific? @tim.plunkett mentioned that as well in comment #3:
Menus and Views are also affected.
I'm not sure what the "Component" should be. I'll set it to "language system" but please adjust if there's a better fit.
We encountered this with menu link derivatives that are created for each bundle of our entity type using
$bundle->label()
: #3262752: Record type menu items lose translations βWrapping
$bundle->label()
in$this->t()
in our module fixes it - but that is not the "correct" solution, as I understand it. - Status changed to Needs work
almost 2 years ago 11:56pm 30 January 2023 The Needs Review Queue Bot β tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.
- last update
over 1 year ago 30,322 pass, 1 fail - last update
over 1 year ago 30,322 pass, 1 fail - πͺπΈSpain akalam
I've found when you have a menu link derivative, and you are using an TranslatableEntityLabelMarkup as title, the title gets overridden by the static_menu_link_overrides, transformed into a string and not displaying the proper translated text.
I'm adding a patch with a fix so the title override skips in case it has been defined as a TranslatableEntityLabelMarkup.
Note: I've found the patch doens't apply anymore for the 11.x branch, so I'm uploading it as it is, just introducing the change mentioned above. The patch is applying on 10.1.x
- πͺπΈSpain akalam
Rerolled against 10.2 and introduced a change to make it compatible with the change introduced on π Prevent empty block_content info fields from causing php deprecation notices when placing blocks with no label. Fixed
EntityType does not have
label()
method, that why i get:
Error: Call to undefined method Drupal\Core\Entity\ContentEntityType::label() in Drupal\Core\Entity\TranslatableEntityLabelMarkup->getTranslatedLabel() (line 233 of /var/www/html/web/core/lib/Drupal/Core/Entity/TranslatableEntityLabelMarkup.php).
Updated patch: replaced
label()
withgetLabel()