Skip to content

8.3: Uncaught Error: [] operator not supported for strings when editing products without taxes set

When editing products, which do not have the VAT(%) checkbox activated, it gives the following error: Fatal error: Uncaught Error: [] operator not supported for strings in /var/www/html/modules/Products/models/Record.php:266 Stack trace: #0 /var/www/html/modules/Products/views/Edit.php(27): Products_Record_Model->getTaxClassDetails() #1 /var/www/html/includes/main/WebUI.php(215): Products_Edit_View->process() #2 /var/www/html/index.php(26): Vtiger_WebUI->process() #3 {main} thrown in /var/www/html/modules/Products/models/Record.php on line 266

This is probably due to this change in 8.3, which returns an empty string, when the regions are empty, instead of an empty array: InventoryUtils.php return array('percentage' => $taxpercentage, 'regions' => Zend_Json::decode(html_entity_decode(!empty($regions) ? $regions : '')));

Which then throws an error here because this is now a string.

Probably needs to change to something like this Line256:

if (is_array($regionDetails)) {
	foreach ($regionDetails as $regions) {
		$regionsList = array_merge($regionsList, $regions['list']);
	}
}elseif(empty($regionDetails)){
	$regionDetails = array();
}
Edited by Jürgen Faßmann