codefog / contao-elements-filter

11 stars 2 forks source link

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 1 year ago

githuppi commented 1 year ago

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 commented 1 year ago

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

githuppi commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.