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

Uploading a custom translation with special characters breaks the admin page. #5982

Closed
newtewt opened this issue Sep 24, 2019 · 2 comments
Closed
Labels
Priority: 2 - Medium Normal priority Type: Bug Fix something that isn't working as intended
Projects

Comments

@newtewt
Copy link
Contributor

newtewt commented Sep 24, 2019

Describe the bug
Using medic-conf if you upload a translation that has a space of ) in the name will cause issues. Spaces will break the individual language and ) will break all language selections.

To Reproduce
Steps to reproduce the behavior:

  1. Create a translation file named messages-dec)opy.properties
  2. Upload to your instance via medic-conf upload-custom-translations
  3. Navigate to Admin App > Languages.
  4. Click on a language and nothing happens.

Expected behavior
The language should display or possibly we adjust medic-conf to not allow poor names.

Logs

jquery.js:1560 Uncaught Error: Syntax error, unrecognized expression: #locale-dec)opy-body
    at Function.Sizzle.error (jquery.js:1560)
    at Sizzle.tokenize (jquery.js:2216)
    at Sizzle.select (jquery.js:2643)
    at Function.Sizzle [as find] (jquery.js:862)
    at jQuery.fn.init.find (jquery.js:2896)
    at getTargetFromTrigger (collapse.js:163)
    at Collapse.<anonymous> (collapse.js:144)
    at HTMLAnchorElement.proxy (jquery.js:10502)
    at Function.each (jquery.js:367)
    at jQuery.fn.init.each (jquery.js:202)

Screenshots
If applicable, add screenshots to help explain your problem.

Environment

  • Instance: localhost
  • Browser: Chrome
  • Client platform: Linux
  • App: admin
  • Version: 3.7.0

Additional context
Add any other context about the problem here. What have you tried? Is there a workaround?

@newtewt newtewt added the Type: Bug Fix something that isn't working as intended label Sep 24, 2019
@garethbowen garethbowen added this to To do in 3.8.0 via automation Sep 24, 2019
@garethbowen garethbowen added the Priority: 2 - Medium Normal priority label Sep 24, 2019
@tookam tookam moved this from To do to In progress in 3.8.0 Sep 30, 2019
@tookam tookam self-assigned this Sep 30, 2019
@tookam
Copy link
Contributor

tookam commented Oct 15, 2019

Ready for AT 5982-custom-translation-bug-in-admin (medic-conf)

@tookam tookam moved this from In progress to In AT in 3.8.0 Oct 15, 2019
@ngaruko ngaruko assigned ngaruko and unassigned tookam Oct 16, 2019
@ngaruko
Copy link
Contributor

ngaruko commented Oct 17, 2019

LGTM
Master
image

Branch
Errors thrown if there are invalid characters in the file name....
image

ngaruko pushed a commit to medic/cht-conf that referenced this issue Oct 18, 2019
Forces language code to be a valid CSS selector name

medic/cht-core#5982
@ngaruko ngaruko closed this as completed Oct 18, 2019
3.8.0 automation moved this from In AT to Done Oct 18, 2019
@ngaruko ngaruko removed their assignment Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 2 - Medium Normal priority Type: Bug Fix something that isn't working as intended
Projects
No open projects
3.8.0
  
Done
Development

No branches or pull requests

4 participants