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

With PHP 8 – Uncaught PHP Exception Error: "[] operator not supported for strings" at /kunden/DOMAIN/49_lts/var/cache/prod/contao/dca/tl_article.php line 597 #8

Open
githuppi opened this issue Jun 14, 2023 · 6 comments

Comments

@githuppi
Copy link

Hello Kamil,

with the EOL of PHP 7 we need to switch customer websites to PHP 8. We have a page with the contao-elements-filter which won't be loaded after changing the Version.

The following Error occurred:

[2023-06-14 07:56:50] request.INFO: Matched route "tl_page.2729". {"route":"tl_page.2729","route_parameters":{"_token_check":true,"_controller":"Contao\\FrontendIndex::renderPage","_scope":"frontend","_locale":"de","pageModel":"[object] (Contao\\PageModel: {})","parameters":"","_route":"tl_page.2729"},"request_uri":"https://www.DOMAIN.de/sportstaetten.html","method":"GET"} [] [2023-06-14 07:56:50] security.INFO: Populated the TokenStorage with an anonymous Token. [] [] [2023-06-14 07:56:51] request.CRITICAL: Uncaught PHP Exception Error: "[] operator not supported for strings" at /kunden/DOMAIN/49_lts/vendor/codefog/contao-elements-filter/dca/tl_article.php line 6 {"exception":"[object] (Error(code: 0): [] operator not supported for strings at /kunden/DOMAIN/49_lts/vendor/codefog/contao-elements-filter/dca/tl_article.php:6)"} [] [2023-06-14 07:56:59] console.CRITICAL: Error thrown while running command "cache:warmup --env=prod". Message: "[] operator not supported for strings" {"exception":"[object] (Error(code: 0): [] operator not supported for strings at /kunden/DOMAIN/49_lts/var/cache/prod/contao/dca/tl_article.php:597)","command":"cache:warmup --env=prod","message":"[] operator not supported for strings"} [] [2023-06-14 07:57:51] request.INFO: Matched route "tl_page.2610". {"route":"tl_page.2610","route_parameters":{"_token_check":true,"_controller":"Contao\\FrontendIndex::renderPage","_scope":"frontend","_locale":"de","pageModel":"[object] (Contao\\PageModel: {})","_route":"tl_page.2610"},"request_uri":"https://www.DOMAIN.de/","method":"GET"} [] [2023-06-14 07:57:51] security.INFO: Populated the TokenStorage with an anonymous Token. [] [] [2023-06-14 07:57:51] request.CRITICAL: Uncaught PHP Exception Error: "[] operator not supported for strings" at /kunden/DOMAIN/49_lts/var/cache/prod/contao/dca/tl_article.php line 597 {"exception":"[object] (Error(code: 0): [] operator not supported for strings at /kunden/DOMAIN/49_lts/var/cache/prod/contao/dca/tl_article.php:597)"} [] [2023-06-14 07:57:53] request.INFO: Matched route "tl_page.2610". {"route":"tl_page.2610","route_parameters":{"_token_check":true,"_controller":"Contao\\FrontendIndex::renderPage","_scope":"frontend","_locale":"de","pageModel":"[object] (Contao\\PageModel: {})","_route":"tl_page.2610"},"request_uri":"https://www.DOMAIN.de/","method":"GET"} [] [2023-06-14 07:57:53] security.INFO: Populated the TokenStorage with an anonymous Token. [] [] [2023-06-14 07:57:53] request.CRITICAL: Uncaught PHP Exception Error: "[] operator not supported for strings" at /kunden/DOMAIN/49_lts/var/cache/prod/contao/dca/tl_article.php line 597 {"exception":"[object] (Error(code: 0): [] operator not supported for strings at /kunden/DOMAIN/49_lts/var/cache/prod/contao/dca/tl_article.php:597)"} [] [2023-06-14 08:02:34] request.INFO: Matched route "tl_page.2609". {"route":"tl_page.2609","route_parameters":{"_token_check":true,"_controller":"Contao\\FrontendIndex::renderPage","_scope":"frontend","_locale":"de","pageModel":"[object] (Contao\\PageModel: {})","parameters":"","_route":"tl_page.2609"},"request_uri":"https://www.DOMAIN.de/kontakt.html","method":"GET"} [] [2023-06-14 08:02:34] security.INFO: Populated the TokenStorage with an anonymous Token. [] [] [2023-06-14 08:02:34] request.CRITICAL: Uncaught PHP Exception Error: "[] operator not supported for strings" at /kunden/DOMAIN/49_lts/var/cache/prod/contao/dca/tl_article.php line 597 {"exception":"[object] (Error(code: 0): [] operator not supported for strings at /kunden/DOMAIN/49_lts/var/cache/prod/contao/dca/tl_article.php:597)"} []

Can you please investigate and help us making it compatible?

Thanks in advance and kind regards
Dennis

@qzminski
Copy link
Member

Hey Dennis, can you try requiring the dev-develop@dev version? It is about to released soon as a stable version.

@githuppi
Copy link
Author

Kamil, thanks for the quick response. Unfortunately this is a Contao 4.9.41 System. We know it's not LTS anymore but it's still used there and an Update is not in the pipeline.

Is there a possible workaround?

@qzminski
Copy link
Member

Have you got any other extensions installed? It looks like __selector__ becomes a string here, which it should definitely not:

https://github.com/codefog/contao-elements-filter/blob/master/dca/tl_article.php#L6

@githuppi
Copy link
Author

This is a website using an older Premium Contao Theme Called Eclipse … this Version is even before Eclipse X.

These are the installed extensions.

image

@qzminski
Copy link
Member

I am pretty sure one of them modifies the DCA of tl_article incorrectly, but you have to investigate yourself which one it is.

@githuppi
Copy link
Author

Okay. Thanks for the hint. We'll keep in mind dev-develop@dev version if we might choose the path to update to 4.13.

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

No branches or pull requests

2 participants