Commit 70ce68a6 authored by Dainis Abols's avatar Dainis Abols
Browse files

4.2.1

parent 51cd1d8e
...@@ -71,7 +71,7 @@ class FileMigrationWizard implements UpgradeWizardInterface, ChattyInterface, Lo ...@@ -71,7 +71,7 @@ class FileMigrationWizard implements UpgradeWizardInterface, ChattyInterface, Lo
* *
* @var string * @var string
*/ */
protected $targetPath = '_migrated/'; protected $targetPath = 'user_upload/';
/** /**
* @return string Unique identifier of this updater * @return string Unique identifier of this updater
...@@ -208,26 +208,9 @@ class FileMigrationWizard implements UpgradeWizardInterface, ChattyInterface, Lo ...@@ -208,26 +208,9 @@ class FileMigrationWizard implements UpgradeWizardInterface, ChattyInterface, Lo
$fileUid = null; $fileUid = null;
$sourcePath = Environment::getPublicPath() . '/' . $item; $sourcePath = Environment::getPublicPath() . '/' . $item;
$strippedPath = str_replace("fileadmin/user_upload/", "", $item); $strippedPath = str_replace("fileadmin/user_upload/", "", $item);
$targetDirectory = Environment::getPublicPath() . '/' . $fileadminDirectory . $this->targetPath;
$targetPath = $targetDirectory . $strippedPath;
// Remove file name
$temp = explode("/", $strippedPath);
array_pop($temp);
$subdir = implode("/", $temp);
$subdir = $targetDirectory . $subdir;
// maybe the file was already moved, so check if the original file still exists // maybe the file was already moved, so check if the original file still exists
if (file_exists($sourcePath) && !is_dir($sourcePath)) { if (file_exists($sourcePath) && !is_dir($sourcePath)) {
if (!is_dir($targetDirectory)) {
GeneralUtility::mkdir_deep($targetDirectory);
}
// Create subdirectory
if (!is_dir($subdir)) {
GeneralUtility::mkdir_deep($subdir);
}
// see if the file already exists in the storage // see if the file already exists in the storage
$fileSha1 = sha1_file($sourcePath); $fileSha1 = sha1_file($sourcePath);
...@@ -247,9 +230,6 @@ class FileMigrationWizard implements UpgradeWizardInterface, ChattyInterface, Lo ...@@ -247,9 +230,6 @@ class FileMigrationWizard implements UpgradeWizardInterface, ChattyInterface, Lo
// the file exists, the file does not have to be moved again // the file exists, the file does not have to be moved again
if (is_array($existingFileRecord)) { if (is_array($existingFileRecord)) {
$fileUid = $existingFileRecord['uid']; $fileUid = $existingFileRecord['uid'];
} else {
// just move the file (no duplicate)
rename($sourcePath, $targetPath);
} }
} }
......
{ {
"name": "luitd/lu-notices", "name": "luitd/lu-notices",
"version": "4.2.0", "version": "4.2.1",
"description": "General notice publisher for internal portal", "description": "General notice publisher for internal portal",
"type": "typo3-cms-extension", "type": "typo3-cms-extension",
"keywords": [ "keywords": [
......
...@@ -9,7 +9,7 @@ $EM_CONF[$_EXTKEY] = [ ...@@ -9,7 +9,7 @@ $EM_CONF[$_EXTKEY] = [
'author_company' => 'University of Latvia', 'author_company' => 'University of Latvia',
'state' => 'stable', 'state' => 'stable',
'clearCacheOnLoad' => true, 'clearCacheOnLoad' => true,
'version' => '4.2.0', 'version' => '4.2.1',
'constraints' => [ 'constraints' => [
'depends' => [ 'depends' => [
'typo3' => '9.5.0-10.9.99', 'typo3' => '9.5.0-10.9.99',
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
## Version ## Version
4.2.0 4.2.1
## Dependencies ## Dependencies
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment