From ae93ff483dcd8b136a88c45eac71340be9aacfcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Ste=CC=A8pien=CC=81?= Date: Tue, 19 Sep 2023 23:29:09 +0200 Subject: [PATCH 1/6] unique names for parameters --- config/admin/services.yml | 8 ++++---- config/common.yml | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/admin/services.yml b/config/admin/services.yml index 2c3238b..570ebd7 100644 --- a/config/admin/services.yml +++ b/config/admin/services.yml @@ -53,12 +53,12 @@ services: oksydan.is_imageslider.handler.file_uploader: class: 'Oksydan\IsImageslider\Handler\FileUploader' arguments: - $targetDirectory: '%images_directory%' + $targetDirectory: '%is_imageslider_images_directory%' oksydan.is_imageslider.handler.file_eraser: class: 'Oksydan\IsImageslider\Handler\FileEraser' arguments: - $targetDirectory: '%images_directory%' + $targetDirectory: '%is_imageslider_images_directory%' #creation/edition form @@ -68,7 +68,7 @@ services: - '@oksydan.is_imageslider.repository.image_slider' - '@oksydan.is_imageslider.provider.image_provider' - '@prestashop.core.admin.lang.repository' - - '%placeholder_img%' + - '%is_imageslider_placeholder_img%' - '@prestashop.adapter.shop.context' oksydan.is_imageslider.form.identifiable_object.builder.image_slider_form_builder: @@ -188,4 +188,4 @@ services: class: 'Oksydan\IsImageslider\Provider\ImageProvider' public: true arguments: - - '%images_uri%' + - '%is_imageslider_images_uri%' diff --git a/config/common.yml b/config/common.yml index 37dc1fe..6c1acad 100644 --- a/config/common.yml +++ b/config/common.yml @@ -1,8 +1,8 @@ parameters: - images_directory: '%kernel.project_dir%/modules/is_imageslider/img/' - module_uri: !php/const _MODULE_DIR_ - images_uri: '%module_uri%is_imageslider/img/' - placeholder_img: '/modules/is_imageslider/views/img/placeholder.jpeg' + is_imageslider_images_directory: '%kernel.project_dir%/modules/is_imageslider/img/' + is_imageslider_module_uri: !php/const _MODULE_DIR_ + is_imageslider_images_uri: '%is_imageslider_module_uri%is_imageslider/img/' + is_imageslider_placeholder_img: '/modules/is_imageslider/views/img/placeholder.jpeg' services: _defaults: @@ -33,8 +33,8 @@ services: class: Oksydan\IsImageslider\Presenter\ImageSlidePresenter public: true arguments: - - '%images_uri%' - - '%images_directory%' + - '%is_imageslider_images_uri%' + - '%is_imageslider_images_directory%' - "@=service('prestashop.adapter.legacy.context').getContext()" oksydan.is_imageslider.configuration.slider_configuration: From d39719efd4305bbf5bcb63b9a5742e8e9ed381c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Ste=CC=A8pien=CC=81?= Date: Tue, 19 Sep 2023 23:31:11 +0200 Subject: [PATCH 2/6] New version bump --- is_imageslider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/is_imageslider.php b/is_imageslider.php index 93dfe50..fe19361 100644 --- a/is_imageslider.php +++ b/is_imageslider.php @@ -30,7 +30,7 @@ public function __construct() * https://www.waynet.pl/ */ $this->author = 'Igor Stępień'; - $this->version = '2.3.0'; + $this->version = '2.3.1'; $this->need_instance = 0; $this->bootstrap = true; From e435d54197c1b00a4071c903d9aee2b754bb1d6b Mon Sep 17 00:00:00 2001 From: Ken van der Eerden <15888558+Ken-vdE@users.noreply.github.com> Date: Thu, 21 Sep 2023 16:33:57 +0200 Subject: [PATCH 3/6] Bug when migrating with data in ps_image_slider When running prestashop:schema:update-without-foreign while there are records in ps_image_slider the sql query becomes `ALTER TABLE ps_image_slider ADD display_from DATETIME NOT NULL, ADD display_to DATETIME NOT NULL` which throws an error because no value is set in those fields. --- src/Entity/ImageSlider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Entity/ImageSlider.php b/src/Entity/ImageSlider.php index 0689354..4003c40 100644 --- a/src/Entity/ImageSlider.php +++ b/src/Entity/ImageSlider.php @@ -44,14 +44,14 @@ class ImageSlider /** * @var \DateTime * - * @ORM\Column(name="display_from", type="datetime") + * @ORM\Column(name="display_from", type="datetime", nullable=true) */ private $display_from; /** * @var \DateTime * - * @ORM\Column(name="display_to", type="datetime") + * @ORM\Column(name="display_to", type="datetime", nullable=true) */ private $display_to; From 7e497cae68655586f52cd76fdbf5a9f3d3953e54 Mon Sep 17 00:00:00 2001 From: PERRIGAULT Alexandre Date: Sun, 1 Oct 2023 00:53:14 +0200 Subject: [PATCH 4/6] Update ImageSliderType.php Add param 'with_seconds' as stated in DateTimeType. We need to force the browser to display the seconds by adding the HTML attribute step if not already defined. Otherwise the browser will not display and so not send the seconds therefore the value will always be considered as invalid. --- src/Form/ImageSliderType.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Form/ImageSliderType.php b/src/Form/ImageSliderType.php index dfdbd16..2b3c8ce 100644 --- a/src/Form/ImageSliderType.php +++ b/src/Form/ImageSliderType.php @@ -134,6 +134,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'widget' => 'single_text', 'html5' => true, 'input' => 'datetime', + 'with_seconds' => true ]) ->add('display_to', DateTimeType::class, [ 'label' => $this->trans('Display to', TranslationDomains::TRANSLATION_DOMAIN_ADMIN), @@ -141,6 +142,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'widget' => 'single_text', 'html5' => true, 'input' => 'datetime', + 'with_seconds' => true ]); if ($this->isMultistoreUsed) { From d815faeb4036606ff6867137a48625899ab49312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Ste=CC=A8pien=CC=81?= Date: Mon, 23 Oct 2023 23:04:24 +0200 Subject: [PATCH 5/6] cs-fixer fix --- src/Form/ImageSliderType.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Form/ImageSliderType.php b/src/Form/ImageSliderType.php index 2b3c8ce..7621f53 100644 --- a/src/Form/ImageSliderType.php +++ b/src/Form/ImageSliderType.php @@ -134,7 +134,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'widget' => 'single_text', 'html5' => true, 'input' => 'datetime', - 'with_seconds' => true + 'with_seconds' => true, ]) ->add('display_to', DateTimeType::class, [ 'label' => $this->trans('Display to', TranslationDomains::TRANSLATION_DOMAIN_ADMIN), @@ -142,7 +142,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'widget' => 'single_text', 'html5' => true, 'input' => 'datetime', - 'with_seconds' => true + 'with_seconds' => true, ]); if ($this->isMultistoreUsed) { From 51a0be7875da43e985c4a17dea479fd7ea747640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Ste=CC=A8pien=CC=81?= Date: Mon, 23 Oct 2023 23:14:57 +0200 Subject: [PATCH 6/6] version bump --- is_imageslider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/is_imageslider.php b/is_imageslider.php index fe19361..dc9234d 100644 --- a/is_imageslider.php +++ b/is_imageslider.php @@ -30,7 +30,7 @@ public function __construct() * https://www.waynet.pl/ */ $this->author = 'Igor Stępień'; - $this->version = '2.3.1'; + $this->version = '2.3.2'; $this->need_instance = 0; $this->bootstrap = true;