Skip to content

Commit

Permalink
Merge branch 'hotfix/2.5.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Jun 11, 2019
2 parents f5114fb + c49403a commit f080efc
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 29 deletions.
9 changes: 9 additions & 0 deletions system/modules/isotope/docs/CHANGELOG-2.5.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Isotope eCommerce Changelog
===========================


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)
- Removed file hash from upload file names


Version 2.5.13-stable (2019-05-29)
----------------------------------

Expand Down
4 changes: 2 additions & 2 deletions system/modules/isotope/languages/de/tl_iso_payment.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@
</trans-unit>
<trans-unit id="tl_iso_payment.paypal_client.0">
<source>Client ID</source>
<target>Kundennummer</target>
<target>Kundennummer (Client ID)</target>
</trans-unit>
<trans-unit id="tl_iso_payment.paypal_client.1">
<source>Enter your PayPal Client ID. You must create an application on the PayPal portal to get the access details.</source>
<target>Geben Sie Ihre PayPal-Kundennummer ein. Sie müssen eine Anwendung im PayPal-Portal erstellen, um die Zugangsdaten zu erhalten.</target>
</trans-unit>
<trans-unit id="tl_iso_payment.paypal_secret.0">
<source>Secret</source>
<target>Schlüssel</target>
<target>Schlüssel (Secret)</target>
</trans-unit>
<trans-unit id="tl_iso_payment.paypal_secret.1">
<source>Enter your PayPal API secret.</source>
Expand Down
1 change: 1 addition & 0 deletions system/modules/isotope/languages/sl/tl_iso_attribute.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@
</trans-unit>
<trans-unit id="tl_iso_attribute.email.0">
<source>E-mail address</source>
<target>E-Poštni naslov</target>
</trans-unit>
<trans-unit id="tl_iso_attribute.email.1">
<source>Checks whether the input is a valid e-mail address.</source>
Expand Down
10 changes: 10 additions & 0 deletions system/modules/isotope/languages/sl/tl_iso_config.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,47 +47,55 @@
</trans-unit>
<trans-unit id="tl_iso_config.vat_no.1">
<source>Please enter a VAT number.</source>
<target>Vnesite davčno številko.</target>
</trans-unit>
<trans-unit id="tl_iso_config.street_1.0">
<source>Street</source>
<target>Ulica</target>
</trans-unit>
<trans-unit id="tl_iso_config.street_1.1">
<source>Please enter the street name and the street number.</source>
<target>Vnesite naslov.</target>
</trans-unit>
<trans-unit id="tl_iso_config.street_2.0">
<source>Street 2</source>
<target>Ulica 2</target>
</trans-unit>
<trans-unit id="tl_iso_config.street_2.1">
<source>Enter a second street info if there's any.</source>
<target>Vnesite naslov.</target>
</trans-unit>
<trans-unit id="tl_iso_config.street_3.0">
<source>Street 3</source>
<target>Ulica 3</target>
</trans-unit>
<trans-unit id="tl_iso_config.street_3.1">
<source>Enter a third street info if there's any.</source>
<target>Vnesite naslov.</target>
</trans-unit>
<trans-unit id="tl_iso_config.postal.0">
<source>Postal code</source>
<target>Poštna številka</target>
</trans-unit>
<trans-unit id="tl_iso_config.postal.1">
<source>Please enter the postal code.</source>
<target>Vnesite poštno številko.</target>
</trans-unit>
<trans-unit id="tl_iso_config.city.0">
<source>City</source>
<target>Kraj</target>
</trans-unit>
<trans-unit id="tl_iso_config.city.1">
<source>Please enter the name of the city.</source>
<target>Vnesite kraj.</target>
</trans-unit>
<trans-unit id="tl_iso_config.subdivision.0">
<source>State</source>
<target>Regija</target>
</trans-unit>
<trans-unit id="tl_iso_config.subdivision.1">
<source>Please enter the name of the state.</source>
<target>Vnesite regijo.</target>
</trans-unit>
<trans-unit id="tl_iso_config.country.0">
<source>Country</source>
Expand All @@ -102,12 +110,14 @@
</trans-unit>
<trans-unit id="tl_iso_config.phone.1">
<source>Please enter the phone number.</source>
<target>Vnesite telefonsko številko.</target>
</trans-unit>
<trans-unit id="tl_iso_config.email.0">
<source>Shipping email address</source>
</trans-unit>
<trans-unit id="tl_iso_config.email.1">
<source>Please enter a valid e-mail address.</source>
<target>Vnesite e-poštni naslov.</target>
</trans-unit>
<trans-unit id="tl_iso_config.address_fields.0">
<source>Address fields</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -126,10 +107,38 @@ 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 : '';
}
}

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;
}
}
2 changes: 1 addition & 1 deletion system/modules/isotope/library/Isotope/Isotope.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f080efc

Please sign in to comment.