Gernott / mask

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

[TASK] fix php 8 warning which is thrown in BackendLayoutRepository #465

Closed can0199 closed 2 years ago

can0199 commented 2 years ago

with php8 typo3 throws an error if $requestPage value is of type bool

PHP Warning: Trying to access array offset on value of type bool in /mask/Classes/Domain/Repository/BackendLayoutRepository/BackendLayoutRepository.php line 32
nhovratov commented 2 years ago

Looks good, can you give me an example, how to reproduce it?

can0199 commented 2 years ago

i think i had this error because the backend_layout field of the page was empty

nhovratov commented 2 years ago

Can it be, that you tried to open a page, which is disabled? This way I can reproduce it. The page won't of course appear in the result because of the querybuilder's default restrictions.

I don't think it is possible to receive false otherwise, because if you open a page, you will always have this existing page.

Then the bugfix would be, to remove the hidden restriction instead of skipping the backend layout retrieval.

can0199 commented 2 years ago

tomorrow i will try to reproduce the error

nhovratov commented 2 years ago

Can you check then, if this fixes it? https://github.com/Gernott/mask/commit/e9268dab1d629c753869e2799cc03abe15da6717

can0199 commented 2 years ago

I tried to reproduce the error and I think you are right that it only occurs when the page is disabled, your patch works smoothly

can0199 commented 2 years ago

this issue was fixed with commit https://github.com/Gernott/mask/commit/e9268dab1d629c753869e2799cc03abe15da6717