netresearch / t3x-rte_ckeditor_image

Image support in CKEditor for the TYPO3 ecosystem
GNU Affero General Public License v3.0
56 stars 65 forks source link

Call to a member function count() on null #242

Closed fbatschi closed 1 year ago

fbatschi commented 1 year ago

Bug description After updating our TYPO3 installation to the latest 11.5.29 version and while using rte_ckeditor_image 11.0.11 I get the error

Error
Call to a member function count() on null
in /var/www/typo3/public/typo3conf/ext/rte_ckeditor_image/Classes/Backend/Preview/RteImagePreviewRenderer.php line 129

regardless of which page i try to edit.

The line is this

https://github.com/netresearch/t3x-rte_ckeditor_image/blob/f78ae0e95be2a30e3d03fbc7db7449c2a443b0ea/Classes/Backend/Preview/RteImagePreviewRenderer.php#L129

Expected behavior

No error is thrown.

Possible Fix

Chaging the line to

if (isset($node->childNodes) && $node->childNodes->count() > 0) {

fixes this.

Environment

Documentation Have you checked the readme/documentation?

olegkarun commented 1 year ago

Same problem for me TYPO3 version: 11.5.28 PHP version: 7.4.3 Extension version: 11.0.11

kkugelmann commented 1 year ago

Same problem in one of our clients instances: TYPO3 version: 11.5.30 PHP Version: 7.4.3 Extension versions: 11.0.11

npoggenburg commented 1 year ago

Can confirm: TYPO3 version: 11.5.30 PHP Version: 7.4.3 Extension versions: 11.0.11

I can confirm the solution from the topic author too.