[-] Bo : Could not update mailalert 2.5 with id_lang missing
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<module>
|
<module>
|
||||||
<name>mailalerts</name>
|
<name>mailalerts</name>
|
||||||
<displayName><![CDATA[Mail alerts]]></displayName>
|
<displayName><![CDATA[Mail alerts]]></displayName>
|
||||||
<version><![CDATA[2.4]]></version>
|
<version><![CDATA[2.5]]></version>
|
||||||
<description><![CDATA[Sends e-mail notifications to customers and merchants.]]></description>
|
<description><![CDATA[Sends e-mail notifications to customers and merchants.]]></description>
|
||||||
<author><![CDATA[PrestaShop]]></author>
|
<author><![CDATA[PrestaShop]]></author>
|
||||||
<tab><![CDATA[administration]]></tab>
|
<tab><![CDATA[administration]]></tab>
|
||||||
|
|||||||
@@ -6,24 +6,9 @@ if (!defined('_PS_VERSION_'))
|
|||||||
function upgrade_module_2_5($object)
|
function upgrade_module_2_5($object)
|
||||||
{
|
{
|
||||||
return Db::getInstance()->execute('
|
return Db::getInstance()->execute('
|
||||||
ALTER TABLE '._DB_PREFIX_.'mailalert_customer_oos
|
ALTER TABLE `'._DB_PREFIX_.'mailalert_customer_oos`
|
||||||
ADD '.mailalerts_stripslashes_field('id_lang').' INT( 10 ) UNSIGNED NOT NULL ,
|
ADD `id_lang` INT( 10 ) UNSIGNED NOT NULL ,
|
||||||
DROP PRIMARY KEY ,
|
DROP PRIMARY KEY ,
|
||||||
ADD PRIMARY KEY (
|
ADD PRIMARY KEY (`id_customer` , `customer_email` , `id_product` , `id_product_attribute` , `id_shop`)
|
||||||
'.mailalerts_stripslashes_field('id_customer').' ,
|
');
|
||||||
'.mailalerts_stripslashes_field('customer_email').' ,
|
|
||||||
'.mailalerts_stripslashes_field('id_product').' ,
|
|
||||||
'.mailalerts_stripslashes_field('id_product_attribute').' ,
|
|
||||||
'.mailalerts_stripslashes_field('id_shop').'
|
|
||||||
)'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function mailalerts_stripslashes_field($field)
|
|
||||||
{
|
|
||||||
$quotes = array('"\\\'"', '"\'"');
|
|
||||||
$dquotes = array('\'\\\\"\'', '\'"\'');
|
|
||||||
$backslashes = array('"\\\\\\\\"', '"\\\\"');
|
|
||||||
|
|
||||||
return '`'.bqSQL($field).'` = replace(replace(replace(`'.bqSQL($field).'`, '.$quotes[0].', '.$quotes[1].'), '.$dquotes[0].', '.$dquotes[1].'), '.$backslashes[0].', '.$backslashes[1].')';
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user