Problem/Motivation
Special characters are shown as HTML entities, should be as they are.
Steps to reproduce
Add Content Type named A & B
Hover toolbar: Content >> Add content, you will see A & B
Proposed resolution
Revert changes in Drupal\admin_toolbar_tools\Plugin\Derivative\ExtraLinks getDerivativeDefinitions():
// not working properly v2.4
'title' => $this->t('@label', ['@label' => $type->label()]),
//working properly v2.3
'title' => $this->t($type->label()),
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3187665-with-patch.png | 20.79 KB | scott weston |
| #3 | 3187665-no-patch.png | 23.48 KB | scott weston |
| #2 | remove-translation-3187665.patch | 2.63 KB | saltwaterskin |
Comments
Comment #2
saltwaterskin commentedResolving the issue as suggested would violate coding standards. This is not likely to be committed but removing the calls to the t() function is likely the best way to resolve this. Here is a patch that removes the calls to the t() function and resolves the encoding issues.
Comment #3
scott weston commentedReviewed and tested the patch using simplytest.me on Drupal 8.9.11.
Without the patch Content Type named "A & B" appears as:
Without Patch:
With Patch:
Comment #4
scott weston commentedMoving to NR for others to review.
Comment #6
adriancidThanks
Comment #8
n.dhuygelaere commentedYou can also use this way :