Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toast message has problems with umlauts #11089

Closed
bitwingsde opened this issue Dec 11, 2023 · 4 comments
Closed

Toast message has problems with umlauts #11089

bitwingsde opened this issue Dec 11, 2023 · 4 comments

Comments

@bitwingsde
Copy link

bitwingsde commented Dec 11, 2023

Affected Version

5.1.0

Description

Toast-Message cannot display umlauts like "äöüÄÖÜß" correctly. See screenshot.
umlauts

Affected location

GridFieldDetailForm_ItemRequest.php Line 543.
my temporary solution: 'type' => mb_convert_encoding($this->record->i18n_singular_name(), 'ISO-8859-1'),

Steps to Reproduce

Add title to data object and save.

PRs

@bitwingsde bitwingsde changed the title Toast message has problems with umauts Toast message has problems with umlauts Dec 11, 2023
@lerni
Copy link
Contributor

lerni commented Dec 20, 2023

Umlauts show fine in SiteTree-"Toasts" but are scrambled with DOs per GF.
bloeg-aertikoel

@lekoala
Copy link
Contributor

lekoala commented Dec 21, 2023

In the same line, ' character is not working well either.

image

it seems that utf8 encoded characters are not being displayed properly

@lekoala
Copy link
Contributor

lekoala commented Dec 21, 2023

I'm also a bit confused why the link creation is a direct call to htmlspecialchars instead of using the Convert class. It seems to be that either we use the Convert class or we don't, but mixing the two approaches is really odd.

$link = '<a href="' . $this->Link('edit') . '">"'
. htmlspecialchars($this->record->Title ?? '', ENT_QUOTES)
. '"</a>';
$message = _t(
'SilverStripe\\Forms\\GridField\\GridFieldDetailForm.Saved',
'Saved {name} {link}',
[
'name' => $this->getModelName(),
'link' => $link
]
);
$form->sessionMessage($message, 'good', ValidationResult::CAST_HTML);
$message = _t(
__CLASS__ . '.SAVETOASTMESSAGE',
'Saved {type} "{title}" successfully.',
[
'type' => $this->record->i18n_singular_name(),
'title' => Convert::raw2xml($this->record->Title)
]
);
$controller = $this->getToplevelController();
$controller->getResponse()->addHeader('X-Status', $message);

@lekoala lekoala mentioned this issue Dec 21, 2023
8 tasks
@GuySartorelli
Copy link
Member

Closing in favour of silverstripe/silverstripe-admin#1639 which has more information in it (and is against the correct repo)

@GuySartorelli GuySartorelli closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants