Page 1 of 1

Headertags - product schema error

Posted: Tue Jun 18, 2024 9:44 am
by 14Steve14
Version 1.0.9.0 PHP8.0

I have the following error in my error logs.
[18-Jun-2024 10:14:57 Europe/London] PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in /home/####/####/includes/modules/header_tags/ht_product_schema.php:30
Stack trace:
#0 /home/####/####/includes/system/versioned/1.0.8.4/template.php(79): ht_product_schema->execute()
#1 /home/railways/public_html/templates/override/includes/components/template_top.php(13): Template->build_blocks()
#2 /home/####/####/templates/default/includes/pages/product_info.php(13): require('/home/railways/...')
#3 /home/####/####/product_info.php(25): require('/home/railways/...')
#4 {main}
thrown in /home/####/####/includes/modules/header_tags/ht_product_schema.php on line 30
Line 30 is the following

Code: Select all

        $products_image = ( count($images) > 0 )
Does this mean that somewhere on the site I have one or more products without images.

Can anyone help.

Re: Headertags - product schema error

Posted: Tue Jun 18, 2024 1:00 pm
by ecartz
This means that $product->get('images') is not working properly.

Do you have a column in your products table named products_images? Note that you should have a column named products_image -- that's fine. It's products_images that would be problematic. If so, why do you have that column?

Re: Headertags - product schema error

Posted: Tue Jun 18, 2024 1:19 pm
by 14Steve14
@ecartz Thanks for taking the time to reply.

In the products table I have a column named products_image and also one called products_images. the products_images seems to be empty. This is probably from a long old addon for something as the database has been upgraded several times possibly from really old oscommerce.

I have backed up the database using the store admin setting and also exported a copy using sql. I will delete the empty column and see what happens. Looking there are also a few other old columns from long forgotten addons so may have a bit of a tidy in the database and remove the rubbish files from addons that are no longer used.

I will let you know if the problem goes away.