terminal42 / contao-easy_themes

Contao extension "easy_themes"
https://unmaintained.tech/
MIT License
13 stars 11 forks source link

Fix loading of assets. #14

Closed dmolineus closed 9 years ago

dmolineus commented 9 years ago

There are some cases there the easy themes assets are not properly injected. This is caused by the "loadLanguageFile" hack. If a language file is loaded before the user got authenticated then the assets loading would fail.

A language file can be loaded before authenticated when a model find method is triggered before (e.g. in a initializeSystem hook). See Https://github.com/contao/core/commit/fa81a2cdde6a96100ab008b128d55f20a164027e.

I don't see any reasons to use the loadLanguageFile hack at all. Adding it to the constructor work as well (it's triggered by the loadDataContainer hook first).

Toflar commented 9 years ago

I've merged it in https://github.com/terminal42/contao-easy_themes/commit/57f4973742df364ef83b86bf32f72d9198c6f40d. However, I did use else instead of another elseif. Any reason for this there?

dmolineus commented 9 years ago

There are 2 reasons:

Toflar commented 9 years ago

I see, so https://github.com/terminal42/contao-easy_themes/commit/c57b560cd9c8b910c12d80b83aa1ed47c18ca48d should do it, right?

dmolineus commented 9 years ago

:+1: