PHP Warning ‘Undefined property’ when displaying albums incl. descriptions
-
Using WP 6.3.2. and NGG 3.55 on PHP 8.2
When displaying an album of albums incl. their descriptions the following 2 PHP warning are written to the PHP error log:
PHP Warning: Undefined property: Imagely\NGG\Display\ViewElement::$_list in /wordpress/wp-content/plugins/nextgen-gallery/src/DisplayTypes/Albums/SharedController.php on line 57
PHP Warning: foreach() argument must be of type array|object, null given in /wordpress/wp-content/plugins/nextgen-gallery/src/DisplayTypes/Albums/SharedController.php on line 57Line 57 is the one beggining with “foreach ( $container->_list as $ndx => $item )” and something seems to be wrong with the _list
// Enable album descriptions. if ( $this->are_descriptions_enabled( $ds ) ) { $description = $this->generate_description( $displayed_gallery ); foreach ( $root_element->find( 'nextgen_gallery.gallery_container', true ) as $container ) { // Determine where (to be compatible with breadcrumbs) in the container to insert. $pos = 0; foreach ( $container->_list as $ndx => $item ) { if ( is_string( $item ) ) { $pos = $ndx; } else { break; } } $container->insert( $description, $pos ); } }
- The topic ‘PHP Warning ‘Undefined property’ when displaying albums incl. descriptions’ is closed to new replies.