Closed kixe closed 6 months ago
@kixe I guess I think that the template should remain multi-language unless the user edits it and turns off multi-language for that template. But you are right that if a module defines permissions via its getModuleInfo() then the descriptions of those permissions should go in the default language. We already have code that covers that case, but I found it wasn't perfect, as it would only work for the first installed permission by the module. If there was more than one permission installed by the module, then the description might end up in the user's language rather than the default language. I've pushed a fix for to hopefully correct that issue. Thanks.
Thanks
Short description of the issue
If LanguageSupport is enabled in a ProcessWire installation, the type of the "title" field has been changed to PageTitleLanguage. When a superuser installs a new module that generates new permissions, the description of the new "permission" is stored in the "title" in user language, but not in the default language.
Suggestion for a possible fix
Since this is not such a big problem, I would also not force ModulesInstaller::install() to store the permission description in the default language column. However, I would recommend disabling multi-language support for the permission template by default during installation. Just add
$template->noLang = 1
. This keeps the system flexible but prevents unexpected behavior.https://github.com/processwire/processwire/blob/3cc76cc886a49313b4bfb9a1a904bd88d11b7cb7/site-blank/install/install.sql#L409
Setup/Environment