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

[Bug]: Use useridentifier instead of deprecated username #484

Merged
merged 1 commit into from
May 4, 2023

Conversation

kingjia90
Copy link
Contributor

This line causes the XLIFF Document Export to crash

Uncaught PHP Exception Twig\Error\RuntimeError: "Neither the property "username" nor one of the methods "username()", "getusername()"/"isusername()"/"hasusername()" or "__call()" exist and have public access in class "Pimcore\Security\User\User"." at /var/www/html/templates/includes/navigation-icons.html.twig line 15 {"exception":"[object] (Twig\\Error\\RuntimeError(code: 0): Neither the property \"username\" nor one of the methods \"username()\", \"getusername()\"/\"isusername()\"/\"hasusername()\" or \"__call()\" exist and have public access in class \"Pimcore\\Security\\User\\User\". at /var/www/html/templates/includes/navigation-icons.html.twig:15)"} []

It's safer to use useridentifier
See also https://symfony.com/blog/new-in-symfony-5-3-improvements-for-security-users#renamed-username-to-identifier

Not sure why it works when normally browsing but not when trying to renderDocuments and export

@kingjia90 kingjia90 added the Bug label May 4, 2023
@kingjia90 kingjia90 added this to the 11.0.0 milestone May 4, 2023
@mattamon mattamon linked an issue May 4, 2023 that may be closed by this pull request
@mattamon
Copy link
Contributor

mattamon commented May 4, 2023

This also fixes a bug in word export!

Copy link
Contributor

@mattamon mattamon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mattamon mattamon merged commit 38d6b5e into 11.x May 4, 2023
1 check passed
@mattamon mattamon deleted the fix-username-teplate branch May 4, 2023 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Word Export throws error on export
2 participants