From e533b7eb2e35408e141aa01137ba0596e34a076e Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Fri, 7 Jun 2019 11:30:06 +0200 Subject: [PATCH 1/5] Fixed moving files after order for regular upload attributes --- system/modules/isotope/docs/CHANGELOG-2.5.md | 7 +++ .../EventListener/PostCheckoutUploads.php | 57 +++++++++++-------- 2 files changed, 40 insertions(+), 24 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.5.md b/system/modules/isotope/docs/CHANGELOG-2.5.md index 58e01a8412..1b1c65a752 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.5.md +++ b/system/modules/isotope/docs/CHANGELOG-2.5.md @@ -1,6 +1,13 @@ Isotope eCommerce Changelog =========================== + +Version 2.5.14-stable (2019-06-??) +---------------------------------- + +- Fixed moving files after order for regular upload attributes + + Version 2.5.13-stable (2019-05-29) ---------------------------------- diff --git a/system/modules/isotope/library/Isotope/EventListener/PostCheckoutUploads.php b/system/modules/isotope/library/Isotope/EventListener/PostCheckoutUploads.php index df77e240c9..df4f70d9a3 100644 --- a/system/modules/isotope/library/Isotope/EventListener/PostCheckoutUploads.php +++ b/system/modules/isotope/library/Isotope/EventListener/PostCheckoutUploads.php @@ -49,31 +49,12 @@ public function onPostCheckout(IsotopeOrderableCollection $order) continue; } - foreach ($value as $i => $source) { - $tokens = $this->generateTokens($order, $item, $position, $total, $attribute, $source); - - $targetFolder = StringUtil::recursiveReplaceTokensAndTags( - $attribute->checkoutTargetFolder, - $tokens, - StringUtil::NO_TAGS | StringUtil::NO_BREAKS - ); - - if ($attribute->doNotOverwrite) { - $tokens['file_target'] = FileUpload::getFileName($tokens['file_name'], $targetFolder); - } else { - $tokens['file_target'] = $tokens['file_name']; + if (\is_array($value)) { + foreach ($value as $i => $source) { + $value[$i] = $this->renameFile($order, $item, $position, $total, $attribute, $source); } - - $targetFile = StringUtil::recursiveReplaceTokensAndTags( - $attribute->checkoutTargetFile, - $tokens, - StringUtil::NO_TAGS | StringUtil::NO_BREAKS - ); - - $file = new File($source); - $file->renameTo($targetFolder . '/' . $targetFile); - - $value[$i] = $targetFolder . '/' . $targetFile; + } else { + $value = $this->renameFile($order, $item, $position, $total, $attribute, $value); } $configuration[$attributeName] = $value; @@ -132,4 +113,32 @@ private function generateTokens(IsotopeOrderableCollection $order, $item, $posit return $tokens; } + + private function renameFile(IsotopeOrderableCollection $order, $item, $position, $total, $attribute, $source) + { + $tokens = $this->generateTokens($order, $item, $position, $total, $attribute, $source); + + $targetFolder = StringUtil::recursiveReplaceTokensAndTags( + $attribute->checkoutTargetFolder, + $tokens, + StringUtil::NO_TAGS | StringUtil::NO_BREAKS + ); + + if ($attribute->doNotOverwrite) { + $tokens['file_target'] = FileUpload::getFileName($tokens['file_name'], $targetFolder); + } else { + $tokens['file_target'] = $tokens['file_name']; + } + + $targetFile = StringUtil::recursiveReplaceTokensAndTags( + $attribute->checkoutTargetFile, + $tokens, + StringUtil::NO_TAGS | StringUtil::NO_BREAKS + ); + + $file = new File($source); + $file->renameTo($targetFolder . '/' . $targetFile); + + return $targetFolder . '/' . $targetFile; + } } From 11c07bf84fa32c32cba3f19b3b95f636ecf256c6 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Fri, 7 Jun 2019 11:32:24 +0200 Subject: [PATCH 2/5] Fixed moving files to member homedir after order is complete fixes #1996 --- system/modules/isotope/docs/CHANGELOG-2.5.md | 1 + .../library/Isotope/EventListener/PostCheckoutUploads.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.5.md b/system/modules/isotope/docs/CHANGELOG-2.5.md index 1b1c65a752..d3af128545 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.5.md +++ b/system/modules/isotope/docs/CHANGELOG-2.5.md @@ -6,6 +6,7 @@ Version 2.5.14-stable (2019-06-??) ---------------------------------- - Fixed moving files after order for regular upload attributes +- Fixed moving files to member homedir after order is complete (#1996) Version 2.5.13-stable (2019-05-29) diff --git a/system/modules/isotope/library/Isotope/EventListener/PostCheckoutUploads.php b/system/modules/isotope/library/Isotope/EventListener/PostCheckoutUploads.php index df4f70d9a3..0130b4943d 100644 --- a/system/modules/isotope/library/Isotope/EventListener/PostCheckoutUploads.php +++ b/system/modules/isotope/library/Isotope/EventListener/PostCheckoutUploads.php @@ -107,7 +107,7 @@ private function generateTokens(IsotopeOrderableCollection $order, $item, $posit if ($userData['assignDir']) { $homeDir = FilesModel::findByPk($userData['homeDir']); - $tokens['member_homeDir'] = null === $homeDir ? $homeDir->path : ''; + $tokens['member_homeDir'] = null !== $homeDir ? $homeDir->path : ''; } } From 263900f2608cea1d42222279fa802d6e00fdb6a8 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Fri, 7 Jun 2019 11:36:35 +0200 Subject: [PATCH 3/5] Removed file hash from upload file names --- system/modules/isotope/docs/CHANGELOG-2.5.md | 1 + .../modules/isotope/library/Isotope/Model/Attribute/Upload.php | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.5.md b/system/modules/isotope/docs/CHANGELOG-2.5.md index d3af128545..4c98f82da8 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.5.md +++ b/system/modules/isotope/docs/CHANGELOG-2.5.md @@ -7,6 +7,7 @@ Version 2.5.14-stable (2019-06-??) - Fixed moving files after order for regular upload attributes - Fixed moving files to member homedir after order is complete (#1996) +- Removed file hash from upload file names Version 2.5.13-stable (2019-05-29) diff --git a/system/modules/isotope/library/Isotope/Model/Attribute/Upload.php b/system/modules/isotope/library/Isotope/Model/Attribute/Upload.php index 8dfbce42e6..0be616821a 100644 --- a/system/modules/isotope/library/Isotope/Model/Attribute/Upload.php +++ b/system/modules/isotope/library/Isotope/Model/Attribute/Upload.php @@ -100,7 +100,6 @@ public function processFiles($value, IsotopeProduct $product, \Widget $widget) $folder = new Folder('isotope/uploads'); $folder->protect(); - $file = substr(md5_file($temp), 0, 8) . '-' . $file; $file = FileUpload::getFileName($file, $folder->path); $file = $folder->path . '/' . $file; From 806dd1afd7d798269244ed73a0793ae63b58293d Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 11 Jun 2019 12:25:12 +0200 Subject: [PATCH 4/5] Transifex Sync --- system/modules/isotope/languages/de/tl_iso_payment.xlf | 4 ++-- .../modules/isotope/languages/sl/tl_iso_attribute.xlf | 1 + system/modules/isotope/languages/sl/tl_iso_config.xlf | 10 ++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/system/modules/isotope/languages/de/tl_iso_payment.xlf b/system/modules/isotope/languages/de/tl_iso_payment.xlf index 66e56e0e6a..20a5f9947b 100644 --- a/system/modules/isotope/languages/de/tl_iso_payment.xlf +++ b/system/modules/isotope/languages/de/tl_iso_payment.xlf @@ -179,7 +179,7 @@ Client ID - Kundennummer + Kundennummer (Client ID) Enter your PayPal Client ID. You must create an application on the PayPal portal to get the access details. @@ -187,7 +187,7 @@ Secret - Schlüssel + Schlüssel (Secret) Enter your PayPal API secret. diff --git a/system/modules/isotope/languages/sl/tl_iso_attribute.xlf b/system/modules/isotope/languages/sl/tl_iso_attribute.xlf index b71bd046cc..4a16b08dab 100644 --- a/system/modules/isotope/languages/sl/tl_iso_attribute.xlf +++ b/system/modules/isotope/languages/sl/tl_iso_attribute.xlf @@ -364,6 +364,7 @@ E-mail address + E-Poštni naslov Checks whether the input is a valid e-mail address. diff --git a/system/modules/isotope/languages/sl/tl_iso_config.xlf b/system/modules/isotope/languages/sl/tl_iso_config.xlf index c9eb416f23..7d8fe0268c 100644 --- a/system/modules/isotope/languages/sl/tl_iso_config.xlf +++ b/system/modules/isotope/languages/sl/tl_iso_config.xlf @@ -47,6 +47,7 @@ Please enter a VAT number. + Vnesite davčno številko. Street @@ -54,6 +55,7 @@ Please enter the street name and the street number. + Vnesite naslov. Street 2 @@ -61,6 +63,7 @@ Enter a second street info if there's any. + Vnesite naslov. Street 3 @@ -68,6 +71,7 @@ Enter a third street info if there's any. + Vnesite naslov. Postal code @@ -75,6 +79,7 @@ Please enter the postal code. + Vnesite poštno številko. City @@ -82,12 +87,15 @@ Please enter the name of the city. + Vnesite kraj. State + Regija Please enter the name of the state. + Vnesite regijo. Country @@ -102,12 +110,14 @@ Please enter the phone number. + Vnesite telefonsko številko. Shipping email address Please enter a valid e-mail address. + Vnesite e-poštni naslov. Address fields From c49403aefe573d5bc21dec836e6faa1f0dbfe8cf Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 11 Jun 2019 12:25:18 +0200 Subject: [PATCH 5/5] Release 2.5.14 --- system/modules/isotope/docs/CHANGELOG-2.5.md | 4 ++-- system/modules/isotope/library/Isotope/Isotope.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.5.md b/system/modules/isotope/docs/CHANGELOG-2.5.md index 4c98f82da8..4aac33b335 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.5.md +++ b/system/modules/isotope/docs/CHANGELOG-2.5.md @@ -2,8 +2,8 @@ Isotope eCommerce Changelog =========================== -Version 2.5.14-stable (2019-06-??) ----------------------------------- +Version 2.5.14-stable (2019-06-11) +--------------------------------- - Fixed moving files after order for regular upload attributes - Fixed moving files to member homedir after order is complete (#1996) diff --git a/system/modules/isotope/library/Isotope/Isotope.php b/system/modules/isotope/library/Isotope/Isotope.php index ae8f5870b8..329114ad75 100644 --- a/system/modules/isotope/library/Isotope/Isotope.php +++ b/system/modules/isotope/library/Isotope/Isotope.php @@ -44,7 +44,7 @@ class Isotope extends \Controller /** * Isotope version */ - const VERSION = '2.5.13'; + const VERSION = '2.5.14'; /** * True if the system has been initialized