From 815fb7fa521d42725147b6baad35701bfe02f353 Mon Sep 17 00:00:00 2001 From: Hlavtox Date: Wed, 7 Feb 2024 22:28:17 +0100 Subject: [PATCH 1/2] Update hooks when they already exist --- upgrade/php/add_hook.php | 8 +++++--- upgrade/sql/1.7.1.0.sql | 5 +++-- upgrade/sql/1.7.2.0.sql | 7 ++++--- upgrade/sql/1.7.3.0.sql | 7 ++++--- upgrade/sql/1.7.4.0.sql | 5 +++-- upgrade/sql/1.7.6.0.sql | 5 +++-- upgrade/sql/1.7.7.0.sql | 8 ++++---- upgrade/sql/1.7.7.2.sql | 4 ++-- upgrade/sql/1.7.8.0.sql | 4 ++-- upgrade/sql/8.0.0.sql | 8 ++++---- upgrade/sql/8.1.0.sql | 10 ++++++---- upgrade/sql/8.1.2.sql | 5 +++-- upgrade/sql/8.1.5.sql | 5 +++-- upgrade/sql/9.0.0.sql | 5 +++-- 14 files changed, 49 insertions(+), 37 deletions(-) diff --git a/upgrade/php/add_hook.php b/upgrade/php/add_hook.php index 43ee0b0cb..fc588cb6a 100644 --- a/upgrade/php/add_hook.php +++ b/upgrade/php/add_hook.php @@ -25,7 +25,9 @@ */ function add_hook($hook, $title, $description, $position = 1) { - return (bool) Db::getInstance()->execute( - 'INSERT IGNORE INTO `' . _DB_PREFIX_ . 'hook` (`name`, `title`, `description`, `position`) VALUES ("' . pSQL($hook) . '", "' . pSQL($title) . '", "' . pSQL($description) . '", ' . (int) $position . ')' - ); + return (bool) Db::getInstance()->execute(' + INSERT INTO `' . _DB_PREFIX_ . 'hook` (`name`, `title`, `description`, `position`) + VALUES ("' . pSQL($hook) . '", "' . pSQL($title) . '", "' . pSQL($description) . '", ' . (int) $position . ') + ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`) + '); } diff --git a/upgrade/sql/1.7.1.0.sql b/upgrade/sql/1.7.1.0.sql index 77760658c..fc5796caa 100644 --- a/upgrade/sql/1.7.1.0.sql +++ b/upgrade/sql/1.7.1.0.sql @@ -46,7 +46,7 @@ ALTER TABLE `PREFIX_product_shop` CHANGE `redirect_type` `redirect_type` ALTER TABLE `PREFIX_product` CHANGE `id_product_redirected` `id_type_redirected` INT(10) NOT NULL DEFAULT '0'; ALTER TABLE `PREFIX_product_shop` CHANGE `id_product_redirected` `id_type_redirected` INT(10) NOT NULL DEFAULT '0'; -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'filterCmsContent', 'Filter the content page', 'This hook is called just before fetching content page', '1'), (NULL, 'filterCmsCategoryContent', 'Filter the content page category', 'This hook is called just before fetching content page category', '1'), (NULL, 'filterProductContent', 'Filter the content page product', 'This hook is called just before fetching content page product', '1'), @@ -68,7 +68,8 @@ INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `po (NULL, 'filterProductSearch', 'Filter search products result', 'This hook is called in order to allow to modify search product result', '1'), (NULL, 'actionProductSearchAfter', 'Event triggered after search product completed', 'This hook is called after the product search. Parameters are already filtered', '1'), (NULL, 'actionEmailSendBefore', 'Before sending an email', 'This hook is used to filter the content or the metadata of an email before sending it or even prevent its sending', '1'), - (NULL, 'displayProductPageDrawer', 'Product Page Drawer', 'This hook displays content in the right sidebar of the product page', '1'); + (NULL, 'displayProductPageDrawer', 'Product Page Drawer', 'This hook displays content in the right sidebar of the product page', '1') +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); DELETE FROM `PREFIX_configuration` WHERE `name` IN ('PS_META_KEYWORDS'); diff --git a/upgrade/sql/1.7.2.0.sql b/upgrade/sql/1.7.2.0.sql index a8fe77e7c..21211ee55 100644 --- a/upgrade/sql/1.7.2.0.sql +++ b/upgrade/sql/1.7.2.0.sql @@ -3,7 +3,7 @@ SET NAMES 'utf8'; ALTER TABLE `PREFIX_store` MODIFY `hours` text; -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'displayAdminProductsMainStepLeftColumnMiddle', 'Display new elements in back office product page, left column of the Basic settings tab', 'This hook launches modules when the back office product page is displayed', '1'), (NULL, 'displayAdminProductsMainStepLeftColumnBottom', 'Display new elements in back office product page, left column of the Basic settings tab', 'This hook launches modules when the back office product page is displayed', '1'), (NULL, 'displayAdminProductsMainStepRightColumnBottom', 'Display new elements in back office product page, right column of the Basic settings tab', 'This hook launches modules when the back office product page is displayed', '1'), @@ -13,11 +13,12 @@ INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `po (NULL, 'displayAdminProductsOptionsStepBottom', 'Display new elements in back office product page, Options tab', 'This hook launches modules when the back office product page is displayed', '1'), (NULL, 'displayAdminProductsSeoStepBottom', 'Display new elements in back office product page, SEO tab', 'This hook launches modules when the back office product page is displayed', '1'), (NULL, 'displayAdminProductsShippingStepBottom', 'Display new elements in back office product page, Shipping tab', 'This hook launches modules when the back office product page is displayed', '1'), - (NULL, 'displayAdminProductsCombinationBottom', 'Display new elements in back office product page, Combination tab', 'This hook launches modules when the back office product page is displayed', '1'), + (NULL, 'displayAdminProductsCombinationBottom', 'Display new elements in back office product page, Combination tab', 'This hook launches modules when the back office product page is displayed', '1'), (NULL, 'displayWrapperTop', 'Main wrapper section (top)', 'This hook displays new elements in the top of the main wrapper', '1'), (NULL, 'displayWrapperBottom', 'Main wrapper section (bottom)', 'This hook displays new elements in the bottom of the main wrapper', '1'), (NULL, 'displayContentWrapperTop', 'Content wrapper section (top)', 'This hook displays new elements in the top of the content wrapper', '1'), - (NULL, 'displayContentWrapperBottom', 'Content wrapper section (bottom)', 'This hook displays new elements in the bottom of the content wrapper', '1'); + (NULL, 'displayContentWrapperBottom', 'Content wrapper section (bottom)', 'This hook displays new elements in the bottom of the content wrapper', '1') +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); /* PHP:drop_column_from_product_lang_if_exists(); */; diff --git a/upgrade/sql/1.7.3.0.sql b/upgrade/sql/1.7.3.0.sql index b59fad1f3..adf8c4365 100644 --- a/upgrade/sql/1.7.3.0.sql +++ b/upgrade/sql/1.7.3.0.sql @@ -44,13 +44,14 @@ ALTER TABLE `PREFIX_feature_product` DROP PRIMARY KEY, ADD PRIMARY KEY (`id_feat ALTER TABLE `PREFIX_customization_field` ADD `is_deleted` TINYINT(1) NOT NULL DEFAULT '0'; -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'displayAdminCustomersAddressesItemAction', 'Display new elements in the Back Office, tab AdminCustomers, Addresses actions', 'This hook launches modules when the Addresses list into the AdminCustomers tab is displayed in the Back Office', '1'), (NULL, 'displayDashboardToolbarTopMenu', 'Display new elements in back office page with a dashboard, on top Menu', 'This hook launches modules when a page with a dashboard is displayed', '1'), - (NULL, 'displayDashboardToolbarIcons', 'Display new elements in back office page with dashboard, on icons list', 'This hook launches modules when the back office with dashboard is displayed', '1'); + (NULL, 'displayDashboardToolbarIcons', 'Display new elements in back office page with dashboard, on icons list', 'This hook launches modules when the back office with dashboard is displayed', '1') +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); INSERT IGNORE INTO `PREFIX_authorization_role` (`slug`) VALUES ('ROLE_MOD_TAB_DEFAULT_CREATE'), ('ROLE_MOD_TAB_DEFAULT_READ'), ('ROLE_MOD_TAB_DEFAULT_UPDATE'), - ('ROLE_MOD_TAB_DEFAULT_DELETE'); \ No newline at end of file + ('ROLE_MOD_TAB_DEFAULT_DELETE'); diff --git a/upgrade/sql/1.7.4.0.sql b/upgrade/sql/1.7.4.0.sql index a039886ef..7bb99ec1c 100644 --- a/upgrade/sql/1.7.4.0.sql +++ b/upgrade/sql/1.7.4.0.sql @@ -3,13 +3,14 @@ SET NAMES 'utf8'; ALTER TABLE `PREFIX_order_detail` DROP KEY product_id, ADD KEY product_id (product_id, product_attribute_id); -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'actionAdministrationPageForm', 'Manage Administration Page form fields', 'This hook adds, update or remove fields of the Administration Page form', '1'), (NULL, 'actionAdministrationPageFormSave', 'Processing Administration page form', 'This hook is called when the Administration Page form is processed', '1'), (NULL, 'actionPerformancePageForm', 'Manage Performance Page form fields', 'This hook adds, update or remove fields of the Performance Page form', '1'), (NULL, 'actionPerformancePageFormSave', 'Processing Performance page form', 'This hook is called when the Performance Page form is processed', '1'), (NULL, 'actionMaintenancePageForm', 'Manage Maintenance Page form fields', 'This hook adds, update or remove fields of the Maintenance Page form', '1'), (NULL, 'actionMaintenancePageFormSave', 'Processing Maintenance page form', 'This hook is called when the Maintenance Page form is processed', '1'), - (NULL, 'displayAdminEndContent', 'Administration end of content', 'This hook is displayed at the end of the main content, before the footer', '1'); + (NULL, 'displayAdminEndContent', 'Administration end of content', 'This hook is displayed at the end of the main content, before the footer', '1') +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); /* PHP:ps_1740_update_module_tabs(); */; diff --git a/upgrade/sql/1.7.6.0.sql b/upgrade/sql/1.7.6.0.sql index 7d2bb7dd1..1216ab52d 100644 --- a/upgrade/sql/1.7.6.0.sql +++ b/upgrade/sql/1.7.6.0.sql @@ -44,7 +44,7 @@ SELECT `id_configuration`, l.`id_lang`, `value` /* PHP:ps_1760_update_tabs(); */; /* Insert new hooks */ -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'actionListMailThemes', 'List the available email themes and layouts', 'This hook allows to add/remove available email themes (ThemeInterface) and/or to add/remove their layouts (LayoutInterface)', '1'), (NULL, 'actionGetMailThemeFolder', 'Define the folder of an email theme', 'This hook allows to change the folder of an email theme (useful if you theme is in a module for example)', '1'), (NULL, 'actionBuildMailLayoutVariables', 'Build the variables used in email layout rendering', 'This hook allows to change the variables used when an email layout is rendered', '1'), @@ -251,7 +251,8 @@ INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `po (NULL, 'actionTaxGridPresenterModifier', 'Modify tax grid template data', 'This hook allows to modify data which is about to be used in template for tax grid', '1 '), (NULL, 'actionManufacturerGridPresenterModifier', 'Modify manufacturer grid template data', 'This hook allows to modify data which is about to be used in template for manufacturer grid', '1 '), (NULL, 'actionManufacturerAddressGridPresenterModifier', 'Modify manufacturer address grid template data', 'This hook allows to modify data which is about to be used in template for manufacturer address grid', '1 '), - (NULL, 'actionCmsPageGridPresenterModifier', 'Modify cms page grid template data', 'This hook allows to modify data which is about to be used in template for cms page grid', '1 '); + (NULL, 'actionCmsPageGridPresenterModifier', 'Modify cms page grid template data', 'This hook allows to modify data which is about to be used in template for cms page grid', '1 ') +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); INSERT IGNORE INTO `PREFIX_authorization_role` (`slug`) VALUES ('ROLE_MOD_TAB_ADMINMODULESMANAGE_CREATE'), diff --git a/upgrade/sql/1.7.7.0.sql b/upgrade/sql/1.7.7.0.sql index 65626588d..c5e0c5ef8 100644 --- a/upgrade/sql/1.7.7.0.sql +++ b/upgrade/sql/1.7.7.0.sql @@ -317,7 +317,7 @@ ALTER TABLE `PREFIX_tab` ADD enabled TINYINT(1) NOT NULL; /* PHP:ps_1770_preset_tab_enabled(); */; /* PHP:ps_1770_update_order_status_colors(); */; -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`) VALUES (NULL, 'displayAdminOrderTop', 'Admin Order Top', 'This hook displays content at the top of the order view page'), (NULL, 'displayAdminOrderSide', 'Admin Order Side Column', 'This hook displays content in the order view page in the side column under the customer view'), (NULL, 'displayAdminOrderSideBottom', 'Admin Order Side Column Bottom', 'This hook displays content in the order view page at the bottom of the side column'), @@ -345,7 +345,7 @@ INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`) VAL (NULL, 'actionAdminLoginControllerResetBefore', 'Perform actions before admin login controller reset action initialization', 'This hook is launched before the initialization of the reset action in login controller'), (NULL, 'actionAdminLoginControllerResetAfter', 'Perform actions after admin login controller reset action initialization', 'This hook is launched after the initialization of the reset action in login controller'), (NULL, 'displayHeader', 'Pages html head section', 'This hook adds additional elements in the head section of your pages (head section of html)') -; +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); INSERT IGNORE INTO `PREFIX_hook_alias` (`name`, `alias`) VALUES ('displayAdminOrderTop', 'displayInvoice'), @@ -416,7 +416,7 @@ SET WHERE `osd`.`id_order_detail` = `od`.`id_order_detail` ), 0) ; -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'actionOrderMessageFormBuilderModifier', 'Modify order message identifiable object form', 'This hook allows to modify order message identifiable object forms content by modifying form builder data or FormBuilder itself', '1'), @@ -649,7 +649,7 @@ VALUES (NULL, 'actionOrderMessageFormBuilderModifier', 'Modify order message ide (NULL, 'actionCreditSlipGridPresenterModifier', 'Modify credit slip grid template data', 'This hook allows to modify data which is about to be used in template for credit slip grid', '1'), (NULL, 'displayAfterTitleTag', 'After title tag', 'Use this hook to add content after title tag', '1') -; +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); /* Update wrong hook names */ UPDATE `PREFIX_hook_module` AS hm diff --git a/upgrade/sql/1.7.7.2.sql b/upgrade/sql/1.7.7.2.sql index c90e66e17..a028e29e3 100644 --- a/upgrade/sql/1.7.7.2.sql +++ b/upgrade/sql/1.7.7.2.sql @@ -1,10 +1,10 @@ SET SESSION sql_mode=''; SET NAMES 'utf8'; -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'displayAdminGridTableBefore', 'Display before Grid table', 'This hook adds new blocks before Grid component table.', '1'), (NULL, 'displayAdminGridTableAfter', 'Display after Grid table', 'This hook adds new blocks after Grid component table.', '1') -; +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); UPDATE `PREFIX_hook_module` AS hm INNER JOIN `PREFIX_hook` AS hfrom ON hm.id_hook = hfrom.id_hook AND hfrom.name = 'displayAdminListBefore' diff --git a/upgrade/sql/1.7.8.0.sql b/upgrade/sql/1.7.8.0.sql index 989c96ff8..38ab3be9a 100644 --- a/upgrade/sql/1.7.8.0.sql +++ b/upgrade/sql/1.7.8.0.sql @@ -1,7 +1,7 @@ SET SESSION sql_mode=''; SET NAMES 'utf8mb4'; -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'actionPresentCart', 'Cart Presenter', 'This hook is called before a cart is presented', '1'), (NULL, 'actionPresentOrder', 'Order footer', 'This hook is called before an order is presented', '1'), (NULL, 'actionPresentOrderReturn', 'Order Return Presenter', 'This hook is called before an order return is presented', '1'), @@ -132,7 +132,7 @@ INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `po (NULL,'actionAfterCreateOrderStateFormHandler','Modify order state identifiable object data after creating it','This hook allows to modify order state identifiable object forms data after it was created','1'), (NULL,'actionAfterCreateOrderReturnStateFormHandler','Modify order return state identifiable object data after creating it','This hook allows to modify order return state identifiable object forms data after it was created','1'), (NULL,'actionAfterCreateZoneFormHandler','Modify zone identifiable object data after creating it','This hook allows to modify zone identifiable object forms data after it was created','1') -; +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); ALTER TABLE `PREFIX_employee` ADD `has_enabled_gravatar` TINYINT UNSIGNED DEFAULT 0 NOT NULL; diff --git a/upgrade/sql/8.0.0.sql b/upgrade/sql/8.0.0.sql index 1bcc7adc4..3d3dff041 100644 --- a/upgrade/sql/8.0.0.sql +++ b/upgrade/sql/8.0.0.sql @@ -30,7 +30,7 @@ INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VAL ('PS_SECURITY_TOKEN', '1', NOW(), NOW()) ; -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'actionValidateOrderAfter', 'New Order', 'This hook is called after validating an order by core', '1'), (NULL, 'actionAdminOrdersTrackingNumberUpdate', 'After setting the tracking number for the order', 'This hook allows you to execute code after the unique tracking number for the order was added', '1'), (NULL, 'actionAdminSecurityControllerPostProcessBefore', 'On post-process in Admin Security Controller', 'This hook is called on Admin Security Controller post-process before processing any form', '1'), @@ -44,10 +44,10 @@ INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `po (NULL, 'displayAdminThemesListAfter', 'BO themes list extra content', 'This hook displays content after the themes list in the back office', '1'), (NULL, 'displayModuleConfigureExtraButtons', 'Module configuration - After toolbar buttons', 'This hook allows to add toolbar''s additional content on module configuration page', '1'), (NULL, 'actionGetAlternativeSearchPanels', 'Additional search panel', 'This hook allows to add an additional search panel for external providers in PrestaShop back office', '1') -; +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); /* Auto generated hooks added for version 8.0.0 */ -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'actionCreateProductFormBuilderModifier', 'Modify create product identifiable object form', 'This hook allows to modify create product identifiable object forms content by modifying form builder data or FormBuilder itself', '1'), (NULL, 'actionCombinationListFormBuilderModifier', 'Modify combination list identifiable object form', 'This hook allows to modify combination list identifiable object forms content by modifying form builder data or FormBuilder itself', '1'), (NULL, 'actionProductImageFormBuilderModifier', 'Modify product image identifiable object form', 'This hook allows to modify product image identifiable object forms content by modifying form builder data or FormBuilder itself', '1'), @@ -174,7 +174,7 @@ INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `po (NULL, 'actionSecuritySessionCustomerGridPresenterModifier', 'Modify security session customer grid template data', 'This hook allows to modify data which is about to be used in template for security session customer grid', '1'), (NULL, 'actionStateGridPresenterModifier', 'Modify state grid template data', 'This hook allows to modify data which is about to be used in template for state grid', '1'), (NULL, 'actionTitleGridPresenterModifier', 'Modify title grid template data', 'This hook allows to modify data which is about to be used in template for title grid', '1') -; +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); ALTER TABLE `PREFIX_employee_session` ADD `date_upd` DATETIME NOT NULL AFTER `token`; ALTER TABLE `PREFIX_employee_session` ADD `date_add` DATETIME NOT NULL AFTER `date_upd`; diff --git a/upgrade/sql/8.1.0.sql b/upgrade/sql/8.1.0.sql index 7220b13b5..a90b9b56b 100644 --- a/upgrade/sql/8.1.0.sql +++ b/upgrade/sql/8.1.0.sql @@ -4,15 +4,17 @@ SET NAMES 'utf8mb4'; UPDATE `PREFIX_configuration` SET `value` = 'US/Pacific' WHERE `name` = 'PS_TIMEZONE' AND `value` = 'US/Pacific-New' LIMIT 1; DELETE FROM `PREFIX_timezone` WHERE `name` = 'US/Pacific-New'; -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'actionModifyFrontendSitemap', 'Add or remove links on sitemap page', 'This hook allows to modify links on sitemap page of your shop. Useful to improve indexation of your modules.', '1'), (NULL, 'displayAddressSelectorBottom', 'After address selection on checkout page', 'This hook is displayed after the address selection in checkout step.', '1'), (NULL, 'actionGenerateDocumentReference', 'Modify document reference', 'This hook allows modules to return custom document references', '1'), (NULL, 'actionLoggerLogMessage', 'Allows to make extra action while a log is triggered', 'This hook allows to make an extra action while an exception is thrown and the logger logs it', '1'), - (NULL, 'actionProductPriceCalculation', 'Product Price Calculation', 'This hook is called into the priceCalculation method to be able to override the price calculation', '1'); + (NULL, 'actionProductPriceCalculation', 'Product Price Calculation', 'This hook is called into the priceCalculation method to be able to override the price calculation', '1') +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES - (NULL, 'actionAdminMenuTabsModifier', 'Modify back office menu', 'This hook allows modifying back office menu tabs', '1'); +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES + (NULL, 'actionAdminMenuTabsModifier', 'Modify back office menu', 'This hook allows modifying back office menu tabs', '1') +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); /* Default configuration for backorder, in order to keep behavior */ INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES diff --git a/upgrade/sql/8.1.2.sql b/upgrade/sql/8.1.2.sql index 4fc29d796..94a275a40 100644 --- a/upgrade/sql/8.1.2.sql +++ b/upgrade/sql/8.1.2.sql @@ -10,6 +10,7 @@ UPDATE `PREFIX_tab` SET wording_domain = 'Admin.Navigation.Menu', wording = 'Sec UPDATE `PREFIX_tab` SET wording_domain = 'Admin.Navigation.Menu', wording = 'Employee Sessions' WHERE class_name = 'AdminSecuritySessionEmployee'; UPDATE `PREFIX_tab` SET wording_domain = 'Admin.Navigation.Menu', wording = 'Customer Sessions' WHERE class_name = 'AdminSecuritySessionCustomer'; -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'actionLanguageLinkParameters', 'Add parameters to language link', 'Allows modules to provide proper parameters for links in other languages.', '1'), - (NULL, 'actionAfterLoadRoutes', 'Triggers after loading routes', 'Allow modules to modify routes in any way or add their own multilanguage routes.', '1'); + (NULL, 'actionAfterLoadRoutes', 'Triggers after loading routes', 'Allow modules to modify routes in any way or add their own multilanguage routes.', '1') +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); diff --git a/upgrade/sql/8.1.5.sql b/upgrade/sql/8.1.5.sql index ac52327c4..ade5fcd02 100644 --- a/upgrade/sql/8.1.5.sql +++ b/upgrade/sql/8.1.5.sql @@ -2,9 +2,10 @@ SET SESSION sql_mode=''; SET NAMES 'utf8mb4'; /* Adds missing hook entries that have been added to 8.1.4 installer. */ -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'actionSubmitAccountBefore', 'Triggers before customer registers', 'Triggers after submitting registration form, before the registration process itself. Allows to modify result of this action.', '1'), (NULL, 'actionAuthenticationBefore', 'Triggers before customer logs in', 'Triggers after successful validation of login form, before the login process itself.', '1'), (NULL, 'actionCartUpdateQuantityBefore', 'Triggers before product is added to cart', 'Allows responding to add to cart events.', '1'), - (NULL, 'actionAjaxDieBefore', 'Triggers when returning AJAX response', 'Allows to modify AJAX response of controllers using ajaxRender method.', '1'); + (NULL, 'actionAjaxDieBefore', 'Triggers when returning AJAX response', 'Allows to modify AJAX response of controllers using ajaxRender method.', '1') +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); diff --git a/upgrade/sql/9.0.0.sql b/upgrade/sql/9.0.0.sql index 26ff49cb5..7c9e6c08b 100644 --- a/upgrade/sql/9.0.0.sql +++ b/upgrade/sql/9.0.0.sql @@ -6,13 +6,14 @@ INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VAL ('PS_DEBUG_COOKIE_VALUE', '', NOW(), NOW()) ; -INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'actionUpdateCartAddress', 'Triggers after changing address on the cart', 'This hook is called after address is changed on the cart', '1'), (NULL, 'actionPresentCategory', 'Category Presenter', 'This hook is called before a category is presented', '1'), (NULL, 'actionPresentStore', 'Store Presenter', 'This hook is called before a store is presented', '1'), (NULL, 'actionPresentSupplier', 'Supplier Presenter', 'This hook is called before a supplier is presented', '1'), (NULL, 'actionPresentManufacturer', 'Manufacturer Presenter', 'This hook is called before a manufacturer is presented', '1'), - (NULL, 'actionCartGetPackageShippingCost', 'After getting package shipping cost value', 'This hook is called in order to allow to modify package shipping cost', '1'); + (NULL, 'actionCartGetPackageShippingCost', 'After getting package shipping cost value', 'This hook is called in order to allow to modify package shipping cost', '1') +ON DUPLICATE KEY UPDATE `title` = VALUES(`title`), `description` = VALUES(`description`); ALTER TABLE `PREFIX_feature_flag` ADD `type` VARCHAR(64) DEFAULT 'env,dotenv,db' NOT NULL AFTER `name`; From e0f0b59bc288ac2d873ea75d563118996ea97c59 Mon Sep 17 00:00:00 2001 From: Hlavtox Date: Tue, 20 Feb 2024 15:20:47 +0100 Subject: [PATCH 2/2] Update comment --- upgrade/sql/8.1.5.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upgrade/sql/8.1.5.sql b/upgrade/sql/8.1.5.sql index ade5fcd02..cabf8d9d6 100644 --- a/upgrade/sql/8.1.5.sql +++ b/upgrade/sql/8.1.5.sql @@ -1,7 +1,7 @@ SET SESSION sql_mode=''; SET NAMES 'utf8mb4'; -/* Adds missing hook entries that have been added to 8.1.4 installer. */ +/* Adds missing hook entries that have been added to 8.1.5 installer. */ INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'actionSubmitAccountBefore', 'Triggers before customer registers', 'Triggers after submitting registration form, before the registration process itself. Allows to modify result of this action.', '1'), (NULL, 'actionAuthenticationBefore', 'Triggers before customer logs in', 'Triggers after successful validation of login form, before the login process itself.', '1'),