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

Encoding error in json response for ACL messages for non-english languages #15344

Closed
Ruslan-Aleev opened this issue Dec 2, 2020 · 1 comment
Labels
area-core bug The issue in the code or project, which should be addressed.

Comments

@Ruslan-Aleev
Copy link
Collaborator

Ruslan-Aleev commented Dec 2, 2020

Bug report

Summary

ACL can give an incorrect error message, for example, this.

acl_error_en

It is already not very clear to the end user what exactly the ACL error is.

But if the manager panel is not in english, then json displays messages in incorrect encoding, i.e. it is not even clear that the error is related to ACL.

acl_error_ru

It also makes sense to display specific information in window, for example, the permission that is required (view_template, list_template etc).

Potential solution

Use second parameter for json_encode (available as of php 5.4) to avoid encoding problems:
json_encode($data, JSON_UNESCAPED_UNICODE);

Step to reproduce

Change the language in the manager panel, for example, to russian. Create a user with access policy with view_template disabled in the policy template and try to edit resource.

Expected behavior

Display readable messages.

Related issue(s)/PR(s)

#14506 (Error Messages)

Environment

MODX 2.x>

@Ruslan-Aleev Ruslan-Aleev added bug The issue in the code or project, which should be addressed. area-core labels Dec 2, 2020
@Ruslan-Aleev
Copy link
Collaborator Author

Fixed in #15402

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core bug The issue in the code or project, which should be addressed.
Projects
None yet
Development

No branches or pull requests

1 participant