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

News featured toggle results in Internal Server Error 500 #2574

Closed
markus361 opened this issue Dec 16, 2020 · 2 comments · Fixed by #2654
Closed

News featured toggle results in Internal Server Error 500 #2574

markus361 opened this issue Dec 16, 2020 · 2 comments · Fixed by #2654
Labels
Milestone

Comments

@markus361
Copy link

markus361 commented Dec 16, 2020

Contao 4.9.10

Trying to toggle the featured option of a news with the star icon in the backend results in a Internal Server Error on the console.

Can be reproduced on the demo (https://demo.contao.org/contao) but the news there gets toggled.

Other versions like 4.9.9 or 4.9.3 seem to work though

@fritzmg
Copy link
Contributor

fritzmg commented Dec 16, 2020

The problem are the newly added onload_callback and onsubmit_callback in tl_news::toggleFeatured. Many event listeners will assume, that their DataContainer argument will not be null, including Contao's own event listeners. However, when using this feature, it will indeed be null.

Failure with Contao's own onsubmit event listener:

TypeError:
Argument 1 passed to tl_news::adjustTime() must be an instance of Contao\DataContainer, null given, called in vendor\contao\contao\news-bundle\src\Resources\contao\dca\tl_news.php on line 1057

Failure with onload event listener from terminal42/contao-changelanguage:

TypeError:
Argument 1 passed to Terminal42\ChangeLanguage\EventListener\DataContainer\AbstractChildTableListener::Terminal42\ChangeLanguage\EventListener\DataContainer\{closure}() must be an instance of Contao\DataContainer, null given, called in vendor\contao\contao\news-bundle\src\Resources\contao\dca\tl_news.php on line 993

If we want to keep those callbacks, I think we should make sure, that the DataContainer is not null.

@fritzmg fritzmg added the bug label Dec 16, 2020
@aschempp aschempp added this to the 4.10 milestone Dec 16, 2020
@leofeyer leofeyer modified the milestones: 4.10, 4.9 Dec 16, 2020
@fritzmg fritzmg modified the milestones: 4.9, 4.4 Jan 11, 2021
@fritzmg
Copy link
Contributor

fritzmg commented Jan 11, 2021

This also affects Contao 4.4.55.

// ah, but that's moot now, sorry ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants