diff --git a/classes/Hook.php b/classes/Hook.php
index 7a5349522..1ad1b4ca3 100644
--- a/classes/Hook.php
+++ b/classes/Hook.php
@@ -98,7 +98,7 @@ class HookCore extends ObjectModel
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT * FROM `'._DB_PREFIX_.'hook` h
'.($position ? 'WHERE h.`position` = 1' : '').'
- ORDER BY `title`'
+ ORDER BY `name`'
);
}
diff --git a/install-dev/data/xml/hook.xml b/install-dev/data/xml/hook.xml
index d8625de40..abeb6527e 100644
--- a/install-dev/data/xml/hook.xml
+++ b/install-dev/data/xml/hook.xml
@@ -8,434 +8,262 @@
- displayPayment
- Payment
-
+ displayPaymentPaymentThis hook displays new elements on the payment page
- actionValidateOrder
- New orders
-
+ actionValidateOrderNew orders
- actionPaymentConfirmation
- Payment confirmation
-
+ actionPaymentConfirmationPayment confirmationThis hook displays new elements after the payment is validated
- displayPaymentReturn
- Payment return
-
+ displayPaymentReturnPayment return
- actionUpdateQuantity
- Quantity update
- Quantity is updated only when the customer effectively <b>place</b> his order.
+ actionUpdateQuantityQuantity updateQuantity is updated only when a customer effectively places their order
- displayRightColumn
- Right column blocks
-
+ displayRightColumnRight column blocksThis hook displays new elements in the right-hand column
- displayLeftColumn
- Left column blocks
-
+ displayLeftColumnLeft column blocksThis hook displays new elements in the left-hand column
- displayHome
- Homepage content
-
+ displayHomeHomepage contentThis hook displays new elements on the homepage
- displayHeader
- Header of pages
- A hook which allow you to do things in the header of each pages
+ displayHeaderPages headerThis hook displays additional elements in the header of your pages
- actionCartSave
- Cart creation and update
-
+ actionCartSaveCart creation and updateThis hook is displayed when a product is added to the cart or if the cart's content is modified
- actionAuthentication
- Successful customer authentication
-
+ actionAuthenticationSuccessful customer authenticationThis hook is displayed after a customer successfully signs in
- actionProductAdd
- Product creation
-
+ actionProductAddProduct creationThis hook is displayed after a product is created
- actionProductUpdate
- Product Update
-
+ actionProductUpdateProduct updateThis hook is displayed after a product has been updated
- displayTop
- Top of pages
- A hook which allow you to do things a the top of each pages.
+ displayTopTop of pagesThis hook displays additional elements at the top of your pages
- displayRightColumnProduct
- Extra actions on the product page (right column).
-
+ displayRightColumnProductNew elements on the product page (right column)This hook displays new elements in the right-hand column of the product page
- actionProductDelete
- Product deletion
- This hook is called when a product is deleted
+ actionProductDeleteProduct deletionThis hook is called when a product is deleted
- displayFooterProduct
- Product footer
- Add new blocks under the product description
+ displayFooterProductProduct footerThis hook adds new blocks under the product's description
- displayInvoice
- Invoice
- Add blocks to invoice (order)
+ displayInvoiceInvoiceThis hook displays new blocks on the invoice (order)
- actionOrderStatusUpdate
- Order's status update event
- Launch modules when the order's status of an order change.
+ actionOrderStatusUpdateOrder status update - EventThis hook launches modules when the status of an order changes.
- displayAdminOrder
- Display in Back-Office, tab AdminOrder
- Launch modules when the tab AdminOrder is displayed on back-office.
+ displayAdminOrderDisplay new elements in the Back Office, tab AdminOrderThis hook launches modules when the AdminOrder" tab is displayed in the Back Office"
- displayFooter
- Footer
- Add block in footer
+ displayFooterFooterThis hook displays new blocks in the footer
- displayPDFInvoice
- PDF Invoice
- Allow the display of extra informations into the PDF invoice
+ displayPDFInvoicePDF InvoiceThis hook allows you to display additional information on PDF invoices
- displayAdminCustomers
- Display in Back-Office, tab AdminCustomers
- Launch modules when the tab AdminCustomers is displayed on back-office.
+ displayAdminCustomersDisplay new elements in the Back Office, tab AdminCustomersThis hook launches modules when the AdminCustomers" tab is displayed in the Back Office"
- displayOrderConfirmation
- Order confirmation page
- Called on order confirmation page
+ displayOrderConfirmationOrder confirmation pageThis hook is called within an order's confirmation page
- actionCustomerAccountAdd
- Successful customer create account
- Called when new customer create account successfuled
+ actionCustomerAccountAddSuccessful customer account creationThis hook is called when a new customer creates an account successfully
- displayCustomerAccount
- Customer account page display in front office
- Display on page account of the customer
+ displayCustomerAccountCustomer account displayed in Front OfficeThis hook displays new elements on the customer account page
- actionOrderSlipAdd
- Called when a order slip is created
- Called when a quantity of one product change in an order.
+ actionOrderSlipAddOrder slip creationThis hook is called when a product's quantity is modified
- displayProductTab
- Tabs on product page
- Called on order product page tabs
+ displayProductTabTabs on product pageThis hook is called on the product page's tab
- displayProductTabContent
- Content of tabs on product page
- Called on order product page tabs
+ displayProductTabContentTabs content on the product pageThis hook is called on the product page's tab
- displayShoppingCartFooter
- Shopping cart footer
- Display some specific informations on the shopping cart page
+ displayShoppingCartFooterShopping cart footerThis hook displays some specific information on the shopping cart's page
- displayCustomerAccountForm
- Customer account creation form
- Display some information on the form to create a customer account
+ displayCustomerAccountFormCustomer account creation formThis hook displays some information on the form to create a customer account
- displayAdminStatsModules
- Stats - Modules
-
+ displayAdminStatsModulesStats - Modules
- displayAdminStatsGraphEngine
- Graph Engines
-
+ displayAdminStatsGraphEngineGraph engines
- actionOrderReturn
- Product returned
-
+ actionOrderReturnReturned productThis hook is displayed when a customer returns a product
- displayProductButtons
- Product actions
- Put new action buttons on product page
+ displayProductButtonsProduct page actionsThis hook adds new action buttons on the product page
- displayBackOfficeHome
- Administration panel homepage
-
+ displayBackOfficeHomeAdministration panel homepageThis hook is displayed on the admin panel's homepage
- displayAdminStatsGridEngine
- Grid Engines
-
+ displayAdminStatsGridEngineGrid engines
- actionWatermark
- Watermark
-
+ actionWatermarkWatermark
- actionProductCancel
- Product cancelled
- This hook is called when you cancel a product in an order
+ actionProductCancelProduct cancelledThis hook is called when you cancel a product in an order
- displayLeftColumnProduct
- Extra actions on the product page (left column).
-
+ displayLeftColumnProductNew elements on the product page (left column)This hook displays new elements in the left-hand column of the product page
- actionProductOutOfStock
- Product out of stock
- Make action while product is out of stock
+ actionProductOutOfStockOut-of-stock productThis hook displays new action buttons if a product is out of stock
- actionProductAttributeUpdate
- Product attribute update
-
+ actionProductAttributeUpdateProduct attribute updateThis hook is displayed when a product's attribute is updated
- displayCarrierList
- Extra carrier (module mode)
-
+ displayCarrierListExtra carrier (module mode)
- displayShoppingCart
- Shopping cart extra button
- Display some specific informations
+ displayShoppingCartShopping cart - Additional buttonThis hook displays new action buttons within the shopping cart
- actionSearch
- Search
-
+ actionSearchSearch
- displayBeforePayment
- Redirect in order process
- Redirect user to the module instead of displaying payment modules
+ displayBeforePaymentRedirect during the order processThis hook redirects the user to the module instead of displaying payment modules
- actionCarrierUpdate
- Carrier Update
- This hook is called when a carrier is updated
+ actionCarrierUpdateCarrier UpdateThis hook is called when a carrier is updated
- actionOrderStatusPostUpdate
- Post update of order status
-
+ actionOrderStatusPostUpdatePost update of order status
- displayCustomerAccountFormTop
- Block above the form for create an account
-
+ displayCustomerAccountFormTopBlock above the form for create an accountThis hook is displayed above the customer's account creation form
- displayBackOfficeHeader
- Administration panel header
-
+ displayBackOfficeHeaderAdministration panel headerThis hook is displayed in the header of the admin panel
- displayBackOfficeTop
- Administration panel hover the tabs
-
+ displayBackOfficeTopAdministration panel hover the tabsThis hook is displayed on the roll hover of the tabs within the admin panel
- displayBackOfficeFooter
- Administration panel footer
-
+ displayBackOfficeFooterAdministration panel footerThis hook is displayed within the admin panel's footer
- actionProductAttributeDelete
- Product Attribute Deletion
-
+ actionProductAttributeDeleteProduct attribute deletionThis hook is displayed when a product's attribute is deleted
- actionCarrierProcess
- Carrier Process
-
+ actionCarrierProcessCarrier process
- actionOrderDetail
- Order Detail
- To set the follow-up in smarty when order detail is called
+ actionOrderDetailOrder detailThis hook is used to set the follow-up in Smarty when an order's detail is called
- displayBeforeCarrier
- Before carrier list
- This hook is display before the carrier list on Front office
+ displayBeforeCarrierBefore carriers listThis hook is displayed before the carrier list in Front Office
- displayOrderDetail
- Order detail displayed
- Displayed on order detail on front office
+ displayOrderDetailOrder detailThis hook is displayed within the order's details in Front Office
- actionPaymentCCAdd
- Payment CC added
- Payment CC added
+ actionPaymentCCAddPayment CC added
- displayProductComparison
- Extra Product Comparison
- Extra Product Comparison
+ displayProductComparisonExtra product comparison
- actionCategoryAdd
- Category creation
-
+ actionCategoryAddCategory creationThis hook is displayed when a category is created
- actionCategoryUpdate
- Category modification
-
+ actionCategoryUpdateCategory modificationThis hook is displayed when a category is modified
- actionCategoryDelete
- Category removal
-
+ actionCategoryDeleteCategory deletionThis hook is displayed when a category is deleted
- actionBeforeAuthentication
- Before Authentication
- Before authentication
+ actionBeforeAuthenticationBefore authenticationThis hook is displayed before the customer's authentication
- displayPaymentTop
- Top of payment page
- Top of payment page
+ displayPaymentTopTop of payment pageThis hook is displayed at the top of the payment page
- actionHtaccessCreate
- After htaccess creation
- After htaccess creation
+ actionHtaccessCreateAfter htaccess creationThis hook is displayed after the htaccess creation
- actionAdminMetaSave
- After save configuration in AdminMeta
- After save configuration in AdminMeta
+ actionAdminMetaSaveAfter saving the configuration in AdminMetaThis hook is displayed after saving the configuration in AdminMeta
- displayAttributeGroupForm
- Add fields to the form "attribute group"
- Add fields to the form "attribute group"
+ displayAttributeGroupFormAdd fields to the form 'attribute group'This hook adds fields to the form 'attribute group'
- actionAttributeGroupSave
- On saving attribute group
- On saving attribute group
+ actionAttributeGroupSaveSaving an attribute groupThis hook is called while saving an attributes group
- actionAttributeGroupDelete
- On deleting attribute group
- On deleting attribute group
+ actionAttributeGroupDeleteDeleting attribute groupThis hook is called while deleting an attributes group
- displayFeatureForm
- Add fields to the form "feature"
- Add fields to the form "feature"
+ displayFeatureFormAdd fields to the form 'feature'This hook adds fields to the form 'feature'
- actionFeatureSave
- On saving attribute feature
- On saving attribute feature
+ actionFeatureSaveSaving attributes' featuresThis hook is called while saving an attributes features
- actionFeatureDelete
- On deleting attribute feature
- On deleting attribute feature
+ actionFeatureDeleteDeleting attributes' featuresThis hook is called while deleting an attributes features
- actionProductSave
- On saving products
- On saving products
+ actionProductSaveSaving productsThis hook is called while saving products
- actionProductListOverride
- Assign product list to a category
- Assign product list to a category
+ actionProductListOverrideAssign a products list to a categoryThis hook assigns a products list to a category
- displayAttributeGroupPostProcess
- On post-process in admin attribute group
- On post-process in admin attribute group
+ displayAttributeGroupPostProcessOn post-process in admin attribute groupThis hook is called on post-process in admin attribute group
- displayFeaturePostProcess
- On post-process in admin feature
- On post-process in admin feature
+ displayFeaturePostProcessOn post-process in admin featureThis hook is called on post-process in admin feature
- displayFeatureValueForm
- Add fields to the form "feature value"
- Add fields to the form "feature value"
+ displayFeatureValueFormAdd fields to the form 'feature value'This hook adds fields to the form 'feature value'
- displayFeatureValuePostProcess
- On post-process in admin feature value
- On post-process in admin feature value
+ displayFeatureValuePostProcessOn post-process in admin feature valueThis hook is called on post-process in admin feature value
- actionFeatureValueDelete
- On deleting attribute feature value
- On deleting attribute feature value
+ actionFeatureValueDeleteDeleting attributes' features' valuesThis hook is called while deleting an attributes features value
- actionFeatureValueSave
- On saving attribute feature value
- On saving attribute feature value
+ actionFeatureValueSaveSaving an attributes features valueThis hook is called while saving an attributes features value
- displayAttributeForm
- Add fields to the form "attribute value"
- Add fields to the form "attribute value"
+ displayAttributeFormAdd fields to the form 'attribute value'This hook adds fields to the form 'attribute value'
- actionAttributePostProcess
- On post-process in admin feature value
- On post-process in admin feature value
+ actionAttributePostProcessOn post-process in admin feature valueThis hook is called on post-process in admin feature value
- actionAttributeDelete
- On deleting attribute feature value
- On deleting attribute feature value
+ actionAttributeDeleteDeleting an attributes features valueThis hook is called while deleting an attributes features value
- actionAttributeSave
- On saving attribute feature value
- On saving attribute feature value
+ actionAttributeSaveSaving an attributes features valueThis hook is called while saving an attributes features value
- actionTaxManager
- Tax Manager Factory
-
+ actionTaxManagerTax Manager Factory
- displayMyAccountBlock
- My account block
- Display extra informations inside the "my account" block
+ displayMyAccountBlockMy account blockThis hook displays extra information within the 'my account' block"
From d74f9c837b81a65097fd7021d8b67d55a44871ef Mon Sep 17 00:00:00 2001
From: gRoussac
Date: Wed, 30 Jan 2013 16:28:11 +0100
Subject: [PATCH 29/68] [-] BO : Fix bug #PSCFI-6902 fatal error when memcache
not installed and Memcached previously activated
---
classes/cache/CacheMemcache.php | 50 ++++----
classes/controller/AdminController.php | 107 ++++++++++--------
.../admin/AdminPerformanceController.php | 5 +-
3 files changed, 88 insertions(+), 74 deletions(-)
diff --git a/classes/cache/CacheMemcache.php b/classes/cache/CacheMemcache.php
index 543a7e797..277c918bd 100755
--- a/classes/cache/CacheMemcache.php
+++ b/classes/cache/CacheMemcache.php
@@ -46,26 +46,28 @@ class CacheMemcacheCore extends Cache
// Get keys (this code comes from Doctrine 2 project)
$this->keys = array();
- $all_slabs = $this->memcache->getExtendedStats('slabs');
-
- foreach ($all_slabs as $server => $slabs)
- {
- if (is_array($slabs))
- {
- foreach (array_keys($slabs) as $slab_id)
- {
- $dump = $this->memcache->getExtendedStats('cachedump', (int)$slab_id);
- if ($dump)
- {
- foreach ($dump as $entries)
- {
- if ($entries)
- $this->keys = array_merge($this->keys, array_keys($entries));
- }
- }
- }
- }
- }
+ $servers = self::getMemcachedServers();
+ if(is_array($servers) && count($servers) > 0)
+ $all_slabs = $this->memcache->getExtendedStats('slabs');
+ if(isset($all_slabs) && is_array($all_slabs))
+ foreach ($all_slabs as $server => $slabs)
+ {
+ if (is_array($slabs))
+ {
+ foreach (array_keys($slabs) as $slab_id)
+ {
+ $dump = $this->memcache->getExtendedStats('cachedump', (int)$slab_id);
+ if ($dump)
+ {
+ foreach ($dump as $entries)
+ {
+ if ($entries)
+ $this->keys = array_merge($this->keys, array_keys($entries));
+ }
+ }
+ }
+ }
+ }
}
public function __destruct()
@@ -78,8 +80,12 @@ class CacheMemcacheCore extends Cache
*/
public function connect()
{
- $this->memcache = new Memcache();
- $servers = CacheMemcache::getMemcachedServers();
+ if (class_exists('Memcache') && extension_loaded('memcache'))
+ $this->memcache = new Memcache();
+ else
+ return false;
+
+ $servers = self::getMemcachedServers();
if (!$servers)
return false;
foreach ($servers as $server)
diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php
index 3c03a518b..5c2b8076d 100644
--- a/classes/controller/AdminController.php
+++ b/classes/controller/AdminController.php
@@ -2192,9 +2192,10 @@ class AdminControllerCore extends Controller
$class_name = $this->className;
/* Class specific validation rules */
- $rules = call_user_func(array($class_name, 'getValidationRules'), $class_name);
+ if (!empty($class_name))
+ $rules = call_user_func(array($class_name, 'getValidationRules'), $class_name);
- if ((count($rules['requiredLang']) || count($rules['sizeLang']) || count($rules['validateLang'])))
+ if (isset($rules) && count($rules) && (count($rules['requiredLang']) || count($rules['sizeLang']) || count($rules['validateLang'])))
{
/* Language() instance determined by default language */
$default_language = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
@@ -2204,56 +2205,61 @@ class AdminControllerCore extends Controller
}
/* Checking for required fields */
- foreach ($rules['required'] as $field)
- if (($value = Tools::getValue($field)) == false && (string)$value != '0')
- if (!Tools::getValue($this->identifier) || ($field != 'passwd' && $field != 'no-picture'))
- $this->errors[] = sprintf(
- Tools::displayError('The field %s is required.'),
- call_user_func(array($class_name, 'displayFieldName'), $field, $class_name)
- );
+ if (isset($rules['required']) && is_array($rules['required']))
+ foreach ($rules['required'] as $field)
+ if (($value = Tools::getValue($field)) == false && (string)$value != '0')
+ if (!Tools::getValue($this->identifier) || ($field != 'passwd' && $field != 'no-picture'))
+ $this->errors[] = sprintf(
+ Tools::displayError('The field %s is required.'),
+ call_user_func(array($class_name, 'displayFieldName'), $field, $class_name)
+ );
/* Checking for multilingual required fields */
- foreach ($rules['requiredLang'] as $field_lang)
- if (($empty = Tools::getValue($field_lang.'_'.$default_language->id)) === false || $empty !== '0' && empty($empty))
- $this->errors[] = sprintf(
- Tools::displayError('The field %1$s is required at least in %2$s.'),
- call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name),
- $default_language->name
- );
+ if (isset($rules['requiredLang']) && is_array($rules['requiredLang']))
+ foreach ($rules['requiredLang'] as $field_lang)
+ if (($empty = Tools::getValue($field_lang.'_'.$default_language->id)) === false || $empty !== '0' && empty($empty))
+ $this->errors[] = sprintf(
+ Tools::displayError('The field %1$s is required at least in %2$s.'),
+ call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name),
+ $default_language->name
+ );
/* Checking for maximum fields sizes */
- foreach ($rules['size'] as $field => $max_length)
- if (Tools::getValue($field) !== false && Tools::strlen(Tools::getValue($field)) > $max_length)
- $this->errors[] = sprintf(
- Tools::displayError('The field %1$s is too long (%2$d chars max).'),
- call_user_func(array($class_name, 'displayFieldName'), $field, $class_name),
- $max_length
- );
-
- /* Checking for maximum multilingual fields size */
- foreach ($rules['sizeLang'] as $field_lang => $max_length)
- foreach ($languages as $language)
- {
- $field_lang_value = Tools::getValue($field_lang.'_'.$language['id_lang']);
- if ($field_lang_value !== false && Tools::strlen($field_lang_value) > $max_length)
+ if (isset($rules['size']) && is_array($rules['size']))
+ foreach ($rules['size'] as $field => $max_length)
+ if (Tools::getValue($field) !== false && Tools::strlen(Tools::getValue($field)) > $max_length)
$this->errors[] = sprintf(
- Tools::displayError('The field %1$s (%2$s) is too long (%3$d chars max, html chars including).'),
- call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name),
- $language['name'],
+ Tools::displayError('The field %1$s is too long (%2$d chars max).'),
+ call_user_func(array($class_name, 'displayFieldName'), $field, $class_name),
$max_length
);
- }
+
+ /* Checking for maximum multilingual fields size */
+ if (isset($rules['sizeLang']) && is_array($rules['sizeLang']))
+ foreach ($rules['sizeLang'] as $field_lang => $max_length)
+ foreach ($languages as $language)
+ {
+ $field_lang_value = Tools::getValue($field_lang.'_'.$language['id_lang']);
+ if ($field_lang_value !== false && Tools::strlen($field_lang_value) > $max_length)
+ $this->errors[] = sprintf(
+ Tools::displayError('The field %1$s (%2$s) is too long (%3$d chars max, html chars including).'),
+ call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name),
+ $language['name'],
+ $max_length
+ );
+ }
/* Overload this method for custom checking */
$this->_childValidation();
/* Checking for fields validity */
- foreach ($rules['validate'] as $field => $function)
- if (($value = Tools::getValue($field)) !== false && ($field != 'passwd'))
- if (!Validate::$function($value) && !empty($value))
- $this->errors[] = sprintf(
- Tools::displayError('The field %s is invalid.'),
- call_user_func(array($class_name, 'displayFieldName'), $field, $class_name)
- );
+ if (isset($rules['validate']) && is_array($rules['validate']))
+ foreach ($rules['validate'] as $field => $function)
+ if (($value = Tools::getValue($field)) !== false && ($field != 'passwd'))
+ if (!Validate::$function($value) && !empty($value))
+ $this->errors[] = sprintf(
+ Tools::displayError('The field %s is invalid.'),
+ call_user_func(array($class_name, 'displayFieldName'), $field, $class_name)
+ );
/* Checking for passwd_old validity */
if (($value = Tools::getValue('passwd')) != false)
@@ -2271,15 +2277,16 @@ class AdminControllerCore extends Controller
}
/* Checking for multilingual fields validity */
- foreach ($rules['validateLang'] as $field_lang => $function)
- foreach ($languages as $language)
- if (($value = Tools::getValue($field_lang.'_'.$language['id_lang'])) !== false && !empty($value))
- if (!Validate::$function($value))
- $this->errors[] = sprintf(
- Tools::displayError('The field %1$s (%2$s) is invalid.'),
- call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name),
- $language['name']
- );
+ if (isset($rules['validateLang']) && is_array($rules['validateLang']))
+ foreach ($rules['validateLang'] as $field_lang => $function)
+ foreach ($languages as $language)
+ if (($value = Tools::getValue($field_lang.'_'.$language['id_lang'])) !== false && !empty($value))
+ if (!Validate::$function($value))
+ $this->errors[] = sprintf(
+ Tools::displayError('The field %1$s (%2$s) is invalid.'),
+ call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name),
+ $language['name']
+ );
}
/**
diff --git a/controllers/admin/AdminPerformanceController.php b/controllers/admin/AdminPerformanceController.php
index d09925582..dbd1d5280 100644
--- a/controllers/admin/AdminPerformanceController.php
+++ b/controllers/admin/AdminPerformanceController.php
@@ -725,6 +725,7 @@ class AdminPerformanceControllerCore extends AdminController
$cache_active = 0;
else
$cache_active = 1;
+
if (!$caching_system = Tools::getValue('caching_system'))
$this->errors[] = Tools::displayError('Caching system is missing');
else
@@ -733,6 +734,7 @@ class AdminPerformanceControllerCore extends AdminController
'define(\'_PS_CACHING_SYSTEM_\', \''.$caching_system.'\');',
$new_settings
);
+
if ($cache_active && $caching_system == 'CacheMemcache' && !extension_loaded('memcache'))
$this->errors[] = Tools::displayError('To use Memcached, you must install the Memcache PECL extension on your server.').'
http://www.php.net/manual/en/memcache.installation.php';
@@ -778,8 +780,7 @@ class AdminPerformanceControllerCore extends AdminController
else
$this->errors[] = Tools::displayError('You do not have permission to edit here.');
}
-
- if ($redirecAdmin)
+ if ($redirecAdmin && (!isset($this->errors) || !count($this->errors)))
Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
else
return parent::postProcess();
From 1d06030a661d81364daa04f52b37692d60667da3 Mon Sep 17 00:00:00 2001
From: gRoussac
Date: Wed, 30 Jan 2013 17:08:51 +0100
Subject: [PATCH 30/68] [-] FO : Fix fatal error when memcache is not installed
and using Memcached
---
classes/cache/CacheMemcache.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/classes/cache/CacheMemcache.php b/classes/cache/CacheMemcache.php
index 277c918bd..116aac0aa 100755
--- a/classes/cache/CacheMemcache.php
+++ b/classes/cache/CacheMemcache.php
@@ -47,8 +47,9 @@ class CacheMemcacheCore extends Cache
// Get keys (this code comes from Doctrine 2 project)
$this->keys = array();
$servers = self::getMemcachedServers();
- if(is_array($servers) && count($servers) > 0)
+ if(is_array($servers) && count($servers) > 0 && method_exists('Memcache', 'getExtendedStats'))
$all_slabs = $this->memcache->getExtendedStats('slabs');
+
if(isset($all_slabs) && is_array($all_slabs))
foreach ($all_slabs as $server => $slabs)
{
From 8b5793094aa8c52a9a337c489b3d7b28925eee0d Mon Sep 17 00:00:00 2001
From: gRoussac
Date: Wed, 30 Jan 2013 17:30:21 +0100
Subject: [PATCH 31/68] [-] BO : 'MCached' is 'CacheMemcache' for
PS_CACHING_SYSTEM_
---
controllers/admin/AdminPerformanceController.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/controllers/admin/AdminPerformanceController.php b/controllers/admin/AdminPerformanceController.php
index dbd1d5280..a893f66f7 100644
--- a/controllers/admin/AdminPerformanceController.php
+++ b/controllers/admin/AdminPerformanceController.php
@@ -761,7 +761,7 @@ class AdminPerformanceControllerCore extends AdminController
Configuration::updateValue('PS_CACHEFS_DIRECTORY_DEPTH', (int)$depth);
}
}
- else if ($caching_system == 'MCached' && $cache_active && !_PS_CACHE_ENABLED_ && _PS_CACHING_SYSTEM_ == 'MCached')
+ else if ($caching_system == 'CacheMemcache' && $cache_active && !_PS_CACHE_ENABLED_ && _PS_CACHING_SYSTEM_ == 'CacheMemcache')
Cache::getInstance()->flush();
if (!count($this->errors))
From 4658b24e4b3e171edf16c04781738431bac89285 Mon Sep 17 00:00:00 2001
From: gRoussac
Date: Wed, 30 Jan 2013 18:47:30 +0100
Subject: [PATCH 32/68] [-] CORE : FIx #PSCFV-3163 getextendedstats returning
new keys
---
classes/cache/CacheMemcache.php | 37 +++++++++++++++++++--------------
1 file changed, 21 insertions(+), 16 deletions(-)
diff --git a/classes/cache/CacheMemcache.php b/classes/cache/CacheMemcache.php
index 116aac0aa..bc1597c57 100755
--- a/classes/cache/CacheMemcache.php
+++ b/classes/cache/CacheMemcache.php
@@ -47,26 +47,31 @@ class CacheMemcacheCore extends Cache
// Get keys (this code comes from Doctrine 2 project)
$this->keys = array();
$servers = self::getMemcachedServers();
- if(is_array($servers) && count($servers) > 0 && method_exists('Memcache', 'getExtendedStats'))
- $all_slabs = $this->memcache->getExtendedStats('slabs');
-
+
+ if(is_array($servers) && count($servers) > 0 && method_exists('Memcache', 'getStats'))
+ $all_slabs = $this->memcache->getStats('slabs');
+
if(isset($all_slabs) && is_array($all_slabs))
foreach ($all_slabs as $server => $slabs)
{
if (is_array($slabs))
{
- foreach (array_keys($slabs) as $slab_id)
- {
- $dump = $this->memcache->getExtendedStats('cachedump', (int)$slab_id);
- if ($dump)
- {
- foreach ($dump as $entries)
- {
- if ($entries)
- $this->keys = array_merge($this->keys, array_keys($entries));
- }
- }
- }
+
+ foreach (array_keys($slabs) as $slab_id)
+ {
+ if(is_int($slab_id))
+ {
+ $dump = $this->memcache->getStats('cachedump', (int)$slab_id);
+ if ($dump)
+ {
+ foreach ($dump as $entries)
+ {
+ if ($entries)
+ $this->keys = array_merge($this->keys, array_keys($entries));
+ }
+ }
+ }
+ }
}
}
}
@@ -85,7 +90,7 @@ class CacheMemcacheCore extends Cache
$this->memcache = new Memcache();
else
return false;
-
+
$servers = self::getMemcachedServers();
if (!$servers)
return false;
From 836a30b02920ed1c7696b0061c2c499536436913 Mon Sep 17 00:00:00 2001
From: gRoussac
Date: Wed, 30 Jan 2013 18:52:52 +0100
Subject: [PATCH 33/68] // norms
---
classes/cache/CacheMemcache.php | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/classes/cache/CacheMemcache.php b/classes/cache/CacheMemcache.php
index bc1597c57..9aa8077fc 100755
--- a/classes/cache/CacheMemcache.php
+++ b/classes/cache/CacheMemcache.php
@@ -56,22 +56,21 @@ class CacheMemcacheCore extends Cache
{
if (is_array($slabs))
{
-
- foreach (array_keys($slabs) as $slab_id)
- {
- if(is_int($slab_id))
- {
- $dump = $this->memcache->getStats('cachedump', (int)$slab_id);
- if ($dump)
- {
- foreach ($dump as $entries)
- {
- if ($entries)
- $this->keys = array_merge($this->keys, array_keys($entries));
- }
- }
- }
- }
+ foreach (array_keys($slabs) as $slab_id)
+ {
+ if(is_int($slab_id))
+ {
+ $dump = $this->memcache->getStats('cachedump', (int)$slab_id);
+ if ($dump)
+ {
+ foreach ($dump as $entries)
+ {
+ if ($entries)
+ $this->keys = array_merge($this->keys, array_keys($entries));
+ }
+ }
+ }
+ }
}
}
}
From 92ca63402aec72013625369047cd8c5abe663e55 Mon Sep 17 00:00:00 2001
From: gRoussac
Date: Thu, 31 Jan 2013 11:33:37 +0100
Subject: [PATCH 34/68] [-] BO : Adresses not deduplicate in orders page
---
classes/Customer.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/classes/Customer.php b/classes/Customer.php
index ef3ab32df..2dfa23c3e 100644
--- a/classes/Customer.php
+++ b/classes/Customer.php
@@ -438,13 +438,14 @@ class CustomerCore extends ObjectModel
*/
public function getAddresses($id_lang)
{
- $sql = 'SELECT a.*, cl.`name` AS country, s.name AS state, s.iso_code AS state_iso
+ $sql = 'SELECT DISTINCT a.*, cl.`name` AS country, s.name AS state, s.iso_code AS state_iso
FROM `'._DB_PREFIX_.'address` a
LEFT JOIN `'._DB_PREFIX_.'country` c ON (a.`id_country` = c.`id_country`)
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country`)
LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = a.`id_state`)
'.(Context::getContext()->shop->getGroup()->share_order ? '' : Shop::addSqlAssociation('country', 'c')).'
WHERE `id_lang` = '.(int)$id_lang.' AND `id_customer` = '.(int)$this->id.' AND a.`deleted` = 0';
+ d($sql);
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
}
From cf2bc874badf85b519ca3b90df304530f90becdf Mon Sep 17 00:00:00 2001
From: gRoussac
Date: Thu, 31 Jan 2013 11:50:19 +0100
Subject: [PATCH 35/68] // forgot debug sorry
---
classes/Customer.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/classes/Customer.php b/classes/Customer.php
index 2dfa23c3e..4d953a385 100644
--- a/classes/Customer.php
+++ b/classes/Customer.php
@@ -445,7 +445,7 @@ class CustomerCore extends ObjectModel
LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = a.`id_state`)
'.(Context::getContext()->shop->getGroup()->share_order ? '' : Shop::addSqlAssociation('country', 'c')).'
WHERE `id_lang` = '.(int)$id_lang.' AND `id_customer` = '.(int)$this->id.' AND a.`deleted` = 0';
- d($sql);
+
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
}
From d4e7f7cd00a35ae6de52b52b3b6f45802323f5a8 Mon Sep 17 00:00:00 2001
From: gRoussac
Date: Thu, 31 Jan 2013 12:03:16 +0100
Subject: [PATCH 36/68] [-] FO : Fix bug #PSCFV-7504 last category for parent
and not always default one
---
controllers/front/ProductController.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php
index c57997bbd..84c45a956 100644
--- a/controllers/front/ProductController.php
+++ b/controllers/front/ProductController.php
@@ -145,7 +145,7 @@ class ProductControllerCore extends FrontController
// Load category
if (isset($_SERVER['HTTP_REFERER'])
- && !strstr($_SERVER['HTTP_REFERER'], Tools::getHttpHost()) // Assure us the previous page was one of the shop
+ && strstr($_SERVER['HTTP_REFERER'], Tools::getHttpHost()) // Assure us the previous page was one of the shop
&& preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs))
{
// If the previous page was a category and is a parent category of the product use this category as parent category
From 9b7a2aea0115dc4bb15ce7705ff408a2120b7205 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Gaillard?=
Date: Thu, 31 Jan 2013 14:45:54 +0100
Subject: [PATCH 37/68] // Don't display error message for virtual cart without
carrier available
---
controllers/front/OrderController.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/controllers/front/OrderController.php b/controllers/front/OrderController.php
index 1881cc530..de8de6ba5 100644
--- a/controllers/front/OrderController.php
+++ b/controllers/front/OrderController.php
@@ -273,7 +273,7 @@ class OrderControllerCore extends ParentOrderController
// Add checking for all addresses
$address_without_carriers = $this->context->cart->getDeliveryAddressesWithoutCarriers();
- if (count($address_without_carriers))
+ if (count($address_without_carriers) && !$this->context->cart->isVirtualCart())
{
if (count($address_without_carriers) > 1)
$this->errors[] = sprintf(Tools::displayError('There are no carriers that deliver to some addresses you selected.', !Tools::getValue('ajax')));
From f9f24aef84e1f3f02276f6e336ee1f9c7a7683c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Gaillard?=
Date: Thu, 31 Jan 2013 15:10:52 +0100
Subject: [PATCH 38/68] [-] FO: Fix #PSCFV-7530 bad quantity returned displayed
on order detail for multiple return
---
classes/order/OrderReturn.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/classes/order/OrderReturn.php b/classes/order/OrderReturn.php
index cdd4e4355..287cd93f9 100644
--- a/classes/order/OrderReturn.php
+++ b/classes/order/OrderReturn.php
@@ -225,11 +225,12 @@ class OrderReturnCore extends ObjectModel
public static function addReturnedQuantity(&$products, $id_order)
{
$details = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
- SELECT od.id_order_detail, GREATEST(od.product_quantity_return, IFNULL(ord.product_quantity,0)) as qty_returned
+ SELECT od.id_order_detail, GREATEST(od.product_quantity_return, IFNULL(SUM(ord.product_quantity),0)) as qty_returned
FROM '._DB_PREFIX_.'order_detail od
LEFT JOIN '._DB_PREFIX_.'order_return_detail ord
ON ord.id_order_detail = od.id_order_detail
- WHERE od.id_order = '.(int)$id_order
+ WHERE od.id_order = '.(int)$id_order.'
+ GROUP BY od.id_order_detail'
);
if (!$details)
return;
From da439c47788ed5e11f12774089e1d611b52576ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Gaillard?=
Date: Thu, 31 Jan 2013 15:33:30 +0100
Subject: [PATCH 39/68] =?UTF-8?q?[-]=20FO:=20Fix=C2=A0#PSCFV-7474=20displa?=
=?UTF-8?q?y=20taxes=20on=20order=20payment=20when=20the=20price=20without?=
=?UTF-8?q?=20taxes=20is=20displayed?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
themes/default/order-payment.tpl | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/themes/default/order-payment.tpl b/themes/default/order-payment.tpl
index cd871cf7d..9cccac400 100644
--- a/themes/default/order-payment.tpl
+++ b/themes/default/order-payment.tpl
@@ -161,8 +161,13 @@
{/if}
{/if}
-
{if $use_taxes}
+ {if $priceDisplay && $total_tax != 0}
+
+
{l s='Total tax:'}
+
{displayPrice price=$total_tax}
+
+ {/if}
{if $voucherAllowed}
From 459244002ee426dac09a245ec8b5007f77ea3c37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Gaillard?=
Date: Thu, 31 Jan 2013 16:54:30 +0100
Subject: [PATCH 40/68] [-] BO: Fix #PSCFV-7576
---
admin-dev/themes/default/template/controllers/orders/form.tpl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/admin-dev/themes/default/template/controllers/orders/form.tpl b/admin-dev/themes/default/template/controllers/orders/form.tpl
index 7e1138ca0..e6179ea30 100755
--- a/admin-dev/themes/default/template/controllers/orders/form.tpl
+++ b/admin-dev/themes/default/template/controllers/orders/form.tpl
@@ -300,7 +300,7 @@
id_product: id_product,
id_product_attribute: id_product_attribute,
id_customer: id_customer,
- price: new_price
+ price: new Number(new_price.replace(",",".")).toFixed(4).toString()
},
success : function(res)
{
From 19c2d3ce7e113e0a7ba36a9393e1755c70188b9c Mon Sep 17 00:00:00 2001
From: Damien Metzger
Date: Thu, 31 Jan 2013 11:41:15 +0100
Subject: [PATCH 41/68] // Added references to demo products
---
install-dev/fixtures/apple/data/product.xml | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/install-dev/fixtures/apple/data/product.xml b/install-dev/fixtures/apple/data/product.xml
index e04599d94..d852d0dcc 100644
--- a/install-dev/fixtures/apple/data/product.xml
+++ b/install-dev/fixtures/apple/data/product.xml
@@ -43,31 +43,31 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
From b3aa28171385341779abbda092d802a67ea6c06c Mon Sep 17 00:00:00 2001
From: Damien Metzger
Date: Thu, 31 Jan 2013 15:11:57 +0100
Subject: [PATCH 42/68] // Do not search in deactivated tabs (you can still
search in forbidden tab however)
---
controllers/admin/AdminSearchController.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/controllers/admin/AdminSearchController.php b/controllers/admin/AdminSearchController.php
index 390a53638..9811fd754 100644
--- a/controllers/admin/AdminSearchController.php
+++ b/controllers/admin/AdminSearchController.php
@@ -202,7 +202,11 @@ class AdminSearchControllerCore extends AdminController
global $_LANGADM;
$tabs = array();
$key_match = array();
- $result = Db::getInstance()->executeS('SELECT class_name, name FROM '._DB_PREFIX_.'tab t INNER JOIN '._DB_PREFIX_.'tab_lang tl ON t.id_tab = tl.id_tab AND tl.id_lang = '.(int)$this->context->language->id);
+ $result = Db::getInstance()->executeS('
+ SELECT class_name, name
+ FROM '._DB_PREFIX_.'tab t
+ INNER JOIN '._DB_PREFIX_.'tab_lang tl ON (t.id_tab = tl.id_tab AND tl.id_lang = '.(int)$this->context->language->id.')
+ WHERE active = 1');
foreach ($result as $row)
{
$tabs[strtolower($row['class_name'])] = $row['name'];
From c0a62be1c51d69e551b7e6469503d6f1d3c39cbe Mon Sep 17 00:00:00 2001
From: gRoussac
Date: Thu, 31 Jan 2013 19:06:19 +0100
Subject: [PATCH 43/68] [-] FO : Fix bug #PSCFI-6864 #PSCFV-6516 Issue with
deleted address blocking order process
---
classes/Cart.php | 2 +-
classes/Customer.php | 7 +--
themes/default/js/order-address.js | 86 ++++++++++++++----------------
3 files changed, 46 insertions(+), 49 deletions(-)
diff --git a/classes/Cart.php b/classes/Cart.php
index 792c0d490..a4a555450 100644
--- a/classes/Cart.php
+++ b/classes/Cart.php
@@ -2837,8 +2837,8 @@ class CartCore extends ObjectModel
$invoice = new Address((int)$this->id_address_invoice);
// New layout system with personalization fields
+ $formatted_addresses['delivery'] = AddressFormat::getFormattedLayoutData($delivery);
$formatted_addresses['invoice'] = AddressFormat::getFormattedLayoutData($invoice);
- $formatted_addresses['delivery'] = AddressFormat::getFormattedLayoutData($delivery);
$total_tax = $this->getOrderTotal() - $this->getOrderTotal(false);
diff --git a/classes/Customer.php b/classes/Customer.php
index 4d953a385..f8a01c5ce 100644
--- a/classes/Customer.php
+++ b/classes/Customer.php
@@ -412,16 +412,17 @@ class CustomerCore extends ObjectModel
*/
public static function customerHasAddress($id_customer, $id_address)
{
- if (!array_key_exists($id_customer, self::$_customerHasAddress))
+ $key = (int)$id_customer.'-'.(int)$id_address;
+ if (!array_key_exists($id_address, self::$_customerHasAddress))
{
- self::$_customerHasAddress[$id_customer] = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
+ self::$_customerHasAddress[$key] = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT `id_address`
FROM `'._DB_PREFIX_.'address`
WHERE `id_customer` = '.(int)$id_customer.'
AND `id_address` = '.(int)$id_address.'
AND `deleted` = 0');
}
- return self::$_customerHasAddress[$id_customer];
+ return self::$_customerHasAddress[$key];
}
public static function resetAddressCache($id_customer)
diff --git a/themes/default/js/order-address.js b/themes/default/js/order-address.js
index 02dc962bd..567bd85e0 100644
--- a/themes/default/js/order-address.js
+++ b/themes/default/js/order-address.js
@@ -35,18 +35,13 @@ function updateAddressesDisplay(first_view)
{
// update content of delivery address
updateAddressDisplay('delivery');
-
var txtInvoiceTitle = "";
-
try{
var adrs_titles = getAddressesTitles();
txtInvoiceTitle = adrs_titles.invoice;
}
catch (e)
- {
-
- }
-
+ {}
// update content of invoice address
//if addresses have to be equals...
if ($('input[type=checkbox]#addressesAreEquals:checked').length === 1 && ($('#multishipping_mode_checkbox:checked').length === 0))
@@ -68,7 +63,6 @@ function updateAddressesDisplay(first_view)
$('ul#address_invoice li.address_title').html(txtInvoiceTitle);
}
}
-
if(!first_view)
{
if (orderProcess === 'order')
@@ -82,15 +76,15 @@ function updateAddressDisplay(addressType)
if (formatedAddressFieldsValuesList.length <= 0)
return false;
- var idAddress = $('#id_address_' + addressType + '').val();
- buildAddressBlock(idAddress, addressType, $('#address_'+ addressType));
+ var idAddress = parseInt($('#id_address_' + addressType + '').val());
+ buildAddressBlock(idAddress, addressType, $('#address_' + addressType));
// change update link
var link = $('ul#address_' + addressType + ' li.address_update a').attr('href');
var expression = /id_address=\d+/;
if (link)
{
- link = link.replace(expression, 'id_address='+idAddress);
+ link = link.replace(expression, 'id_address=' + idAddress);
$('ul#address_' + addressType + ' li.address_update a').attr('href', link);
}
resizeAddressesBox();
@@ -98,41 +92,43 @@ function updateAddressDisplay(addressType)
function updateAddresses()
{
- var idAddress_delivery = $('#id_address_delivery').val();
- var idAddress_invoice = $('input[type=checkbox]#addressesAreEquals:checked').length === 1 ? idAddress_delivery : $('#id_address_invoice').val();
- $.ajax({
- type: 'POST',
- headers: { "cache-control": "no-cache" },
- url: baseUri + '?rand=' + new Date().getTime(),
- async: true,
- cache: false,
- dataType : "json",
- data: {
- processAddress: true,
- step: 2,
- ajax: 'true',
- controller: 'order',
- 'multi-shipping': $('#id_address_delivery:hidden').length,
- id_address_delivery: idAddress_delivery,
- id_address_invoice: idAddress_invoice,
- token: static_token
- },
- success: function(jsonData)
- {
- if (jsonData.hasError)
+ var idAddress_delivery = parseInt($('#id_address_delivery').val());
+ var idAddress_invoice = $('input[type=checkbox]#addressesAreEquals:checked').length === 1 ? idAddress_delivery : parseInt($('#id_address_invoice').val());
+
+ if(isNaN(idAddress_delivery) == false && isNaN(idAddress_invoice) == false)
+ $.ajax({
+ type: 'POST',
+ headers: { "cache-control": "no-cache" },
+ url: baseUri + '?rand=' + new Date().getTime(),
+ async: true,
+ cache: false,
+ dataType : "json",
+ data: {
+ processAddress: true,
+ step: 2,
+ ajax: 'true',
+ controller: 'order',
+ 'multi-shipping': $('#id_address_delivery:hidden').length,
+ id_address_delivery: idAddress_delivery,
+ id_address_invoice: idAddress_invoice,
+ token: static_token
+ },
+ success: function(jsonData)
{
- var errors = '';
- for(var error in jsonData.errors)
- //IE6 bug fix
- if(error !== 'indexOf')
- errors += jsonData.errors[error] + "\n";
- alert(errors);
+ if (jsonData.hasError)
+ {
+ var errors = '';
+ for(var error in jsonData.errors)
+ //IE6 bug fix
+ if(error !== 'indexOf')
+ errors += jsonData.errors[error] + "\n";
+ alert(errors);
+ }
+ },
+ error: function(XMLHttpRequest, textStatus, errorThrown) {
+ if (textStatus !== 'abort')
+ alert("TECHNICAL ERROR: unable to save adresses \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
}
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- if (textStatus !== 'abort')
- alert("TECHNICAL ERROR: unable to save adresses \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
- }
- });
+ });
resizeAddressesBox();
-}
+}
\ No newline at end of file
From c48457cbe08f74e07dd2d45005093b3a76a0b7fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Gaillard?=
Date: Fri, 1 Feb 2013 10:50:29 +0100
Subject: [PATCH 44/68] [-] Installer: force magic_quote_runtime to 0
---
install-dev/init.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/install-dev/init.php b/install-dev/init.php
index 592b5963a..cf0d611ab 100644
--- a/install-dev/init.php
+++ b/install-dev/init.php
@@ -67,6 +67,9 @@ require_once(_PS_INSTALL_PATH_.'classes/simplexml.php');
if (!@ini_get('date.timezone'))
@date_default_timezone_set('UTC');
+// Some hosting still have magic_quotes_runtime configured
+ini_set('magic_quotes_runtime', 0);
+
// Try to improve memory limit if it's under 32M
if (psinstall_get_memory_limit() < psinstall_get_octets('32M'))
ini_set('memory_limit', '32M');
From f5df3679e9337d512a8e7e39ed5846b32db7f995 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Gaillard?=
Date: Fri, 1 Feb 2013 16:15:55 +0100
Subject: [PATCH 45/68] [-] BO: Fix live edit links on homepage
---
js/hookLiveEdit.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/js/hookLiveEdit.js b/js/hookLiveEdit.js
index f526ea415..5fe527ce7 100644
--- a/js/hookLiveEdit.js
+++ b/js/hookLiveEdit.js
@@ -23,7 +23,7 @@ $(document).ready(function() {
$('a').each(function() {
var href = this.href;
var search = this.search;
- var hrefAdd = 'live_edit&liveToken=' + get('liveToken') + '&ad=' + get('ad') + '&id_shop=' + get('id_shop');
+ var hrefAdd = 'live_edit&liveToken=' + get('liveToken') + '&ad=' + get('ad') + '&id_shop=' + get('id_shop') + '&id_employee=' + get('id_employee');
if (href != undefined && href != '#' && href.substr(0, baseDir.length) == baseDir)
{
if (search.length == 0)
From 7f59b7254bd459d6985d9c5b55e6bf11a1c2bbe0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Gaillard?=
Date: Fri, 1 Feb 2013 16:56:30 +0100
Subject: [PATCH 46/68] // small fix
---
controllers/admin/AdminCurrenciesController.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/controllers/admin/AdminCurrenciesController.php b/controllers/admin/AdminCurrenciesController.php
index 760415fe2..3ec2ea389 100644
--- a/controllers/admin/AdminCurrenciesController.php
+++ b/controllers/admin/AdminCurrenciesController.php
@@ -71,6 +71,7 @@ class AdminCurrenciesControllerCore extends AdminController
$this->_select .= 'currency_shop.conversion_rate conversion_rate';
$this->_join .= Shop::addSqlAssociation('currency', 'a');
+ $this->_group .= 'GROUP BY id_currency';
}
public function renderList()
From 3b2be13f2e3ac7610873eb3cb1117739917aba4b Mon Sep 17 00:00:00 2001
From: Damien Metzger
Date: Fri, 1 Feb 2013 10:30:59 +0100
Subject: [PATCH 47/68] // Added a configuration variable when logged on addons
from the back end
---
controllers/admin/AdminModulesController.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php
index d1c3dfeb8..c6dc37a88 100644
--- a/controllers/admin/AdminModulesController.php
+++ b/controllers/admin/AdminModulesController.php
@@ -208,6 +208,7 @@ class AdminModulesControllerCore extends AdminController
die ('KO');
if ($result == 'OK')
{
+ Configuration::updateValue('PS_LOGGED_ON_ADDONS', 1);
$this->context->cookie->username_addons = pSQL(trim(Tools::getValue('username_addons')));
$this->context->cookie->password_addons = pSQL(trim(Tools::getValue('password_addons')));
}
From 7b6b9ceaf6eb2a348460d1ea9cb468316c32619f Mon Sep 17 00:00:00 2001
From: Damien Metzger
Date: Fri, 1 Feb 2013 17:20:40 +0100
Subject: [PATCH 48/68] [*] Installer : Automatically drop the system
compatibility check when everything's alright // Fixed 'next' button when the
page is refreshed
---
install-dev/classes/controllerHttp.php | 5 ++++-
install-dev/theme/js/welcome.js | 5 +++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/install-dev/classes/controllerHttp.php b/install-dev/classes/controllerHttp.php
index 2375356a4..fea1b6d12 100644
--- a/install-dev/classes/controllerHttp.php
+++ b/install-dev/classes/controllerHttp.php
@@ -274,7 +274,10 @@ abstract class InstallControllerHttp
*/
public function findNextStep()
{
- return (isset(self::$steps[$this->getStepOffset($this->step) + 1])) ? self::$steps[$this->getStepOffset($this->step) + 1] : false;
+ $nextStep = (isset(self::$steps[$this->getStepOffset($this->step) + 1])) ? self::$steps[$this->getStepOffset($this->step) + 1] : false;
+ if ($nextStep == 'system' && self::$instances[$nextStep]->validate())
+ $nextStep = self::$instances[$nextStep]->findNextStep();
+ return $nextStep;
}
/**
diff --git a/install-dev/theme/js/welcome.js b/install-dev/theme/js/welcome.js
index fa2a9c467..69b8fd351 100644
--- a/install-dev/theme/js/welcome.js
+++ b/install-dev/theme/js/welcome.js
@@ -22,4 +22,9 @@ $(document).ready(function()
else
$('#btNext').addClass('disabled').attr('disabled', true);
});
+
+ if ($('#set_license').prop('checked'))
+ $('#btNext').removeClass('disabled').attr('disabled', false);
+ else
+ $('#btNext').addClass('disabled').attr('disabled', true);
});
\ No newline at end of file
From 1b815134a156e0bb6001ce7783fcb26466b76c54 Mon Sep 17 00:00:00 2001
From: Damien Metzger
Date: Fri, 1 Feb 2013 17:29:02 +0100
Subject: [PATCH 49/68] // A few changes in the installation wizard
---
install-dev/langs/br/install.php | 4 ++--
install-dev/langs/de/install.php | 4 ++--
install-dev/langs/es/install.php | 4 ++--
install-dev/langs/fr/install.php | 4 ++--
install-dev/langs/it/install.php | 4 ++--
install-dev/theme/views/footer.phtml | 2 +-
install-dev/theme/views/header.phtml | 2 +-
install-dev/theme/views/welcome.phtml | 4 ++--
8 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/install-dev/langs/br/install.php b/install-dev/langs/br/install.php
index e6724e2f2..67e4d743d 100644
--- a/install-dev/langs/br/install.php
+++ b/install-dev/langs/br/install.php
@@ -127,7 +127,7 @@ return array(
'Official forum' => 'Fórum oficial',
'Support' => 'Suporte',
'Documentation' => 'Documentação',
- 'Contact us!' => 'Entre em Contato !',
+ 'Contact us' => 'Entre em Contato',
'Forum' => 'Fórum',
'Blog' => 'Blog',
'Done!' => 'Feito !',
@@ -154,7 +154,7 @@ return array(
'Choose the installer language:' => 'Escolha a língua para instalação :',
'Did you know?' => 'Você sabia ?',
'PrestaShop and its community offers over 40 different languages for free, directly accessible from your Back Office on the Localization tab.' => 'PrestaShop e sua comunidade oferece mais de 40 diferentes idiomas de graça, acessível diretamente a partir da sua Área Administrativa na aba localização.',
- 'Licenses Agreement' => 'Acordo de licenças',
+ 'License Agreements' => 'Acordo de licença',
'PrestaShop core is released under the OSL 3.0 while PrestaShop modules and themes are released under the AFL 3.0.' => 'O núcleo PrestaShop é publicado sob a OSL 3.0 enquanto os módulos e temas são publicados sob a AFL 3.0.',
'I agree to the above terms and conditions.' => 'Eu concordo com os termos e condições acima.',
'I agree to participate in improving the solution by sending anonymous information about my configuration.' => 'Eu concordo em participar na melhoria da solução enviando informações anônimas sobre a minha configuração.',
diff --git a/install-dev/langs/de/install.php b/install-dev/langs/de/install.php
index 0b1e1fbac..2c327930b 100644
--- a/install-dev/langs/de/install.php
+++ b/install-dev/langs/de/install.php
@@ -121,7 +121,7 @@
'Official forum' => 'Offizielles Forum',
'Support' => 'Support',
'Documentation' => 'Tutotrials',
- 'Contact us!' => 'Kontaktieren Sie uns! Persönlicher Support',
+ 'Contact us' => 'Kontaktieren Sie uns',
'Forum' => 'Forum',
'Blog' => 'Blog',
'Done!' => 'Erfolgreich abgeschlossen',
@@ -147,7 +147,7 @@
'If you need help, do not hesitate to check our documentation or to contact our support team: %2$s' => 'Falls Sie Hilfe benötigen, haben Sie folgende Möglichkeiten: unsere Dokumentation einsehenoder unser Support-Team zu kontaktieren: %2$s',
'Did you know?' => 'Wussten Sie schon?',
'PrestaShop and its community offers over 40 different languages for free, directly accessible from your Back Office on the Localization tab.' => 'PrestaShop und Community bietet Ihnen den kostenlosen Zugang zu über 40 verschiedenen Sprachen direkt aus Ihrem Back-office im Tabreiter "Tools"',
- 'Licenses Agreement' => 'Lizenzvertrag',
+ 'License Agreements' => 'Lizenzvertrag',
'PrestaShop core is released under the OSL 3.0 while PrestaShop modules and themes are released under the AFL 3.0.' => 'PrestaShop core is unter der Lizenz OSL 3.0 herausgegeben. PrestaShop modules und Themes werden unter der Lizenz AFL 3.0. herausgegeben',
'I agree to the above terms and conditions.' => 'Ich stimme den oben genannten Vertragsbedingungen zu.',
'I agree to participate in improving the solution by sending anonymous information about my configuration.' => 'Ich möchte Prestashop in der verbesserung von Fehlern helfen, und stimme zu, dass bei groben Fehlern meine Konfigurationsdaten an Prestashop gesandt werden',
diff --git a/install-dev/langs/es/install.php b/install-dev/langs/es/install.php
index 719039b28..380adf4b2 100644
--- a/install-dev/langs/es/install.php
+++ b/install-dev/langs/es/install.php
@@ -121,7 +121,7 @@
'Official forum' => NULL,
'Support' => NULL,
'Documentation' => NULL,
- 'Contact us!' => '¡Contacte con nosotros!',
+ 'Contact us' => 'Contacte con nosotros',
'Forum' => NULL,
'Blog' => 'El blog',
'Done!' => NULL,
@@ -147,7 +147,7 @@
'If you need help, do not hesitate to check our documentation or to contact our support team: %2$s' => NULL,
'Did you know?' => '¿Sabía que?',
'PrestaShop and its community offers over 40 different languages for free, directly accessible from your Back Office on the Localization tab.' => NULL,
- 'Licenses Agreement' => 'Contrato de Licencia',
+ 'License Agreements' => 'Contrato de Licencia',
'PrestaShop core is released under the OSL 3.0 while PrestaShop modules and themes are released under the AFL 3.0.' => NULL,
'I agree to the above terms and conditions.' => 'Estoy de acuerdo con los términos y condiciones.',
'I agree to participate in improving the solution by sending anonymous information about my configuration.' => NULL,
diff --git a/install-dev/langs/fr/install.php b/install-dev/langs/fr/install.php
index 28b0d1f40..ed884acf1 100644
--- a/install-dev/langs/fr/install.php
+++ b/install-dev/langs/fr/install.php
@@ -127,7 +127,7 @@ return array(
'Official forum' => 'Forum officiel',
'Support' => 'Support',
'Documentation' => 'Documentation',
- 'Contact us!' => 'Nous contacter !',
+ 'Contact us' => 'Nous contacter',
'Forum' => 'Forum',
'Blog' => 'Blog',
'Done!' => 'Fin !',
@@ -154,7 +154,7 @@ return array(
'Choose the installer language:' => 'Choisissez la langue pour l\'installation :',
'Did you know?' => 'Le saviez vous ?',
'PrestaShop and its community offers over 40 different languages for free, directly accessible from your Back Office on the Localization tab.' => 'PrestaShop et sa communauté vous proposent plus de 40 langues gratuites directement accessibles depuis votre administration',
- 'Licenses Agreement' => 'Contrat de licences',
+ 'License Agreements' => 'Contrats de licence',
'PrestaShop core is released under the OSL 3.0 while PrestaShop modules and themes are released under the AFL 3.0.' => 'Le cœur de PrestaShop est publié sous licence OSL 3.0 tandis que les modules et thèmes sont publiés sous licence AFL 3.0.',
'I agree to the above terms and conditions.' => 'J\'approuve les termes et conditions du contrat ci-dessus.',
'I agree to participate in improving the solution by sending anonymous information about my configuration.' => 'J\'accepte de participer à l\'amélioration de la solution en envoyant des informations anonymes sur ma configuration',
diff --git a/install-dev/langs/it/install.php b/install-dev/langs/it/install.php
index 994f45997..ffbe19ea9 100644
--- a/install-dev/langs/it/install.php
+++ b/install-dev/langs/it/install.php
@@ -121,7 +121,7 @@
'Official forum' => 'Forum ufficiale',
'Support' => 'Supporto',
'Documentation' => 'Documentazione',
- 'Contact us!' => 'Contattaci!',
+ 'Contact us' => 'Contattaci',
'Forum' => 'Forum',
'Blog' => 'Il blog',
'Done!' => 'Fatto!',
@@ -147,7 +147,7 @@
'If you need help, do not hesitate to check our documentation or to contact our support team: %2$s' => 'Se hai bisogno di aiuto non asitare a guardare our documentation o contattare il nostro supporto: %2$s',
'Did you know?' => 'Lo sapevi?',
'PrestaShop and its community offers over 40 different languages for free, directly accessible from your Back Office on the Localization tab.' => 'PrestaShop e la sua comunità offre 40 diverse lingue gratuite, direttamente accessibile nel tuo back office nel tab Traduzioni',
- 'Licenses Agreement' => 'Contratto di Licenza',
+ 'License Agreements' => 'Contratto di Licenza',
'PrestaShop core is released under the OSL 3.0 while PrestaShop modules and themes are released under the AFL 3.0.' => 'Il core di PrestaShop è rilasicata sollo licenza OSL 3.0 mentre i moduli e i temi prestashop sono rilasciati sotto licenza AFL 3.0',
'I agree to the above terms and conditions.' => 'Accetto i termini e le condizioni del contratto seguente.',
'I agree to participate in improving the solution by sending anonymous information about my configuration.' => 'Accetto di partecipare nell\'implementare la soluzione inviando informazioni anonime sulla mia configurazione',
diff --git a/install-dev/theme/views/footer.phtml b/install-dev/theme/views/footer.phtml
index 4107ab37a..f07434609 100644
--- a/install-dev/theme/views/footer.phtml
+++ b/install-dev/theme/views/footer.phtml
@@ -25,7 +25,7 @@