From 0036768ae5bbdc39fcfbc339d8898d90fe5b5af1 Mon Sep 17 00:00:00 2001 From: bumbu Date: Mon, 7 Jan 2013 19:24:12 +0200 Subject: [PATCH] ObjectModel::updateMultishopTable() where argument is not mandatory --- classes/ObjectModel.php | 6 +++--- classes/Product.php | 2 +- classes/Search.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/ObjectModel.php b/classes/ObjectModel.php index 105c7cdff..4032cc318 100644 --- a/classes/ObjectModel.php +++ b/classes/ObjectModel.php @@ -1284,7 +1284,7 @@ abstract class ObjectModelCore * @param string $specific_where Only executed for common table * @return bool */ - public static function updateMultishopTable($classname, $data, $where, $specific_where = '') + public static function updateMultishopTable($classname, $data, $where = '', $specific_where = '') { $def = ObjectModel::getDefinition($classname); $update_data = array(); @@ -1304,8 +1304,8 @@ abstract class ObjectModelCore $sql = 'UPDATE '._DB_PREFIX_.$def['table'].' a '.Shop::addSqlAssociation($def['table'], 'a', true, null, true).' - SET '.implode(', ', $update_data).' - WHERE '.$where; + SET '.implode(', ', $update_data). + (!empty($where) ? ' WHERE '.$where : ''); return Db::getInstance()->execute($sql); } diff --git a/classes/Product.php b/classes/Product.php index e22850083..ba07b5794 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -4609,7 +4609,7 @@ class ProductCore extends ObjectModel { return ObjectModel::updateMultishopTable('product', array( 'ecotax' => 0, - ), ''); + )); } /** diff --git a/classes/Search.php b/classes/Search.php index 20bbdce47..b549a1df5 100644 --- a/classes/Search.php +++ b/classes/Search.php @@ -413,7 +413,7 @@ class SearchCore { $db->execute('TRUNCATE '._DB_PREFIX_.'search_index'); $db->execute('TRUNCATE '._DB_PREFIX_.'search_word'); - ObjectModel::updateMultishopTable('Product', array('indexed' => 0), '1'); + ObjectModel::updateMultishopTable('Product', array('indexed' => 0)); } else {