Gernott / mask

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

Undefined array key in AjaxController.php - typo3 11 with PHP 8. #435

Closed pixelplumber closed 3 years ago

pixelplumber commented 3 years ago

Hi experimenting with Typo3 11 and PHP 8 in a test site. I noticed that loading the mask BE interface and clicking on a saved CE wouldn't load its field configuration. System > log message below.

Core: Exception handler (WEB):  Uncaught TYPO3 Exception: #1476107295:
PHP Warning: Undefined array key  "coreField" in  /home/<snipped>/public_html/typo3conf/ext/mask/Classes/Controller/AjaxController.php  line 407
 TYPO3\CMS\Core\Error\Exception thrown in file  /home/<snipped>/public_html/typo3/sysext/core/Classes/Error/ErrorHandler.php  in line 145. 

Requested URL:  https://sandpit.<snipped>.com.au/typo3/ajax/mask/loadElement?token=--AnonymizedToken--&type=tt_content&key=testelement

Not a programmer, but adding ?? null to line 407 allowed the config to load.

$newField['key'] = $parent ? ($field['coreField'] ?? null ? $field['key'] : $field['maskKey']) : $key;
nhovratov commented 3 years ago

@pixelplumber It's fixed now on upstream. Just released yesterday so will wait a bit for the next release.

Thank you for testing Mask! If you want, you can also test the current master :)