Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#62: fix upload filename clash #63

Merged
merged 1 commit into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Umc/CoreBundle/Resources/views/help.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@
</tr>
</thead>
<tbody>
<tr>
<td colspan="3"><strong>4.3.2: December 15th 2020</strong></td>
</tr>
<tr>
<th scope="row">1</th>
<td>Bug fix</td>
<td><a href="https://github.com/UltimateModuleCreator/umc/issues/62">Magento: File uploader not returning correct name</a></td>
</tr>
<tr>
<td colspan="3"><strong>4.3.1: December 14th 2020</strong></td>
</tr>
<tr>
<td colspan="3"><strong>4.3.1: December 14 2020</strong></td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion src/Umc/CoreBundle/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class Version
{
public const VERSION = '4.3.1';
public const VERSION = '4.3.2';
public const BUILD = '';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,12 @@ class Uploader
$basePath = $this->getBasePath();

$baseTmpFilePath = $this->getFilePath($baseTmpPath, $name);
$baseFilePath = $this->getFilePath(
$basePath,
$this->fileChecker->getNewFileName(
$this->mediaDirectory->getAbsolutePath(
$this->getFilePath($basePath, $name)
)
$newName = $this->fileChecker->getNewFileName(
$this->mediaDirectory->getAbsolutePath(
$this->getFilePath($basePath, $name)
)
);
$baseFilePath = $this->getFilePath($basePath, $newName);

try {
$this->coreFileStorageDatabase->copyFile(
Expand All @@ -171,7 +169,7 @@ class Uploader
);
}

return $name;
return $newName;
}

/**
Expand Down