Closed JonathanBaudoin closed 4 years ago
Hi, i have tryied your solution but it doesn't work than expected ! However, i have found this (just above):
$category = null;
if ($this->container->has('sonata.media.manager.category')) {
$category = $this->container->get('sonata.media.manager.category')->getRootCategory($context);
}
I think the category media manager is not in Sonata Media but in Sonata Classification.
$category = null;
if ($this->container->has('sonata.classification.manager.category')) {
$category = $this->container->get('sonata.classification.manager.category')->getRootCategory($context);
}
It work's ! Hope this will be usefull !
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Environment
Sonata packages
Symfony packages
PHP version
Subject
Hi,
I use a CKEditor type in a textarea in the
configureFormFields()
. It works, except the image browser.When I want to add an image in my textarea, a modal opens, with a button to browse my images. I can see images from default context (which is defined in the
ivory_ck_editor
config as default context), but not images from an other context. It's because in the URL, thecategory
param is always set to thedefault
context category, even when I choose an other context. I specify that all my images have categories.I try to edit
SonataFormatterBundle/Controller/CkeditorAdminController:browserAction
at line 60:And it works, I can see my images when I change context. But I can't use this solution in a long time. I saw this issue, which seems to be the same, but it seems to be unresolved yet.