Open afranioce opened 6 years ago
Same here, is this package still up to date with the last MediaSonataBundle ?
This bundle is currently obselete with last Symfony Core, SonataBundle and CKEditor version. I see at least this issues:
In the meantime, this module is simple, so you can implement the same system in your project. This is what I did:
Hi,
Any news about this issue ?
@filozofer If you solved this issue, is it possible to make a PR ? If not, can you add more details on what you did ?
Hi,
@JonathanBaudoin No news from the mainteners. Sorry, no time to create a real and tested PR but here's a gist I just create in order to help others in the mean time: https://gist.github.com/filozofer/e397a83d44f552bfbcf7f1b325b284c6
Have a good day!
Hi, and sorry for the delay. If someone would work on a PR (and fixing the tests...), it would be very appreciated. Unfortunately we'll not be able to it by ourself any time soon.
Its not compatible with sonata 3.4 and symfony 4.2
This decision works for me:
#config/routes/sonata_media.yaml
#...
# browse & upload routes for CKEditor
admin_sonata_media_media_browser:
path: /admin/sonata/media/media/browser
controller: CoopTilleuls\Bundle\CKEditorSonataMediaBundle\Controller\MediaAdminController::browserAction
defaults:
_sonata_admin: sonata.media.admin.media
admin_sonata_media_media_upload:
path: /admin/sonata/media/media/upload
controller: CoopTilleuls\Bundle\CKEditorSonataMediaBundle\Controller\MediaAdminController::uploadAction
defaults:
_sonata_admin: sonata.media.admin.media
#config/packages/coop_tilleuls_ck_editor_sonata_media.yaml
#override template names for compatibility with symfony 4.2
coop_tilleuls_ck_editor_sonata_media:
templates:
browser: '@CoopTilleulsCKEditorSonataMedia/MediaAdmin/browser.html.twig'
upload: '@CoopTilleulsCKEditorSonataMedia/MediaAdmin/upload.html.twig'
layout: 'sonata/coop_tilleuls_sonata_media/layout.html.twig'
{# templates/sonata/coop_tilleuls_sonata_media/layout.html.twig #}
{# adding Sonata config, for compatibility with sonata 3.4 #}
{% extends '@CoopTilleulsCKEditorSonataMedia/layout.html.twig' %}
{% block meta_tags %}
<meta charset="UTF-8">
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<meta data-sonata-admin='{{ {
config: {
CONFIRM_EXIT: sonata_admin.adminPool.getOption('confirm_exit'),
USE_SELECT2: sonata_admin.adminPool.getOption('use_select2'),
USE_ICHECK: sonata_admin.adminPool.getOption('use_icheck'),
USE_STICKYFORMS: sonata_admin.adminPool.getOption('use_stickyforms'),
DEBUG: sonata_admin.adminPool.getOption('js_debug'),
},
translations: {
CONFIRM_EXIT: 'confirm_exit'|trans({}, 'SonataAdminBundle'),
},
}|json_encode()|raw }}'
>
{% endblock %}
Thanks so much @memboc , I noted that creating the custom layout didn't make any difference + one should install an older version of ckeditor for this bundle to work: php bin/console ckeditor:install --tag=4.7.3
Hi,
On open window to insert image in CKEditor
Url
Pakage
PHP version
Sonata packages
Symfony packages