From a552eead99ab172dc044ab198f4ed246df950116 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 21 Feb 2014 10:13:38 +0100 Subject: [PATCH 01/24] fix loop cache system. type argument is now a default argument. Fix #234 --- core/lib/Thelia/Core/Template/Element/BaseLoop.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index de851cc8c..ad92cefbe 100644 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -95,6 +95,7 @@ abstract class BaseLoop $defaultArgs = array( Argument::createBooleanTypeArgument('backend_context', false), Argument::createBooleanTypeArgument('force_return', false), + Argument::createAnyTypeArgument('type', null, true), ); if (true === $this->countable) { From adcbc13ada035d2440707127e8e1587b1f24eadf Mon Sep 17 00:00:00 2001 From: Guillaume Barral Date: Thu, 19 Jun 2014 15:13:02 +0200 Subject: [PATCH 02/24] Add a default version to all order in Thelia for the 2.0.3 update --- setup/update/2.0.3.sql | 54 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/setup/update/2.0.3.sql b/setup/update/2.0.3.sql index 7c94478b1..428d383d9 100644 --- a/setup/update/2.0.3.sql +++ b/setup/update/2.0.3.sql @@ -45,4 +45,58 @@ CREATE TABLE `order_version` ON DELETE CASCADE ) ENGINE=InnoDB CHARACTER SET='utf8'; +UPDATE `order` SET + `version` = 1, + `version_created_at` = NOW(), + `version_created_by` = 'Thelia' +WHERE `version` = 0; + +INSERT INTO `order_version`( + `id`, + `ref`, + `customer_id`, + `invoice_order_address_id`, + `delivery_order_address_id`, + `invoice_date`, + `currency_id`, + `currency_rate`, + `transaction_ref`, + `delivery_ref`, + `invoice_ref`, + `discount`, + `postage`, + `payment_module_id`, + `delivery_module_id`, + `status_id`, + `lang_id`, + `created_at`, + `updated_at`, + `version`, + `version_created_at`, + `version_created_by`) +SELECT + `id`, + `ref`, + `customer_id`, + `invoice_order_address_id`, + `delivery_order_address_id`, + `invoice_date`, + `currency_id`, + `currency_rate`, + `transaction_ref`, + `delivery_ref`, + `invoice_ref`, + `discount`, + `postage`, + `payment_module_id`, + `delivery_module_id`, + `status_id`, + `lang_id`, + `created_at`, + `updated_at`, + `version`, + `version_created_at`, + `version_created_by` +FROM `order`; + SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file From 15e2ff5fc30d8ae293a346dd40438d7efa4706d9 Mon Sep 17 00:00:00 2001 From: Guillaume Barral Date: Thu, 19 Jun 2014 15:22:06 +0200 Subject: [PATCH 03/24] Automatic creation of all orders in order_version during the 2.0.3 update --- setup/update/2.0.3.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/update/2.0.3.sql b/setup/update/2.0.3.sql index 428d383d9..54b45f4f6 100644 --- a/setup/update/2.0.3.sql +++ b/setup/update/2.0.3.sql @@ -97,6 +97,6 @@ SELECT `version`, `version_created_at`, `version_created_by` -FROM `order`; +FROM `order`; SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file From 2a6d99e36bd04fa40e563743a6292be3200309f1 Mon Sep 17 00:00:00 2001 From: Guillaume Barral Date: Thu, 19 Jun 2014 15:24:14 +0200 Subject: [PATCH 04/24] Automatic versionning of all existing orders during the update 2.0.3 --- setup/update/2.0.3.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/update/2.0.3.sql b/setup/update/2.0.3.sql index 54b45f4f6..428d383d9 100644 --- a/setup/update/2.0.3.sql +++ b/setup/update/2.0.3.sql @@ -97,6 +97,6 @@ SELECT `version`, `version_created_at`, `version_created_by` -FROM `order`; +FROM `order`; SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file From 3d311825d1bfa16d5bc4feb9639df30a7e0e8109 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 20 Jun 2014 09:09:06 +0200 Subject: [PATCH 05/24] integrate web test case --- composer.json | 3 +- composer.lock | 114 +++++++++++++++++++++++++- core/lib/Thelia/Tests/WebTestCase.php | 59 +++++++++++++ core/lib/Thelia/Tests/bootstrap.php | 1 + 4 files changed, 175 insertions(+), 2 deletions(-) create mode 100644 core/lib/Thelia/Tests/WebTestCase.php diff --git a/composer.json b/composer.json index c4a2b665f..28c6bd0e2 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,8 @@ "swiftmailer/swiftmailer": "5.0.*", "symfony/serializer": "2.3.*", "ensepar/html2pdf": "1.0.1", - "symfony/finder": "~2.2" + "symfony/finder": "~2.2", + "symfony/browser-kit": "2.3.*" }, "require-dev": { "phpunit/phpunit": "4.1.*", diff --git a/composer.lock b/composer.lock index 30991c403..55fdf2088 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "73a6895063dd76bcb25eb14ef329e745", + "hash": "e6d2af4c5536d0187aa2515baa3c62ab", "packages": [ { "name": "doctrine/cache", @@ -704,6 +704,63 @@ ], "time": "2013-03-25 15:02:40" }, + { + "name": "symfony/browser-kit", + "version": "v2.3.13", + "target-dir": "Symfony/Component/BrowserKit", + "source": { + "type": "git", + "url": "https://github.com/symfony/BrowserKit.git", + "reference": "97563874c24b65ea8d31b82fe051a161caf83e10" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/97563874c24b65ea8d31b82fe051a161caf83e10", + "reference": "97563874c24b65ea8d31b82fe051a161caf83e10", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/dom-crawler": "~2.0" + }, + "require-dev": { + "symfony/css-selector": "~2.0", + "symfony/process": "~2.0" + }, + "suggest": { + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\BrowserKit\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony BrowserKit Component", + "homepage": "http://symfony.com", + "time": "2014-04-18 20:35:25" + }, { "name": "symfony/class-loader", "version": "v2.2.6", @@ -903,6 +960,61 @@ "homepage": "http://symfony.com", "time": "2013-07-21 09:38:59" }, + { + "name": "symfony/dom-crawler", + "version": "v2.4.4", + "target-dir": "Symfony/Component/DomCrawler", + "source": { + "type": "git", + "url": "https://github.com/symfony/DomCrawler.git", + "reference": "e94b29c7cac964e58c406408d238ceeaa3604e78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/e94b29c7cac964e58c406408d238ceeaa3604e78", + "reference": "e94b29c7cac964e58c406408d238ceeaa3604e78", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/css-selector": "~2.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\DomCrawler\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "http://symfony.com", + "time": "2014-04-18 20:37:09" + }, { "name": "symfony/event-dispatcher", "version": "v2.2.6", diff --git a/core/lib/Thelia/Tests/WebTestCase.php b/core/lib/Thelia/Tests/WebTestCase.php new file mode 100644 index 000000000..2976b6dfa --- /dev/null +++ b/core/lib/Thelia/Tests/WebTestCase.php @@ -0,0 +1,59 @@ + + */ +class WebTestCase extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Thelia\Core\Thelia + */ + protected static $kernel; + + /** + * @param array $options + * @param array $server + * @return \Symfony\Component\HttpKernel\Client + */ + protected static function createClient(array $options = [], array $server = []) + { + if (null !== static::$kernel) { + static::$kernel->shutdown(); + } + + static::$kernel = new Thelia('test', true); + static::$kernel->boot(); + + $client = static::$kernel->getContainer()->get('test.client'); + $client->setServerParameters($server); + + return $client; + } + + /** + * Shuts the kernel down if it was used in the test. + */ + protected function tearDown() + { + if (null !== static::$kernel) { + static::$kernel->shutdown(); + } + } +} \ No newline at end of file diff --git a/core/lib/Thelia/Tests/bootstrap.php b/core/lib/Thelia/Tests/bootstrap.php index 86f6d8355..c4733ca1d 100755 --- a/core/lib/Thelia/Tests/bootstrap.php +++ b/core/lib/Thelia/Tests/bootstrap.php @@ -5,6 +5,7 @@ * @file * Functions needed for Thelia bootstrap */ +ini_set('session.use_cookies', 0); $env = "test"; require_once __DIR__ . '/../../../bootstrap.php'; From 51313ea430871bcabcad22700fa22304b6699074 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 20 Jun 2014 09:11:09 +0200 Subject: [PATCH 06/24] import test config --- core/lib/Thelia/Config/Resources/test.xml | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 core/lib/Thelia/Config/Resources/test.xml diff --git a/core/lib/Thelia/Config/Resources/test.xml b/core/lib/Thelia/Config/Resources/test.xml new file mode 100644 index 000000000..b1190195e --- /dev/null +++ b/core/lib/Thelia/Config/Resources/test.xml @@ -0,0 +1,28 @@ + + + + + + Thelia\Core\HttpKernel\Client + + Symfony\Component\BrowserKit\History + Symfony\Component\BrowserKit\CookieJar + + + + + + %test.client.parameters% + + + + + + + + + + + From 3d238902acede5e5e0e4bab7f5594a5f67147f41 Mon Sep 17 00:00:00 2001 From: Benjamin Perche Date: Fri, 20 Jun 2014 14:32:54 +0200 Subject: [PATCH 07/24] =?UTF-8?q?Complete=20AddressTest,=20highlight=20bug?= =?UTF-8?q?=20=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20core/lib/Thelia/T?= =?UTF-8?q?ests/Action/AddressTest.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/lib/Thelia/Tests/Action/AddressTest.php | 70 ++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/core/lib/Thelia/Tests/Action/AddressTest.php b/core/lib/Thelia/Tests/Action/AddressTest.php index 91101544c..7677e66d8 100644 --- a/core/lib/Thelia/Tests/Action/AddressTest.php +++ b/core/lib/Thelia/Tests/Action/AddressTest.php @@ -12,8 +12,11 @@ namespace Thelia\Tests\Action; +use Propel\Runtime\Propel; use Thelia\Action\Address; use Thelia\Core\Event\Address\AddressCreateOrUpdateEvent; +use Thelia\Core\Event\TheliaEvents; +use Thelia\Model\AddressQuery; use Thelia\Model\CustomerQuery; /** @@ -121,4 +124,71 @@ class AddressTest extends \PHPUnit_Framework_TestCase } + /** + * Bug found in Thelia 2.0.2 + */ + public function testUpdateDefaultAddress() + { + /** + * Disable propel cache in order to get a new instance of the + * active record in $updatedAddress + */ + Propel::disableInstancePooling(); + + /** + * Get a customer and it's default address + */ + $customer = CustomerQuery::create()->findOne(); + $defaultAddress = $customer->getDefaultAddress(); + $addressId = $defaultAddress->getId(); + + /** + * Try to update the address, and set the isDefault argument, + * that should keep this address as the default one. + */ + $addressEvent = new AddressCreateOrUpdateEvent( + "", + 1, + "Thelia modif", + "Thelia modif", + "cour des étoiles", + "rue des miracles", + "", + "63000", + "clermont-ferrand", + 64, + "0102030405", + "", + "", + 1 + ); + + $addressEvent->setAddress($defaultAddress); + $addressEvent->setDispatcher( + $this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface") + ); + + /** + * Do the update + */ + $actionAddress = new Address(); + $actionAddress->update($addressEvent); + + $updatedAddress = AddressQuery::create() + ->findPk($addressId); + + /** + * This address should still be the default address + */ + $this->assertEquals( + 1, + $updatedAddress->getIsDefault() + ); + + /** + * Renable it after + */ + Propel::enableInstancePooling(); + } + } From 45adf78faf53b532a2595ded8aedb73018688222 Mon Sep 17 00:00:00 2001 From: Benjamin Perche Date: Fri, 20 Jun 2014 14:33:52 +0200 Subject: [PATCH 08/24] =?UTF-8?q?Correct=20bug=20with=20default=20addresse?= =?UTF-8?q?s=20=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20core/lib/Thelia/?= =?UTF-8?q?Action/Address.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/lib/Thelia/Action/Address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/Thelia/Action/Address.php b/core/lib/Thelia/Action/Address.php index e6e9b9f65..17ae95cc8 100644 --- a/core/lib/Thelia/Action/Address.php +++ b/core/lib/Thelia/Action/Address.php @@ -79,7 +79,7 @@ class Address extends BaseAction implements EventSubscriberInterface ->save() ; - if ($event->getIsDefault()) { + if ($event->getIsDefault() && !$addressModel->getIsDefault()) { $addressModel->makeItDefault(); } From 2f81e6953bc4af222f3f0a0a932ad4bd6a26208e Mon Sep 17 00:00:00 2001 From: jodeq Date: Fri, 20 Jun 2014 23:12:32 +0200 Subject: [PATCH 09/24] Update prices.json --- local/modules/Colissimo/Config/prices.json | 156 ++++++++++----------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/local/modules/Colissimo/Config/prices.json b/local/modules/Colissimo/Config/prices.json index 1b23c825c..f1e040600 100755 --- a/local/modules/Colissimo/Config/prices.json +++ b/local/modules/Colissimo/Config/prices.json @@ -1,17 +1,17 @@ {"1": { "_info": "area 1 : France", "slices": { - "0.25": "5.23", - "0.5": 5.8, - "0.75": 6.56, - "1": 7.13, - "2": 8.08, - "3": 9.22, - "5": 11.31, - "7": 13.4, - "10": 16.53, - "15": 19.14, - "30": 26.93 + "0.25": 5.23, + "0.5": 5.99, + "0.75": 6.75, + "1": 7.36, + "2": 8.36, + "3": 9.55, + "5": 11.73, + "7": 13.92, + "10": 17.15, + "15": 19.81, + "30": 27.79 } }, "2": { "_info": "area 2 : A Zone - Union Europ\u00e9enne et Suisse", @@ -34,87 +34,87 @@ }, "3": { "_info": "area 3 : B Zone - Pays de l\u2019Europe de l\u2019Est (hors Union Europ\u00e9enne), Norv\u00e8ge, Maghreb", "slices": { - "1": 18.81, - "2": 20.62, - "3": 24.94, - "4": 29.26, - "5": 33.58, - "6": 37.91, - "7": 42.23, - "8": 46.55, - "9": 50.87, - "10": 55.2, - "15": 65.08, - "20": 74.96 + "1": 19.38, + "2": 22.23, + "3": 26.46, + "4": 30.69, + "5": 34.96, + "6": 39.24, + "7": 43.51, + "8": 47.79, + "9": 52.06, + "10": 56.34, + "15": 66.79, + "20": 77.24 } }, "4": { "_info": "area 4 : C Zone - Pays d\u2019Afrique hors Maghreb, Canada, Etats-Unis, Proche et Moyen Orient", "slices": { - "1": 22.04, - "2": 29.55, - "3": 38.86, - "4": 48.17, - "5": 57.48, - "6": 66.79, - "7": 76.1, - "8": 85.41, - "9": 94.72, - "10": 104.03, - "15": 126.92, - "20": 149.82 + "1": 23.66, + "2": 31.26, + "3": 40.47, + "4": 49.69, + "5": 58.90, + "6": 68.12, + "7": 77.33, + "8": 86.55, + "9": 95.76, + "10": 104.98, + "15": 129.87, + "20": 154.76 } }, "5": { "_info": "area 5 : D Zone - Autres destinations", "slices": { - "1": 25.08, - "2": 37.72, - "3": 50.26, - "4": 62.8, - "5": 75.34, - "6": 87.88, - "7": 100.42, - "8": 112.96, - "9": 125.5, - "10": 138.04, - "15": 162.74, - "20": 187.44 + "1": 26.27, + "2": 38.81, + "3": 51.35, + "4": 63.89, + "5": 76.43, + "6": 88.97, + "7": 101.51, + "8": 114.05, + "9": 126.59, + "10": 139.13, + "15": 163.83, + "20": 188.53 } }, "6": { "_info": "area 6 : France OM1", "slices": { - "0.5": 8.27, - "1": 12.49, - "2": 17.05, - "3": 21.61, - "4": 26.17, - "5": 30.73, - "6": 35.29, - "7": 39.85, - "8": 44.41, - "9": 48.97, - "10": 53.53, - "15": 76.33, - "20": 99.13, - "25": 121.93, - "30": 144.73 + "0.5": 8.5, + "1": 12.87, + "2": 17.58, + "3": 22.28, + "4": 26.98, + "5": 31.68, + "6": 36.39, + "7": 41.09, + "8": 45.79, + "9": 50.49, + "10": 55.2, + "15": 78.95, + "20": 102.7, + "25": 126.45, + "30": 150.2 } }, "7": { "_info": "area 7 : France OM2", "slices": { - "0.5": 9.88, - "1": 14.92, - "2": 26.32, - "3": 37.72, - "4": 49.12, - "5": 60.52, - "6": 71.92, - "7": 83.32, - "8": 94.72, - "9": 106.12, - "10": 117.52, - "15": 174.52, - "20": 231.52, - "25": 288.52, - "30": 345.52 + "0.5": 10.17, + "1": 15.39, + "2": 27.12, + "3": 38.86, + "4": 50.59, + "5": 62.32, + "6": 74.05, + "7": 85.79, + "8": 97.52, + "9": 109.25, + "10": 120.98, + "15": 179.69, + "20": 238.4, + "25": 297.11, + "30": 355.82 } -}} \ No newline at end of file +}} From cfa946247494e261a08590a7dd8f0856e227400a Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Sat, 21 Jun 2014 13:15:41 +0200 Subject: [PATCH 10/24] add missing class. Fix #493 --- core/lib/Thelia/Core/HttpKernel/Client.php | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 core/lib/Thelia/Core/HttpKernel/Client.php diff --git a/core/lib/Thelia/Core/HttpKernel/Client.php b/core/lib/Thelia/Core/HttpKernel/Client.php new file mode 100644 index 000000000..fca5066d5 --- /dev/null +++ b/core/lib/Thelia/Core/HttpKernel/Client.php @@ -0,0 +1,43 @@ + + */ +class Client extends BaseClient +{ + + /** + * Converts the BrowserKit request to a HttpKernel request. + * + * @param DomRequest $request A Request instance + * + * @return Request A Request instance + */ + protected function filterRequest(DomRequest $request) + { + $httpRequest = Request::create($request->getUri(), $request->getMethod(), $request->getParameters(), $request->getCookies(), $request->getFiles(), $request->getServer(), $request->getContent()); + + $httpRequest->files->replace($this->filterFiles($httpRequest->files->all())); + + return $httpRequest; + } + +} From b5c06068142dfd699ea6b6def1dfde5b6d8c9c4a Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 24 Jun 2014 10:11:50 +0200 Subject: [PATCH 11/24] update swiftmailer version. --- composer.json | 2 +- composer.lock | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 28c6bd0e2..8788db05d 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "simplepie/simplepie": "dev-master", "imagine/imagine": "0.*", "symfony/icu": "1.0", - "swiftmailer/swiftmailer": "5.0.*", + "swiftmailer/swiftmailer": "5.2.*", "symfony/serializer": "2.3.*", "ensepar/html2pdf": "1.0.1", "symfony/finder": "~2.2", diff --git a/composer.lock b/composer.lock index 55fdf2088..2f1e713a0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "e6d2af4c5536d0187aa2515baa3c62ab", + "hash": "4606e1d72b13b6b8fa84dca5f7bac16b", "packages": [ { "name": "doctrine/cache", @@ -608,25 +608,28 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v5.0.2", + "version": "v5.2.1", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "f3917ecef35a4e4d98b303eb9fee463bc983f379" + "reference": "2b9af56cc676c338d52fca4c657e5bdff73bb7af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/f3917ecef35a4e4d98b303eb9fee463bc983f379", - "reference": "f3917ecef35a4e4d98b303eb9fee463bc983f379", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/2b9af56cc676c338d52fca4c657e5bdff73bb7af", + "reference": "2b9af56cc676c338d52fca4c657e5bdff73bb7af", "shasum": "" }, "require": { "php": ">=5.2.4" }, + "require-dev": { + "mockery/mockery": "~0.9.1" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "autoload": { @@ -641,7 +644,9 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { "name": "Chris Corbyn" @@ -653,7 +658,7 @@ "mail", "mailer" ], - "time": "2013-08-30 12:35:21" + "time": "2014-06-13 11:44:54" }, { "name": "symfony-cmf/routing", From 5beefc5857dc572c7d8e09c4135de0d4ebe870c9 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 24 Jun 2014 10:27:39 +0200 Subject: [PATCH 12/24] add missing use --- core/lib/Thelia/Coupon/Type/PercentageCouponTrait.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/lib/Thelia/Coupon/Type/PercentageCouponTrait.php b/core/lib/Thelia/Coupon/Type/PercentageCouponTrait.php index caa446cd7..957114ffb 100644 --- a/core/lib/Thelia/Coupon/Type/PercentageCouponTrait.php +++ b/core/lib/Thelia/Coupon/Type/PercentageCouponTrait.php @@ -11,6 +11,7 @@ /*************************************************************************************/ namespace Thelia\Coupon\Type; +use Thelia\Core\Translation\Translator; /** * A trait to manage a coupon which removes a percentage of cart items from the order total. From a00a23e49561c64150a0b107e85b1a97908d819a Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 24 Jun 2014 10:29:17 +0200 Subject: [PATCH 13/24] remove unused use statement --- core/lib/Thelia/Controller/Admin/CouponController.php | 1 - core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php | 1 - 2 files changed, 2 deletions(-) diff --git a/core/lib/Thelia/Controller/Admin/CouponController.php b/core/lib/Thelia/Controller/Admin/CouponController.php index 06f81aaaa..370b504c1 100644 --- a/core/lib/Thelia/Controller/Admin/CouponController.php +++ b/core/lib/Thelia/Controller/Admin/CouponController.php @@ -14,7 +14,6 @@ namespace Thelia\Controller\Admin; use Symfony\Component\Form\Form; use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Router; use Thelia\Condition\ConditionFactory; diff --git a/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php index ae2312aae..9b3a979da 100644 --- a/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php @@ -14,7 +14,6 @@ namespace Thelia\Core\Event\Coupon; use Thelia\Core\Event\ActionEvent; use Thelia\Condition\ConditionCollection; use Thelia\Model\Coupon; -use Thelia\Model\Exception\InvalidArgumentException; /** * Occurring when a Coupon is created or updated From 77a4c45aa4927e45a6d20bd3afe1e4ed5fb848c4 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 24 Jun 2014 10:30:46 +0200 Subject: [PATCH 14/24] remove commented code --- .../lib/Thelia/Controller/Admin/TranslationsController.php | 7 ------- core/lib/Thelia/Coupon/Type/FreeProduct.php | 4 ---- 2 files changed, 11 deletions(-) diff --git a/core/lib/Thelia/Controller/Admin/TranslationsController.php b/core/lib/Thelia/Controller/Admin/TranslationsController.php index 93aab31cb..6c2aed749 100644 --- a/core/lib/Thelia/Controller/Admin/TranslationsController.php +++ b/core/lib/Thelia/Controller/Admin/TranslationsController.php @@ -181,13 +181,6 @@ class TranslationsController extends BaseAdminController case 'ma' : $template = new TemplateDefinition($item_name, TemplateDefinition::EMAIL); break; - - default: - /* - throw new \InvalidArgumentException( - $this->getTranslator()->trans("Undefined translation type: %item", ['%item' => $item_to_translate]) - ); - */ } if ($template) { diff --git a/core/lib/Thelia/Coupon/Type/FreeProduct.php b/core/lib/Thelia/Coupon/Type/FreeProduct.php index 5fe65b1b0..42a106f4e 100644 --- a/core/lib/Thelia/Coupon/Type/FreeProduct.php +++ b/core/lib/Thelia/Coupon/Type/FreeProduct.php @@ -230,10 +230,6 @@ class FreeProduct extends AbstractRemoveOnProducts $this->setRelatedCartItem($eligibleProduct, $cartEvent->getCartItem()->getId()); $freeProductCartItem = $cartEvent->getCartItem(); - - // Setting product price is dangerous, as the customer could change the ordered quantity of this product. - // We will instead add the product price to the order discount. - // $cartEvent->getCartItem()->setPrice(0)->save(); } } From 84c2432507c9eeed42d026c35fcd75662b187d03 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 24 Jun 2014 10:38:43 +0200 Subject: [PATCH 15/24] remove unused variable --- core/lib/Thelia/Config/Resources/routing/admin.xml | 2 +- .../lib/Thelia/Controller/Admin/CustomerExportController.php | 2 +- core/lib/Thelia/Core/Template/Loop/Category.php | 3 --- core/lib/Thelia/Core/Template/Loop/Coupon.php | 3 --- core/lib/Thelia/Core/Template/Loop/Folder.php | 3 --- core/lib/Thelia/Coupon/Type/FreeProduct.php | 3 --- core/lib/Thelia/Tools/FileManager.php | 5 +++-- 7 files changed, 5 insertions(+), 16 deletions(-) diff --git a/core/lib/Thelia/Config/Resources/routing/admin.xml b/core/lib/Thelia/Config/Resources/routing/admin.xml index b438c10e0..6b5622ff8 100644 --- a/core/lib/Thelia/Config/Resources/routing/admin.xml +++ b/core/lib/Thelia/Config/Resources/routing/admin.xml @@ -1165,7 +1165,7 @@ - Thelia\Controller\Admin\CustomerExportController::NewsletterExportAction + Thelia\Controller\Admin\CustomerExportController::newsletterExportAction diff --git a/core/lib/Thelia/Controller/Admin/CustomerExportController.php b/core/lib/Thelia/Controller/Admin/CustomerExportController.php index 5e9900dba..0036f2d53 100644 --- a/core/lib/Thelia/Controller/Admin/CustomerExportController.php +++ b/core/lib/Thelia/Controller/Admin/CustomerExportController.php @@ -25,7 +25,7 @@ use Thelia\Model\NewsletterQuery; class CustomerExportController extends BaseAdminController { - public function NewsletterExportAction() + public function newsletterExportAction() { if (null !== $response = $this->checkAuth([AdminResources::EXPORT_CUSTOMER_NEWSLETTER], [], [AccessManager::VIEW])) { return $response; diff --git a/core/lib/Thelia/Core/Template/Loop/Category.php b/core/lib/Thelia/Core/Template/Loop/Category.php index 90b54e3fd..9ecee9182 100644 --- a/core/lib/Thelia/Core/Template/Loop/Category.php +++ b/core/lib/Thelia/Core/Template/Loop/Category.php @@ -190,9 +190,6 @@ class Category extends BaseI18nLoop implements PropelSearchLoopInterface, Search } } - /* @todo */ - $notEmpty = $this->getNot_empty(); - return $search; } diff --git a/core/lib/Thelia/Core/Template/Loop/Coupon.php b/core/lib/Thelia/Core/Template/Loop/Coupon.php index c46739aa9..310a760e2 100644 --- a/core/lib/Thelia/Core/Template/Loop/Coupon.php +++ b/core/lib/Thelia/Core/Template/Loop/Coupon.php @@ -152,9 +152,6 @@ class Coupon extends BaseI18nLoop implements PropelSearchLoopInterface /** @var ConditionFactory $conditionFactory */ $conditionFactory = $this->container->get('thelia.condition.factory'); - /** @var Request $request */ - $request = $this->container->get('request'); - /** @var MCoupon $coupon */ foreach ($loopResult->getResultDataCollection() as $coupon) { diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index 618c411e3..ee4e0cbbe 100644 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -157,9 +157,6 @@ class Folder extends BaseI18nLoop implements PropelSearchLoopInterface, SearchLo } } - /* @todo */ - $notEmpty = $this->getNot_empty(); - return $search; } diff --git a/core/lib/Thelia/Coupon/Type/FreeProduct.php b/core/lib/Thelia/Coupon/Type/FreeProduct.php index 42a106f4e..3032813a8 100644 --- a/core/lib/Thelia/Coupon/Type/FreeProduct.php +++ b/core/lib/Thelia/Coupon/Type/FreeProduct.php @@ -234,9 +234,6 @@ class FreeProduct extends AbstractRemoveOnProducts } if ($freeProductCartItem instanceof CartItem) { - - $taxCountry = $this->facade->getDeliveryCountry(); - // The discount is the product price. $discount = $freeProductCartItem->getPromo() ? $freeProductCartItem->getPromoPrice() : $freeProductCartItem->getPrice(); diff --git a/core/lib/Thelia/Tools/FileManager.php b/core/lib/Thelia/Tools/FileManager.php index 351283d8c..caf8fe61f 100644 --- a/core/lib/Thelia/Tools/FileManager.php +++ b/core/lib/Thelia/Tools/FileManager.php @@ -95,10 +95,11 @@ class FileManager if (!$model->save()) { throw new ImageException( sprintf( - '%s %s (%s) failed to be saved (image file)', + '%s %s (%s) with id %d failed to be saved (image file)', ucfirst($parentType), $model->getFile(), - $fileType + $fileType, + $parentId ) ); } From 35d13885ab357a87884c7f1bb0fce7d0711b3983 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 24 Jun 2014 10:45:48 +0200 Subject: [PATCH 16/24] remove unused variable --- core/lib/Thelia/Condition/Implementation/StartDate.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/lib/Thelia/Condition/Implementation/StartDate.php b/core/lib/Thelia/Condition/Implementation/StartDate.php index 2524e1b6d..d086fb39a 100644 --- a/core/lib/Thelia/Condition/Implementation/StartDate.php +++ b/core/lib/Thelia/Condition/Implementation/StartDate.php @@ -127,10 +127,6 @@ class StartDate extends ConditionAbstract */ public function getSummary() { - $i18nOperator = Operators::getI18n( - $this->translator, $this->operators[self::START_DATE] - ); - $date = new \DateTime(); $date->setTimestamp($this->values[self::START_DATE]); $strDate = $date->format($this->getDateFormat()); From 67e689ff850f9e257fe6dfe4b60eb5956288ded5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Espeche?= Date: Wed, 25 Jun 2014 15:25:32 +0200 Subject: [PATCH 17/24] Reinit file --- core/lib/Thelia/Core/Template/Element/BaseLoop.php | 1 - 1 file changed, 1 deletion(-) diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index e08d13dd6..d120b1c41 100644 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -535,5 +535,4 @@ abstract class BaseLoop * @return \Thelia\Core\Template\Loop\Argument\ArgumentCollection */ abstract protected function getArgDefinitions(); - } \ No newline at end of file From 079f627de9eb3034c699041f5af3f84867cd85dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Espeche?= Date: Wed, 25 Jun 2014 15:25:56 +0200 Subject: [PATCH 18/24] Reinit file --- core/lib/Thelia/Core/Template/Element/BaseLoop.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index d120b1c41..929b7f455 100644 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -535,4 +535,6 @@ abstract class BaseLoop * @return \Thelia\Core\Template\Loop\Argument\ArgumentCollection */ abstract protected function getArgDefinitions(); + + } \ No newline at end of file From d7a55257d546d1d61e2203f6d98961b4d5d9eb91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Espeche?= Date: Wed, 25 Jun 2014 15:29:28 +0200 Subject: [PATCH 19/24] Reinit file --- core/lib/Thelia/Core/Template/Element/BaseLoop.php | 1 - 1 file changed, 1 deletion(-) diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index 929b7f455..e08d13dd6 100644 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -536,5 +536,4 @@ abstract class BaseLoop */ abstract protected function getArgDefinitions(); - } \ No newline at end of file From ed464db6fdb9a5632e26a5b0d72166db0d33b472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Espeche?= Date: Wed, 25 Jun 2014 16:43:06 +0200 Subject: [PATCH 20/24] Add substitution --- .../Thelia/Core/Template/Loop/Category.php | 1 + core/lib/Thelia/Core/Template/Loop/Folder.php | 1 + core/lib/Thelia/Model/Category.php | 22 +++++++++++++++++++ core/lib/Thelia/Model/Folder.php | 22 +++++++++++++++++++ 4 files changed, 46 insertions(+) diff --git a/core/lib/Thelia/Core/Template/Loop/Category.php b/core/lib/Thelia/Core/Template/Loop/Category.php index 9ecee9182..e416aa9a1 100644 --- a/core/lib/Thelia/Core/Template/Loop/Category.php +++ b/core/lib/Thelia/Core/Template/Loop/Category.php @@ -214,6 +214,7 @@ class Category extends BaseI18nLoop implements PropelSearchLoopInterface, Search ->set("DESCRIPTION" , $category->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM" , $category->getVirtualColumn('i18n_POSTSCRIPTUM')) ->set("PARENT" , $category->getParent()) + ->set("ROOT" , $category->getRoot($category->getId())) ->set("URL" , $category->getUrl($this->locale)) ->set("META_TITLE" , $category->getVirtualColumn('i18n_META_TITLE')) ->set("META_DESCRIPTION" , $category->getVirtualColumn('i18n_META_DESCRIPTION')) diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index ee4e0cbbe..73719a775 100644 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -175,6 +175,7 @@ class Folder extends BaseI18nLoop implements PropelSearchLoopInterface, SearchLo ->set("DESCRIPTION" , $folder->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM" , $folder->getVirtualColumn('i18n_POSTSCRIPTUM')) ->set("PARENT" , $folder->getParent()) + ->set("ROOT" , $folder->getRoot($folder->getId())) ->set("URL" , $folder->getUrl($this->locale)) ->set("META_TITLE" , $folder->getVirtualColumn('i18n_META_TITLE')) ->set("META_DESCRIPTION" , $folder->getVirtualColumn('i18n_META_DESCRIPTION')) diff --git a/core/lib/Thelia/Model/Category.php b/core/lib/Thelia/Model/Category.php index c5ab471a5..1b4582fd0 100644 --- a/core/lib/Thelia/Model/Category.php +++ b/core/lib/Thelia/Model/Category.php @@ -56,6 +56,28 @@ class Category extends BaseCategory return $countProduct; } + /** + * Get the root category + * @param int $categoryId + * @return mixed + */ + public function getRoot($categoryId) + { + + $category = CategoryQuery::create()->findOneById($categoryId); + + if(0 !== $category->getParent()) { + $parentCategory = CategoryQuery::create()->findOneById($category->getParent()); + + if (null !== $parentCategory) { + $categoryId = $this->getRoot($parentCategory->getId()); + } + } + + return $categoryId; + + } + /** * Calculate next position relative to our parent */ diff --git a/core/lib/Thelia/Model/Folder.php b/core/lib/Thelia/Model/Folder.php index e8bc43498..c016aefe2 100644 --- a/core/lib/Thelia/Model/Folder.php +++ b/core/lib/Thelia/Model/Folder.php @@ -55,6 +55,28 @@ class Folder extends BaseFolder } + /** + * Get the root folder + * @param int $folderId + * @return mixed + */ + public function getRoot($folderId) + { + + $folder = FolderQuery::create()->findOneById($folderId); + + if(0 !== $folder->getParent()) { + $parentFolder = FolderQuery::create()->findOneById($folder->getParent()); + + if (null !== $parentFolder) { + $folderId = $this->getRoot($parentFolder->getId()); + } + } + + return $folderId; + + } + /** * Calculate next position relative to our parent */ From 6661341eb4f29428c19fa575f17052a8e26b02a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Espeche?= Date: Thu, 26 Jun 2014 08:59:21 +0200 Subject: [PATCH 21/24] Replace findOneById by findPk --- core/lib/Thelia/Model/Category.php | 4 ++-- core/lib/Thelia/Model/Folder.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/lib/Thelia/Model/Category.php b/core/lib/Thelia/Model/Category.php index 1b4582fd0..e5c9708db 100644 --- a/core/lib/Thelia/Model/Category.php +++ b/core/lib/Thelia/Model/Category.php @@ -64,10 +64,10 @@ class Category extends BaseCategory public function getRoot($categoryId) { - $category = CategoryQuery::create()->findOneById($categoryId); + $category = CategoryQuery::create()->findPk($categoryId); if(0 !== $category->getParent()) { - $parentCategory = CategoryQuery::create()->findOneById($category->getParent()); + $parentCategory = CategoryQuery::create()->findPk($category->getParent()); if (null !== $parentCategory) { $categoryId = $this->getRoot($parentCategory->getId()); diff --git a/core/lib/Thelia/Model/Folder.php b/core/lib/Thelia/Model/Folder.php index c016aefe2..31ba041c4 100644 --- a/core/lib/Thelia/Model/Folder.php +++ b/core/lib/Thelia/Model/Folder.php @@ -63,10 +63,10 @@ class Folder extends BaseFolder public function getRoot($folderId) { - $folder = FolderQuery::create()->findOneById($folderId); + $folder = FolderQuery::create()->findPk($folderId); if(0 !== $folder->getParent()) { - $parentFolder = FolderQuery::create()->findOneById($folder->getParent()); + $parentFolder = FolderQuery::create()->findPk($folder->getParent()); if (null !== $parentFolder) { $folderId = $this->getRoot($parentFolder->getId()); From feabfc4f07fbeb34de56279c988038a2c9ef2fbe Mon Sep 17 00:00:00 2001 From: Benjamin Perche Date: Thu, 26 Jun 2014 09:16:35 +0200 Subject: [PATCH 22/24] =?UTF-8?q?Fix=20cs,=20follow=20PSR-2,=20keyword=20n?= =?UTF-8?q?ull=20must=20be=20in=20lower=20case=20=09modifi=C3=A9:=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20core/lib/Thelia/Log/Tlog.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/lib/Thelia/Log/Tlog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/Thelia/Log/Tlog.php b/core/lib/Thelia/Log/Tlog.php index 1aade8a5c..356a95de0 100644 --- a/core/lib/Thelia/Log/Tlog.php +++ b/core/lib/Thelia/Log/Tlog.php @@ -706,7 +706,7 @@ class Tlog Implements LoggerInterface * @param type $destinations * @param array $actives array containing classes instanceof AbstractTlogDestination */ - protected function loadDestinations(&$destinations, array $actives = NULL) + protected function loadDestinations(&$destinations, array $actives = null) { foreach ($actives as $active) { if (class_exists($active)) { From 33862b39b5c4cefe137e83d2b0aa4e1a12bbb485 Mon Sep 17 00:00:00 2001 From: Benjamin Perche Date: Thu, 26 Jun 2014 09:28:51 +0200 Subject: [PATCH 23/24] =?UTF-8?q?Translate=20french=20named=20variabled=20?= =?UTF-8?q?"origine"=20and=20"prefixe"=20=09modifi=C3=A9:=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20core/lib/Thelia/Log/Tlog.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/lib/Thelia/Log/Tlog.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/core/lib/Thelia/Log/Tlog.php b/core/lib/Thelia/Log/Tlog.php index 356a95de0..2f36f085f 100644 --- a/core/lib/Thelia/Log/Tlog.php +++ b/core/lib/Thelia/Log/Tlog.php @@ -78,7 +78,7 @@ class Tlog Implements LoggerInterface protected $mode_back_office = false; protected $level = self::MUET; - protected $prefixe = ""; + protected $prefix = ""; protected $files = array(); protected $all_files = false; protected $show_redirect = false; @@ -194,9 +194,9 @@ class Tlog Implements LoggerInterface return $this; } - public function setPrefix($prefixe) + public function setPrefix($prefix) { - $this->prefixe = $prefixe; + $this->prefix = $prefix; return $this; } @@ -609,7 +609,7 @@ class Tlog Implements LoggerInterface private function findOrigin() { - $origine = array(); + $origin = array(); if (function_exists('debug_backtrace')) { @@ -624,8 +624,8 @@ class Tlog Implements LoggerInterface $className = $hop['class']; if (! empty($className) && ($className == ltrim(__CLASS__,'\\') || strtolower(get_parent_class($className)) == ltrim(__CLASS__,'\\'))) { - $origine['line'] = $hop['line']; - $origine['file'] = $hop['file']; + $origin['line'] = $hop['line']; + $origin['file'] = $hop['file']; break; } } @@ -633,7 +633,7 @@ class Tlog Implements LoggerInterface $hop = array_pop($trace); } - $origine['class'] = isset($prevHop['class']) ? $prevHop['class'] : 'main'; + $origin['class'] = isset($prevHop['class']) ? $prevHop['class'] : 'main'; if(isset($prevHop['function']) && $prevHop['function'] !== 'include' && @@ -641,13 +641,13 @@ class Tlog Implements LoggerInterface $prevHop['function'] !== 'require' && $prevHop['function'] !== 'require_once') { - $origine['function'] = $prevHop['function']; + $origin['function'] = $prevHop['function']; } else { - $origine['function'] = 'main'; + $origin['function'] = 'main'; } } - return $origine; + return $origin; } protected function interpolate($message, array $context = array()) @@ -676,22 +676,22 @@ class Tlog Implements LoggerInterface $text = $this->interpolate($text, $context); - $origine = $this->findOrigin(); + $origin = $this->findOrigin(); - $file = basename($origine['file']); + $file = basename($origin['file']); if ($this->isActivedFile($file)) { - $function = $origine['function']; - $line = $origine['line']; + $function = $origin['function']; + $line = $origin['line']; - $prefixe = str_replace( + $prefix = str_replace( array("#INDEX", "#LEVEL", "#FILE", "#FUNCTION", "#LINE", "#DATE", "#HOUR"), array(1+$this->linecount, $level, $file, $function, $line, date("Y-m-d"), date("G:i:s")), - $this->prefixe + $this->prefix ); - $trace = $prefixe . $text; + $trace = $prefix . $text; foreach ($this->destinations as $dest) { $dest->add($trace); From f533048fbbc32f821f68b589383d27ebf59cc257 Mon Sep 17 00:00:00 2001 From: Benjamin Perche Date: Thu, 26 Jun 2014 15:04:25 +0200 Subject: [PATCH 24/24] =?UTF-8?q?Fix=20bug=20when=20trying=20to=20order=20?= =?UTF-8?q?by=20title=20=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20core/li?= =?UTF-8?q?b/Thelia/Core/Template/Loop/Module.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/lib/Thelia/Core/Template/Loop/Module.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/lib/Thelia/Core/Template/Loop/Module.php b/core/lib/Thelia/Core/Template/Loop/Module.php index b10c1f1ad..b987d6912 100644 --- a/core/lib/Thelia/Core/Template/Loop/Module.php +++ b/core/lib/Thelia/Core/Template/Loop/Module.php @@ -69,7 +69,7 @@ class Module extends BaseI18nLoop implements PropelSearchLoopInterface new Argument( 'order', new TypeCollection( - new Type\EnumListType(array('id', 'id_reverse', 'code', 'code_reverse', 'alpha', 'alpha_reverse', 'manual', 'manual_reverse', 'enabled', 'enabled_reverse')) + new Type\EnumListType(array('id', 'id_reverse', 'code', 'code_reverse', 'title', 'title_reverse', 'manual', 'manual_reverse', 'enabled', 'enabled_reverse')) ), 'manual' ), @@ -133,10 +133,10 @@ class Module extends BaseI18nLoop implements PropelSearchLoopInterface case "id_reverse": $search->orderById(Criteria::DESC); break; - case "alpha": + case "title": $search->addAscendingOrderByColumn('i18n_TITLE'); break; - case "alpha_reverse": + case "title_reverse": $search->addDescendingOrderByColumn('i18n_TITLE'); break; case "code":