Commit c550d0ff by Krzysztof Kuźniar

Update module - fix media dir

parent 40969271
......@@ -17,6 +17,7 @@ use Doctrine\ORM\Tools\Pagination\Paginator;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Webkul\DamBundle\Services\DamServices;
use Webkul\DamBundle\Context\Akeneo3\UserContext;
use Akeneo\Pim\Enrichment\Component\FileStorage;
/**
* Assets Controller
......@@ -426,7 +427,7 @@ class AssetsController extends Controller
// } else {
// $fst = $this->filesystemprovider->sys_get_temp_dir();
// }
$fsc = $this->filesystemprovider->getFilesystem(\FileStorage::CATALOG_STORAGE_ALIAS);
$fsc = $this->filesystemprovider->getFilesystem(FileStorage::CATALOG_STORAGE_ALIAS);
$checkMedia = $this->damservices->getMediaByFilepath($params['filePath']);
$em = $this->getDoctrine()->getManager();
......@@ -476,7 +477,7 @@ class AssetsController extends Controller
*/
protected function storeFile(UploadedFile $uploadedFile)
{
return $this->filestorer->store($uploadedFile, \FileStorage::CATALOG_STORAGE_ALIAS);
return $this->filestorer->store($uploadedFile, FileStorage::CATALOG_STORAGE_ALIAS);
}
public function checkCredentialAction(Request $request)
......
......@@ -17,6 +17,7 @@ use Doctrine\ORM\Tools\Pagination\Paginator;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Webkul\DamBundle\Services\DamServices;
use Webkul\DamBundle\Context\UserContext;
use Akeneo\Pim\Enrichment\Component\FileStorage;
/**
* Assets Controller
......@@ -423,7 +424,7 @@ class AssetsController extends Controller
$checkMedia = $this->damservices->getMediaByFilepath($params['filePath']);
$fsc = $this->filesystemprovider->getFilesystem(\FileStorage::CATALOG_STORAGE_ALIAS);
$fsc = $this->filesystemprovider->getFilesystem(FileStorage::CATALOG_STORAGE_ALIAS);
$em = $this->getDoctrine()->getManager();
if ($checkMedia) {
$originalName = $checkMedia->getOriginalFilename();
......@@ -469,7 +470,7 @@ class AssetsController extends Controller
*/
protected function storeFile(UploadedFile $uploadedFile)
{
return $this->filestorer->store($uploadedFile, \FileStorage::CATALOG_STORAGE_ALIAS);
return $this->filestorer->store($uploadedFile, FileStorage::CATALOG_STORAGE_ALIAS);
}
public function checkCredentialAction(Request $request)
......
......@@ -18,6 +18,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
use Webkul\DamBundle\Services\DamServices;
use Webkul\DamBundle\Context\UserContext;
use Webkul\DamBundle\Listener\ClassDefinationForCompatibility;
use Akeneo\Pim\Enrichment\Component\FileStorage;
$versionCompatiblility = new ClassDefinationForCompatibility();
$versionCompatiblility->createClassAliases();
......@@ -438,7 +439,7 @@ class AssetsController extends Controller
$checkMedia = $this->damservices->getMediaByFilepath($params['filePath']);
$fsc = $this->filesystemprovider->getFilesystem(\FileStorage::CATALOG_STORAGE_ALIAS);
$fsc = $this->filesystemprovider->getFilesystem(FileStorage::CATALOG_STORAGE_ALIAS);
$em = $this->getDoctrine()->getManager();
if ($checkMedia) {
$originalName = $checkMedia->getOriginalFilename();
......@@ -484,7 +485,7 @@ class AssetsController extends Controller
*/
protected function storeFile(UploadedFile $uploadedFile)
{
return $this->filestorer->store($uploadedFile, \FileStorage::CATALOG_STORAGE_ALIAS);
return $this->filestorer->store($uploadedFile, FileStorage::CATALOG_STORAGE_ALIAS);
}
public function checkCredentialAction(Request $request)
......
......@@ -17,6 +17,8 @@ use Doctrine\ORM\Tools\Pagination\Paginator;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Webkul\DamBundle\Services\DamServices;
use Webkul\DamBundle\Context\UserContext;
use Akeneo\Pim\Enrichment\Component\FileStorage;
/**
* Assets Controller
*
......@@ -414,7 +416,7 @@ class AssetsController extends Controller
} else {
$fst = $this->filesystemprovider->sys_get_temp_dir();
}
$fsc = $this->filesystemprovider->getFilesystem(\FileStorage::CATALOG_STORAGE_ALIAS);
$fsc = $this->filesystemprovider->getFilesystem(FileStorage::CATALOG_STORAGE_ALIAS);
$checkMedia = $this->damservices->getMediaByFilepath($params['filePath']);
$em = $this->getDoctrine()->getManager();
......@@ -464,7 +466,7 @@ class AssetsController extends Controller
*/
protected function storeFile(UploadedFile $uploadedFile)
{
return $this->filestorer->store($uploadedFile, \FileStorage::CATALOG_STORAGE_ALIAS);
return $this->filestorer->store($uploadedFile, FileStorage::CATALOG_STORAGE_ALIAS);
}
public function checkCredentialAction(Request $request)
......
......@@ -9,6 +9,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Webkul\DamBundle\Listener\ClassDefinationForCompatibility;
use Akeneo\Pim\Enrichment\Component\FileStorage;
$versionCompatiblility = new ClassDefinationForCompatibility();
$versionCompatiblility->createClassAliases();
......@@ -91,6 +92,6 @@ class PostMediaController
*/
protected function storeFile(UploadedFile $uploadedFile)
{
return $this->fileStorer->store($uploadedFile, \FileStorage::CATALOG_STORAGE_ALIAS);
return $this->fileStorer->store($uploadedFile, FileStorage::CATALOG_STORAGE_ALIAS);
}
}
......@@ -14,6 +14,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Component\Filesystem\Filesystem;
use Webkul\DamBundle\Listener\ClassDefinationForCompatibility;
use Akeneo\Pim\Enrichment\Component\FileStorage;
$versionCompatiblility = new ClassDefinationForCompatibility();
$versionCompatiblility->createClassAliases();
......@@ -331,6 +332,6 @@ class AssetUpdater implements \ObjectUpdaterInterface
*/
protected function storeFile(UploadedFile $uploadedFile)
{
return $this->fileStorer->store($uploadedFile, \FileStorage::CATALOG_STORAGE_ALIAS);
return $this->fileStorer->store($uploadedFile, FileStorage::CATALOG_STORAGE_ALIAS);
}
}
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