Commit fa14ac42 by Krzysztof Kuźniar

Update module - fix media dir #2

parent c550d0ff
......@@ -17,7 +17,6 @@ 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
......@@ -427,7 +426,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();
......@@ -477,7 +476,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,7 +17,6 @@ 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
......@@ -424,7 +423,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();
......@@ -470,7 +469,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,7 +18,6 @@ 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();
......@@ -439,7 +438,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();
......@@ -485,7 +484,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,8 +17,6 @@ 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
*
......@@ -416,7 +414,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();
......@@ -466,7 +464,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,7 +9,6 @@ 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();
......@@ -92,6 +91,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);
}
}
......@@ -518,7 +518,7 @@ define([
this.setCurrentValue(value);
}.bind(this));
} else {
this.setCurrentValue(value);
this.setCurrentValue(values);
}
},
......
......@@ -620,4 +620,5 @@ class DamServices
return $code;
}
}
......@@ -14,7 +14,6 @@ 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();
......@@ -332,6 +331,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