From 502b149d3283f9dc9ff84e3f529d0485e75845da Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 20 Jan 2014 17:04:16 +0100 Subject: [PATCH 1/5] change good content id for category associated content --- core/lib/Thelia/Core/Template/Loop/AssociatedContent.php | 1 + templates/backOffice/default/category-edit.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php b/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php index 487665fc3..3cfedd5d3 100755 --- a/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php +++ b/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php @@ -166,6 +166,7 @@ class AssociatedContent extends Content ->set("ID" , $this->contentId[$relatedContentId]) ->set("CONTENT_ID", $relatedContentId) ->set("POSITION" , $this->contentPosition[$relatedContentId]) + ; } diff --git a/templates/backOffice/default/category-edit.html b/templates/backOffice/default/category-edit.html index 131853820..1885d8201 100755 --- a/templates/backOffice/default/category-edit.html +++ b/templates/backOffice/default/category-edit.html @@ -228,7 +228,7 @@
{loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.category" access="UPDATE"} - + {/loop} From 87bc1a83aa9dd379608aa7696453b6e3f55c19e3 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 20 Jan 2014 17:09:52 +0100 Subject: [PATCH 2/5] change content if on product associated content --- templates/backOffice/default/ajax/product-related-tab.html | 2 +- templates/backOffice/default/product-edit.html | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/backOffice/default/ajax/product-related-tab.html b/templates/backOffice/default/ajax/product-related-tab.html index bc6c38056..3e9474007 100755 --- a/templates/backOffice/default/ajax/product-related-tab.html +++ b/templates/backOffice/default/ajax/product-related-tab.html @@ -105,7 +105,7 @@
{loop type="auth" name="can_create" role="ADMIN" resources="admin.product" access="UPDATE"} - + {/loop} diff --git a/templates/backOffice/default/product-edit.html b/templates/backOffice/default/product-edit.html index 3212d3d65..36eff1a6e 100755 --- a/templates/backOffice/default/product-edit.html +++ b/templates/backOffice/default/product-edit.html @@ -154,7 +154,9 @@ $(function() { $('.nav-tabs a[data-href]').on('shown.bs.tab', function(ev) { var $this = $(this); $($this.attr('href')).load($this.data('href'), function(ev) { - eval($this.data('callback') + '();'); + if($this.data('callback')) { + eval($this.data('callback') + '();'); + } }); }); From 91cf069313e6b5c05e436e3d07f8c530aa6a442d Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 21 Jan 2014 09:43:55 +0100 Subject: [PATCH 3/5] fix associations tab in product modification page --- core/lib/Thelia/Core/Template/Loop/Accessory.php | 3 ++- templates/backOffice/default/ajax/product-related-tab.html | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/lib/Thelia/Core/Template/Loop/Accessory.php b/core/lib/Thelia/Core/Template/Loop/Accessory.php index 8a7a80e27..de08f1f5b 100755 --- a/core/lib/Thelia/Core/Template/Loop/Accessory.php +++ b/core/lib/Thelia/Core/Template/Loop/Accessory.php @@ -123,10 +123,11 @@ class Accessory extends Product foreach ($results as $loopResultRow) { $accessoryProductId = $loopResultRow->get('ID'); - + \Thelia\Log\Tlog::getInstance()->notice($this->accessoryId); $loopResultRow ->set("ID" , $this->accessoryId[$accessoryProductId]) ->set("POSITION", $this->accessoryPosition[$accessoryProductId]) + ->set("ACCESSORY_ID", $accessoryProductId) ; } diff --git a/templates/backOffice/default/ajax/product-related-tab.html b/templates/backOffice/default/ajax/product-related-tab.html index 3e9474007..edaa101a9 100755 --- a/templates/backOffice/default/ajax/product-related-tab.html +++ b/templates/backOffice/default/ajax/product-related-tab.html @@ -226,7 +226,7 @@
{loop type="auth" name="can_create" role="ADMIN" resources="admin.product" access="UPDATE"} - + {/loop} @@ -523,7 +523,7 @@ $(function() { $('.accessoryPositionChange').editable({ type : 'text', - title : '{intl l="Enter new accessory position"}', + title : "{intl l="Enter new accessory position"}", mode : 'popup', inputclass : 'input-mini', placement : 'left', @@ -541,7 +541,7 @@ $(function() { $('.contentPositionChange').editable({ type : 'text', - title : '{intl l="Enter new content position"}', + title : "{intl l="Enter new content position"}", mode : 'popup', inputclass : 'input-mini', placement : 'left', From d573ff54c269f34579eaf9bf12d5eedf6977a047 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 21 Jan 2014 10:11:29 +0100 Subject: [PATCH 4/5] put correct error messages in Document loop --- core/lib/Thelia/Action/BaseCachedFile.php | 2 +- core/lib/Thelia/Core/Template/Loop/Document.php | 2 +- web/install/I18n/en_US.php | 0 3 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 web/install/I18n/en_US.php diff --git a/core/lib/Thelia/Action/BaseCachedFile.php b/core/lib/Thelia/Action/BaseCachedFile.php index caa7c8ada..63f99dc1f 100644 --- a/core/lib/Thelia/Action/BaseCachedFile.php +++ b/core/lib/Thelia/Action/BaseCachedFile.php @@ -159,7 +159,7 @@ abstract class BaseCachedFile extends BaseAction // Create directory (recursively) if it does not exists. if ($create_if_not_exists && !is_dir($path)) { if (!@mkdir($path, 0777, true)) { - throw new \RuntimeException(sprintf("Failed to create %s/%s file in cache directory", $cache_base)); + throw new \RuntimeException(sprintf("Failed to create %s file in cache directory", $path)); } } diff --git a/core/lib/Thelia/Core/Template/Loop/Document.php b/core/lib/Thelia/Core/Template/Loop/Document.php index ff57c62c7..b92318482 100644 --- a/core/lib/Thelia/Core/Template/Loop/Document.php +++ b/core/lib/Thelia/Core/Template/Loop/Document.php @@ -267,7 +267,7 @@ class Document extends BaseI18nLoop implements PropelSearchLoopInterface $loopResult->addRow($loopResultRow); } catch (\Exception $ex) { // Ignore the result and log an error - Tlog::getInstance()->addError("Failed to process document in document loop: ", $this->args); + Tlog::getInstance()->addError(sprintf("Failed to process document in document loop: %s", $ex->getMessage()), $this->args); } } diff --git a/web/install/I18n/en_US.php b/web/install/I18n/en_US.php old mode 100644 new mode 100755 From ce0fbb11a1bc57565536e09ed345b2019b1168cf Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 21 Jan 2014 12:25:57 +0100 Subject: [PATCH 5/5] add missing close block --- templates/backOffice/default/folder-edit.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/backOffice/default/folder-edit.html b/templates/backOffice/default/folder-edit.html index 31d1c19f7..e86790634 100755 --- a/templates/backOffice/default/folder-edit.html +++ b/templates/backOffice/default/folder-edit.html @@ -152,7 +152,7 @@
- +{/block} {block name="javascript-initialization"} {javascripts file='assets/js/dropzone.js'}