coopTilleuls / CoopTilleulsCKEditorSonataMediaBundle

Integrates SonataMediaBundle for Symfony with CKEditor
http://les-tilleuls.coop
MIT License
53 stars 41 forks source link

Error: Method browserAction does not exist #32

Open afranioce opened 6 years ago

afranioce commented 6 years ago

Hi,

On open window to insert image in CKEditor

Url

http://127.0.0.1:8000/admin/sonata/media/media/browser?provider=sonata.media.provider.image&context=editor&CKEditor=question_data_text&CKEditorFuncNum=89&langCode=pt-br

Pakage

$ composer show --latest 'tilleuls/*'
tilleuls/ckeditor-sonata-media-bundle v1.0.8 v1.0.8 Integrates SonataMediaBundle with CKEditor

PHP version

$ php -v
PHP 7.2.7 (cli) (built: Jun 24 2018 18:52:09) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

Sonata packages

$ composer show --latest 'sonata-project/*'
sonata-project/admin-bundle              3.35.2 3.35.2 The missing Symfony Admin Generator
sonata-project/block-bundle              3.12.1 3.12.1 Symfony SonataBlockBundle
sonata-project/cache                     2.0.1  2.0.1  Cache library
sonata-project/core-bundle               3.10.0 3.10.0 Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.3.1  2.3.1  Symfony SonataDatagridBundle
sonata-project/doctrine-extensions       1.0.2  1.0.2  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.6.1  3.6.1  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/easy-extends-bundle       2.5.0  2.5.0  Symfony SonataEasyExtendsBundle
sonata-project/exporter                  1.9.0  1.9.0  Lightweight Exporter library
sonata-project/media-bundle              3.13.1 3.13.1 Symfony SonataMediaBundle
sonata-project/user-bundle               4.2.2  4.2.2  Symfony SonataUserBundle

Symfony packages

$ composer show --latest 'symfony/*'
symfony/asset                v4.1.0             v4.1.1             Symfony Asset Component
symfony/browser-kit          v4.1.0             v4.1.1             Symfony BrowserKit Component
symfony/cache                v4.1.0             v4.1.1             Symfony Cache component with PSR-6, PSR-16, and tags
symfony/class-loader         v3.4.11            v3.4.12            Symfony ClassLoader Component
symfony/config               v4.1.0             v4.1.1             Symfony Config Component
symfony/console              v4.1.0             v4.1.1             Symfony Console Component
symfony/css-selector         v4.1.0             v4.1.1             Symfony CssSelector Component
symfony/debug                v4.1.0             v4.1.1             Symfony Debug Component
symfony/debug-bundle         v4.1.0             v4.1.1             Symfony DebugBundle
symfony/debug-pack           v1.0.5             v1.0.5             A debug pack for Symfony projects
symfony/dependency-injection v4.1.0             v4.1.1             Symfony DependencyInjection Component
symfony/doctrine-bridge      v4.1.0             v4.1.1             Symfony Doctrine Bridge
symfony/dom-crawler          v4.1.0             v4.1.1             Symfony DomCrawler Component
symfony/dotenv               v4.1.0             v4.1.1             Registers environment variables from a .env file
symfony/event-dispatcher     v4.1.0             v4.1.1             Symfony EventDispatcher Component
symfony/expression-language  v4.1.0             v4.1.1             Symfony ExpressionLanguage Component
symfony/filesystem           v4.1.0             v4.1.1             Symfony Filesystem Component
symfony/finder               v4.1.0             v4.1.1             Symfony Finder Component
symfony/flex                 v1.0.80            v1.0.80           
symfony/form                 v4.1.0             v4.1.1             Symfony Form Component
symfony/framework-bundle     v4.1.0             v4.1.1             Symfony FrameworkBundle
symfony/http-foundation      v4.1.0             v4.1.1             Symfony HttpFoundation Component
symfony/http-kernel          v4.1.0             v4.1.1             Symfony HttpKernel Component
symfony/inflector            v4.1.0             v4.1.1             Symfony Inflector Component
symfony/intl                 v4.1.0             v4.1.1             A PHP replacement layer for the C intl extension that includes addi...
symfony/lts                  dev-master 6de50b2 dev-master 6de50b2 Enforces Long Term Supported versions of Symfony components
symfony/maker-bundle         v1.5.0             v1.5.0             Symfony Maker helps you create empty commands, controllers, form cl...
symfony/monolog-bridge       v4.1.0             v4.1.1             Symfony Monolog Bridge
symfony/monolog-bundle       v3.3.0             v3.3.0             Symfony MonologBundle
symfony/options-resolver     v4.1.0             v4.1.1             Symfony OptionsResolver Component
symfony/orm-pack             v1.0.5             v1.0.5             A pack for the Doctrine ORM
symfony/phpunit-bridge       v4.1.0             v4.1.1             Symfony PHPUnit Bridge
symfony/polyfill-ctype       v1.8.0             v1.8.0             Symfony polyfill for ctype functions
symfony/polyfill-intl-icu    v1.8.0             v1.8.0             Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring    v1.8.0             v1.8.0             Symfony polyfill for the Mbstring extension
symfony/polyfill-php72       v1.8.0             v1.8.0             Symfony polyfill backporting some PHP 7.2+ features to lower PHP ve...
symfony/process              v4.1.0             v4.1.1             Symfony Process Component
symfony/profiler-pack        v1.0.3             v1.0.3             A pack for the Symfony web profiler
symfony/property-access      v4.1.0             v4.1.1             Symfony PropertyAccess Component
symfony/property-info        v4.1.0             v4.1.1             Symfony Property Info Component
symfony/routing              v4.1.0             v4.1.1             Symfony Routing Component
symfony/security             v4.1.0             v4.1.1             Symfony Security Component
symfony/security-acl         v3.0.1             v3.0.1             Symfony Security Component - ACL (Access Control List)
symfony/security-bundle      v4.1.0             v4.1.1             Symfony SecurityBundle
symfony/serializer           v4.1.0             v4.1.1             Symfony Serializer Component
symfony/serializer-pack      v1.0.1             v1.0.1             A pack for the Symfony serializer
symfony/stopwatch            v4.1.0             v4.1.1             Symfony Stopwatch Component
symfony/swiftmailer-bundle   v3.2.2             v3.2.2             Symfony SwiftmailerBundle
symfony/templating           v4.1.0             v4.1.1             Symfony Templating Component
symfony/translation          v4.1.0             v4.1.1             Symfony Translation Component
symfony/twig-bridge          v4.1.0             v4.1.1             Symfony Twig Bridge
symfony/twig-bundle          v4.1.0             v4.1.1             Symfony TwigBundle
symfony/validator            v4.1.0             v4.1.1             Symfony Validator Component
symfony/var-dumper           v4.1.0             v4.1.1             Symfony mechanism for exploring and dumping PHP variables
symfony/web-link             v4.1.0             v4.1.1             Symfony WebLink Component
symfony/web-profiler-bundle  v4.1.0             v4.1.1             Symfony WebProfilerBundle
symfony/web-server-bundle    v4.1.0             v4.1.1             Symfony WebServerBundle
symfony/webpack-encore-pack  v1.0.2             v1.0.2             A pack for Symfony Encore
symfony/yaml                 v4.1.0             v4.1.1             Symfony Yaml Component
filozofer commented 6 years ago

Same here, is this package still up to date with the last MediaSonataBundle ?

filozofer commented 6 years ago

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:

JonathanBaudoin commented 6 years ago

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 ?

filozofer commented 6 years ago

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!

dunglas commented 6 years ago

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.

memboc commented 5 years ago

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 %}
roelleor commented 3 years ago

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