agence-adeliom / easy-media-bundle Goto Github PK
View Code? Open in Web Editor NEWA Symfony Media manager bundle for EasyAdmin
License: MIT License
A Symfony Media manager bundle for EasyAdmin
License: MIT License
Is possible to make EasyMediaField multiselect or atleast can i combine somehow EasyMediaField with CollectionField?
btw. thank you alot for great bundle.
greeting Kristijan
There's no point in having a customizable Media entity when the createMedia method creates the entity and then immediately persist is and flushes the DB (which, by the way, is a terrible practice as it can cause unexpected flushes in the middle of a request).
For one it'd be nice if all the createFrom*
methods were public for more granular control by user.
The save issue could be solved in several ways:
createMedia
since it's the programmer's responsibility to manage entities. You don't necessarily want to always immediately persist (and definitely not flush) an entity you create. This is easiest and IMO most correct but breaks BC.createMedia
on whether to save; perhaps just $flush
like you have on other methods. This is a simple solution even if it's not very neat.Hello ! Thans a lot for fixing some issues in the latest updates.
I am now getting this error after updating to latest version (2.0.31) :
Adeliom\EasyMediaBundle\Service\EasyMediaManager::__construct(): Argument #1 ($filesystem) must be of type League\Flysystem\FilesystemOperator, League\Flysystem\Local\LocalFilesystemAdapter given
Is there any support for the EA Trix editor field?
If not, are there any plans to add it? How hard would it be?
`Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! In ArrayNode.php line 226:
!!
!! The child config "media_entity" under "easy_media" must be configured.
!!
!!
!! 2021-11-10T09:05:21+01:00 [info] User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::getContainerExtension()" might add "?ExtensionInterface" as a native return type declaration in the future. Do the same in child class "Adeliom\EasyCommonBundle\EasyCommonBundle" now to avoid errors or add an explicit @return annotation to suppress this message.
!! 2021-11-10T09:05:21+01:00 [info] User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::getContainerExtension()" might add "?ExtensionInterface" as a native return type declaration in the future. Do the same in child class "Adeliom\EasyMediaBundle\EasyMediaBundle" now to avoid errors or add an explicit @return annotation to suppress this message.
!!
Script @auto-scripts was called via post-update-cmd
Installation failed, reverting ./composer.json and ./composer.lock to their original content.`
What can be done?
When I go to a folder, his folderId is stored inside localStorage. It is used then to access the same folder when opening the media library.
But if I delete the folder, the folderId may still be inside the localStorage.
The bundle should check if the doesn't exist then it should load the root of the media library, cause as of today it prevent to do anything.
I think I found a quite impactful logic error in method createFolder
from EasyMediaManager
.
Folder::getPath
is used before setParent
has been called, therefore, if the folder should be nested, the path returned (and then created by the filesystem) is wrong (relative to root instead of parent folder).
Here is the code of the function, I've added comments to explain my point :
public function createFolder(?string $name, ?string $path = null): ?Folder
{
if ('.' === $path) {
$path = '';
}
$class = $this->getHelper()->getFolderClassName();
/** @var Folder $entity */
$entity = new $class();
if ($name) {
$entity->setName($name);
}
$folder = $this->folderByPath($path);
if (false === $folder && !empty($path)) {
$folder = $this->createFolder(basename($path), dirname($path));
}
if (!empty($this->getHelper()->getFolderRepository()->findBy(['parent' => $folder, 'name' => $name]))) {
throw new FolderAlreadyExist($this->translator->trans('error.already_exists', [], 'EasyMediaBundle'));
}
// in the next two lines, getPath only returns slug of $entity since it has no parent yet
if (!$this->filesystem->directoryExists($entity->getPath())) {
$this->filesystem->createDirectory($entity->getPath(), []);
}
$entity->setParent($folder ?: null); // This should be called before
$this->save($entity);
return $entity;
}
This error leads to multiple issue with "File/folder already exists", I would be happy to open a PR if needed.
Probably related to #25
public function configureCrud(): Crud
{
return Crud::new()
->addFormTheme('@EasyCommon/crud/custom_panel.html.twig')
->addFormTheme('@EasyFields/form/choice_mask_widget.html.twig')
;
}
when using custom_panel
with choice_mask_widget
, the panels don't work anymore
Hello,
I get this error :
It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass 'Adeliom\EasyMediaBundle\Entity\Folder#children'
i am using Symfony 6.1 and Easyadmin 4.3.5 and easy-media-bundle 2.0.9
If you have any idea...
Thank you
In src/Service/EasyMediaHelper
, there is this condition inside fileIsType
method.
if ((($type && str_contains((string) $type, 'image')) || in_array($type, $mimes['image'] ?? [])) && 'image' !== $compare) {
return true;
}
This will return true if we compare, for example image/jpeg
with video
.
I think this is not expected and I'd be glad to open a PR in order to fix this but I don't really understand what this condition should be.
Maybe you can help me here @arnaud-ritti ?
Hello,
restriction path for use with path's user is not work ?
When using fosckeditor integration with symfony 6.x, the 'restrict' config cause a BadRequestException when the value is an array.
Symfony\Component\HttpFoundation\Exception\BadRequestException:
Input value "restrict" contains a non-scalar value.
The $request->query->get('restrict') doesn't accept array type as it was deprecated in 5.x and removed in 6.0.
$request->query->all('restrict') should be used instead.
There are no icons displayed in views :
The button close in modals aren't visible as well - class modal-close :before + :after could have a background-color to display the "X"
After installation of this package, I have the following error during symfony cache:clear and anywhere in front
Adeliom\EasyMediaBundle\Service\EasyMediaManager::__construct(): Argument #1 ($filesystem) must be of type League\Flysystem\FilesystemOperator, League\Flysystem\Local\LocalFilesystemAdapter given, called in /var/www/html/francois-rouan/var/cache/dev/ContainerKp7v7sX/getEasyMedia_ManagerService.php on line 34
My config is :
PHP 8.2
Apache2
Symfony 6.4 LTS
When moving a media from the manager, an exception is occuring in this Subscriber
:
Typed property Adeliom\EasyMediaBundle\EventListener\MediaSubscriber::$manager must not be accessed before initialization
The property $manager
is defined, but never initialized, the injected service in the constructor is not used :
class MediaSubscriber implements EventSubscriberInterface
{
protected \Adeliom\EasyMediaBundle\Service\EasyMediaManager $manager;
public function __construct(EasyMediaManager $manager)
{
}
// ...
}
When creating a media, a folder is created.
If I want to create another media with another folder, I can't, because each folder slug must be unique.
Example :
pages/home/media1.jpg
home/media2.jpg
It will create a conflict as media2jpg will have a folder named home-2 for no conflict, but then the path is different from the slug
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.