terminal42 / contao-easy_themes

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

Runtime exception in constructor when called without request #40

Closed m-vo closed 6 years ago

m-vo commented 6 years ago

These lines ... https://github.com/terminal42/contao-easy_themes/blob/09c810cf451bdcf631d82378cb88299b9104e798/EasyThemes.php#L31-L35

.. are leading to an runtime exception if the request stack does not contain a request (in Contao\User\loadUserByUsername). This is for example the case when Contao's poor man cron job gets executed from the backend.

qzminski commented 6 years ago

This fix in ff328f9 should do. Can you give it a try?

qzminski commented 6 years ago

Ok the previous fix was wrong, the 251c743 should do.

m-vo commented 6 years ago

Thanks @qzminski - this will be fixed in Contao 4.5.8 though (see https://github.com/contao/core-bundle/issues/1458), so you might want to revert the changes once you are raising the requirements.

Toflar commented 6 years ago

Leave as is, pls.