Gambio Shop

If you receive the following error when attempting to rebuild the cache for the item properties (and thus refresh the "products_properties_index" table):

 

USER ERROR(256): "rebuild_properties_index: typeof($p_products_id) != integer" in \system\classes\properties\PropertiesDataAgent.inc.php:23

 

it is worth taking a look at the file

 

\system\classes\properties\PropertiesDataAgent.inc.php

 

where the error is triggered. Here it becomes apparent that an error is raised when the product ID is empty (the $p_products_id parameter passed to the function). How can this happen?

 

Are there empty product IDs? Basically not, at least not in the "products" table, especially since the product ID (column "products_id") is the primary key here. So let's take one step back and look at the "CacheControl" class, which is defined in

 

\system\core\caching\CacheControl.inc.php

 

In the rebuild_products_properties_index function, another table is used as the basis for indexing: the "products_properties_combis" table. Here, there can actually be empty entries in the "products_id" column, which was the case for us. Technically speaking, "empty" is not quite correct here—the "products_id" column contained the value "0". However, the PHP function "empty()" evaluates this as "FALSE", which triggered the error ("empty(): Returns FALSE if var exists and has a non-empty, non-zero value. Otherwise returns TRUE.").