Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
G17 Media Posted October 12, 2022 Posted October 12, 2022 (edited) I'm seeing the following exceptions in the Gallery on PHP8: the first on gallery/front/view/imageFrame TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /suite/system/Theme/Theme.php(885) : eval()'d code:536 Stack trace: #0 /suite/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_gallery_front_view->imageFrame(Object(IPS\gallery\Image)) #1 /suite/system/Theme/Theme.php(885) : eval()'d code(339): IPS\Theme\_SandboxedTemplate->__call('imageFrame', Array) #2 /suite/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_gallery_front_view->image(Object(IPS\gallery\Image), '\n<div data-cont...') #3 /suite/applications/gallery/modules/front/gallery/view.php(339): IPS\Theme\_SandboxedTemplate->__call('image', Array) #4 /suite/system/Dispatcher/Controller.php(118): IPS\gallery\modules\front\gallery\_view->manage() #5 /suite/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute() #6 /suite/applications/gallery/modules/front/gallery/view.php(65): IPS\Content\_Controller->execute() #7 /suite/system/Dispatcher/Dispatcher.php(153): IPS\gallery\modules\front\gallery\_view->execute() #8 /suite/index.php(13): IPS\_Dispatcher->run() #9 {main} second on gallery/front/view/imageLightboxFrame TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /suite/system/Theme/Theme.php(885) : eval()'d code:2818 Stack trace: #0 /suite/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_gallery_front_view->imageLightboxFrame(Object(IPS\gallery\Image)) #1 /suite/system/Theme/Theme.php(885) : eval()'d code(2673): IPS\Theme\_SandboxedTemplate->__call('imageLightboxFr...', Array) #2 /suite/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_gallery_front_view->imageLightbox(Object(IPS\gallery\Image), '\n<div data-cont...') #3 /suite/applications/gallery/modules/front/gallery/view.php(334): IPS\Theme\_SandboxedTemplate->__call('imageLightbox', Array) #4 /suite/system/Dispatcher/Controller.php(118): IPS\gallery\modules\front\gallery\_view->manage() #5 /suite/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute() #6 /suite/applications/gallery/modules/front/gallery/view.php(65): IPS\Content\_Controller->execute() #7 /suite/system/Dispatcher/Dispatcher.php(153): IPS\gallery\modules\front\gallery\_view->execute() #8 /suite/index.php(13): IPS\_Dispatcher->run() #9 {main} Both fixed locally by changing a count to also include an non-null check on the $image->_notes count. is there something inconsistent with my installation, or is this a PHP8 compat issue? Edited October 12, 2022 by G17 Media
G17 Media Posted October 12, 2022 Author Posted October 12, 2022 Edit: This seems to only happen on very old gallery images. So perhaps it is old data causing that to be NULL?
Marc Posted October 12, 2022 Posted October 12, 2022 Please upgrade to the latest release and test this in the first instance. If you are then still having the same issues, please let us know, and we can take a look for you.
Recommended Posts