Site goes blank if you override translation for js.groups.index.title

סיכום מבוסס בינה מלאכותית

Lutz reported a critical bug where overriding the js.groups.index.title translation key (e.g., changing “Groups” to “Gruppen” for German) caused the site to display a blank white page. The error Uncaught TypeError: Cannot create property 'title' on string 'Gruppen' indicated that the application expected a hash object but received a string. Lutz temporarily resolved the issue by deleting the override row from the translation_overrides table. codinghorror asked if this was related to recent work by tgxworld, while cpradio noted it appeared to be a duplicate of a previous issue regarding customizations breaking Discourse. claas reproduced the error and demonstrated via Rails console that the translation key js.groups.index returns a hash, whereas js.groups.index.title returns a string, explaining the type mismatch. tgxworld suggested upgrading to the latest version, suspecting a transient error in recent commits. Lutz confirmed that upgrading to v1.7.0.beta11+2 resolved the issue completely.

The german translation of the menu entry was missing for the new groups directory. I changed the text for “js.groups.index.title” from “Groups” to “Gruppen” in the admin panel. After that, my page was just a blank white page. I solved the problem by deleting the row in the translation_overrides table and restarting the app.

Changing enable_group_directory from true to false does not hide the menu item. If you click on the menu item after deactivating the group directory, an error message appears.

Uncaught TypeError: Cannot create property 'title' on string 'Gruppen' Url: https://forum.mydomain.com/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js Line

TypeError: Cannot create property 'title' on string 'Gruppen'
    at https://forum.mydomain.com/assets/application-6a15d48d4a3953d8f99e1334a510eb044b493a93411cd6e48c2f985894235425.js:42:3468
    at Array.forEach (native)
    at Object.initialize (https://forum.mydomain.com/assets/application-6a15d48d4a3953d8f99e1334a510eb044b493a93411cd6e48c2f985894235425.js:42:3145)
    at Object.test.n.initialize (https://forum.mydomain.com/assets/application-6a15d48d4a3953d8f99e1334a510eb044b493a93411cd6e48c2f985894235425.js:1:20924)
    at https://forum.mydomain.com/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:4:28944
    at e.each (https://forum.mydomain.com/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:4:13681)
    at e.topsort (https://forum.mydomain.com/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:4:13176)
    at e.topsort (https://forum.mydomain.com/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:4:12584)
    at i._runInitializer (https://forum.mydomain.com/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:4:29123)
    at i.runInstanceInitializers (https://forum.mydomain.com/assets/ember_jquery-60dedd1dca1d8b8ce48b6d0087db3b96f3149b9b5af2d0c7c6357967d29031fb.js:4:28889)
לייק 1

Is this related to your work @tgxworld?

This is also a duplicate of
https://meta.discourse.org/t/using-a-in-customize-broke-discourse-even-after-restore/54620

5 לייקים

I reproduced this (by setting js.groups.index.title to “Gruppen” via the interface) and found:

$ rails c
$ I18n.t('js.groups.index', :locale => 'en')
=> {:title=>"Groups", :empty=>"There are no visible groups."}
$ I18n.t('js.groups.index.title', :locale => 'en')
=> "Groups"
$ I18n.t('js.groups.index', :locale => 'de')
=> "Gruppen"
I18n.t('js.groups.index.title', :locale => 'de')
=> "Gruppen"

Can you try upgrading to latest? I can’t reproduce this so it might have been an error in one of the commits I made while working on the groups page.

2 לייקים

Ok, seems to be resolved after Upgrading to v1.7.0.beta11 +2
Thank you!

3 לייקים