egeloen / IvoryCKEditorBundle

Provides a CKEditor integration for your Symfony project.
MIT License
336 stars 114 forks source link

Unknown "form_javascript" function #235

Closed plozmun closed 8 years ago

plozmun commented 8 years ago

I am using the 4.0.2 version with Symfony 3.0.4 and i get this error: Unknown "form_javascript" function in IvoryCKEditorBundle:Form:javascript.html.twig at line 3.

egeloen commented 8 years ago

How do you render your form? DO you use the async feature? Basically, I need more informations in order to understand what's goind on :)

plozmun commented 8 years ago

No, i am using the default config.

In fact the error comes in another form where i dont use the CKEditor field.

This is my config section:

ivory_ck_editor:
    default_config: minimal
    plugins:
        uploadimage:
            path:     "/ckeditor/plugins/uploadimage/"
            filename: "plugin.js"
        widget:
            path:     "/ckeditor/plugins/widget/"
            filename: "plugin.js"
        image2:
            path:     "/ckeditor/plugins/image2/"
            filename: "plugin.js"
        uploadwidget:
            path:     "/ckeditor/plugins/uploadwidget/"
            filename: "plugin.js"
        clipboard:
            path:     "/ckeditor/plugins/clipboard/"
            filename: "plugin.js"
        lineutils:
            path:     "/ckeditor/plugins/lineutils/"
            filename: "plugin.js"
        filetools:
            path:     "/ckeditor/plugins/filetools/"
            filename: "plugin.js"
        notificationaggregator:
            path:     "/ckeditor/plugins/notificationaggregator/"
            filename: "plugin.js"
        notification:
            path:     "/ckeditor/plugins/notification/"
            filename: "plugin.js"
    configs:
        minimal:
            skin: "flat,/ckeditor/skins/flat/"
            extraPlugins:   'uploadimage,image2'
egeloen commented 8 years ago

Ok thanks for you're quick feedback :) I got the problem but I need to find the good way to fix it... The problem is the form_javascript block will never be used by your code but it will be compiled by twig anyway (regardless it is used or not)... So, since the missing function is shipped in a third party bundle, twig is not able to compile the template and end up with your error...

plozmun commented 8 years ago

Great!

egeloen commented 8 years ago

@plozmun Can you give a try to the referenced PR? Just need to add/replace the following in your composer.json:

{
    "require": {
        "egeloen/ckeditor-bundle": "dev-form-javascript"
    }
}
plozmun commented 8 years ago

It works!

egeloen commented 8 years ago

@plozmun Your issue has been fixed in the referenced PR and is part of the new release.