Gernott / mask

TYPO3 Extension Mask
https://www.facebook.com/typo3mask
GNU General Public License v2.0
126 stars 86 forks source link

Undefined array key "colPos" #611

Closed evelineketterer closed 8 months ago

evelineketterer commented 8 months ago

After update Typo3 to 12.4.9, i got a PHP Warning in Backend:

Undefined array key "colPos" in /var/www/html/vendor/mask/mask/Classes/ItemsProcFuncs/CTypeList.php line 42

PHP Version 8.1.22

nhovratov commented 8 months ago

from which version did you update?

evelineketterer commented 8 months ago

12.4.8

nhovratov commented 8 months ago

This shouldn't normally happen, as the colPos field is always available. I added a fix, which prevents the warning. Nevertheless, there might be another issue on your installation.

topfender commented 7 months ago

We have the same issue with PHP 8.2, TYPO3 12.4.10 and MASK 8.3.7. The variable $params['row'] only contains 'uid' & 'pid' and the error only occurs on non mask elements. Any idea what configuration could cause this kind of issue?

nhovratov commented 7 months ago

@topfender Thanks for the feedback! Unfortunately, I don't know what causes this. I've never encountered this error before. Would you be able to debug it and find out what element exactly causes this? It would be a highly valuable information.

topfender commented 7 months ago

We have it on every page. One warning for every element (container, textpic, news plugin) but only in list module

topfender commented 7 months ago

$parentObj is: grafik

nhovratov commented 7 months ago

We have it on every page. [...] but only in list module

What do you mean by that? It can only trigger in the edit view of a Content Element, right?

topfender commented 7 months ago

grafik

nhovratov commented 7 months ago

This is interesting. Could you enable debug mode, so this will cause an exception in the backend with full stack trace? I wonder what calls this. Normally, this is only executed in FormEngine context. Maybe also DataHandler.

topfender commented 7 months ago

Hm I don't get an exception with a stack trace in debug mode. Only the message has a red background now. Do I have to set a specific value?

nhovratov commented 7 months ago

@topfender Ah, unfortunately this is not possible because https://github.com/TYPO3/typo3/blob/44670dd4df32dad482b01da28a4dd2e0739c0207/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php#L107 catches the exception.

Is this your development environment? You could remove the catch manually to see the full stack trace.

topfender commented 7 months ago

I added my own exception, but the stack trace is very long. What is the best way to upload it here? Zip? TYPO3 Exception.zip

nhovratov commented 7 months ago

The best way would be to save it as html: Right click -> current frame -> save frame as

nhovratov commented 7 months ago

Could you try this method above? The html from the zip looks buggy. It's important to save the frame instead of the whole backend.

topfender commented 7 months ago

It's the frame, but I just added an exception to CTypeList with 'test' as title

nhovratov commented 7 months ago

Ok, I can read it now. There are two scroll bars. This is a bit weird.

nhovratov commented 7 months ago

Okay thanks, I found this: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82248 https://forge.typo3.org/issues/102698

This is why only uid and pid is available. For performance reasons. This was added in TYPO3 v12.4.10 The original author of this issue had problems already in 12.4.9. But this might even be another issue.

Nevertheless, I already patched the class. Now I have confidence that this was the right solution.

@topfender Many thanks for providing feedback to this issue, I really appreciate this!

nhovratov commented 7 months ago

Will release a new version of Mask now.