We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Maybe a bug, maybe not, just wondering how to handle this.
Now that nested entries owners are eager-loadable, I tried this in order to avoid more complex/additional db queries:
{% set roles = craft.entries .type('roles') .relatedTo(person) .with(['owner']) .collect %} {% set rolesSortedByFilmTitle = roles.sortBy('owner.title', SORT_LOCALE_STRING) %} {% for role in rolesSortedByFilmTitle %} {{ role.owner.title }}: {{ role.roleName }} {% endfor %}
With craft.app.locale.id set to de-DE, I expected entries to be sorted with locale specific rules (the ÄÖÜäöüß thing), but that isn't the case.
craft.app.locale.id
de-DE
Looks like that you have to call setlocale(LC_COLLATE, str_replace('-', '_', Craft::$app->locale->id)); in PHP yourself first (note the underscore).
setlocale(LC_COLLATE, str_replace('-', '_', Craft::$app->locale->id));
Could write a Twig extension/Collection makro for now, but don't like to introduce new syntax.
Also hesitating to set this globally in a module's init method, might have side effects??
Craft 5.0.0-beta.4
8.2.13
Linux 5.15.133.1-microsoft-standard-WSL2
MySQL 8.0.33
No response
The text was updated successfully, but these errors were encountered:
This has been resolved for 4.9 (WIP) and 5.0.0-beta.6 (out now).
Sorry, something went wrong.
i-just
No branches or pull requests
What happened?
Description
Maybe a bug, maybe not, just wondering how to handle this.
Now that nested entries owners are eager-loadable, I tried this in order to avoid more complex/additional db queries:
With
craft.app.locale.id
set tode-DE
, I expected entries to be sorted with locale specific rules (the ÄÖÜäöüß thing), but that isn't the case.Looks like that you have to call
setlocale(LC_COLLATE, str_replace('-', '_', Craft::$app->locale->id));
in PHP yourself first (note the underscore).Could write a Twig extension/Collection makro for now, but don't like to introduce new syntax.
Also hesitating to set this globally in a module's init method, might have side effects??
Craft CMS version
Craft 5.0.0-beta.4
PHP version
8.2.13
Operating system and version
Linux 5.15.133.1-microsoft-standard-WSL2
Database type and version
MySQL 8.0.33
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: