Skip to content

Unrecognized options "instances" under "fm_elfinder" #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nielvrom opened this issue Aug 21, 2014 · 11 comments
Closed

Unrecognized options "instances" under "fm_elfinder" #67

nielvrom opened this issue Aug 21, 2014 · 11 comments

Comments

@nielvrom
Copy link

When I'm trying "Basic configuration" step and add the following to my config.yml:

fm_elfinder:
instances:
default:
locale: %locale% # defaults to current request locale
editor: ckeditor # other choices are tinymce or simple
showhidden: false # defaults to false
fullscreen: true # defaults true, applies to simple and ckeditor editors
include_assets: true # disable if you want to handle loading of the javascript and css assets yourself
compression: false # enable if you configured the uglifycss and uglifyjs2 assetic filters and want compression
connector:
debug: false # defaults to false
roots: # at least one root must be defined
uploads:
driver: LocalFileSystem
path: uploads
upload_allow: ['image/png', 'image/jpg', 'image/jpeg']
upload_deny: ['all']
upload_max_size: 2M

then I get the following error: Unrecognized options "instances" under "fm_elfinder".

What am I doing wrong?

@helios-ag
Copy link
Owner

Hi @nielvrom, what version of bundle have you installed? "Instances" option only available under 2.x version/branch (and master branch).

@nielvrom
Copy link
Author

I was using an older version. But when I try version 2.x I get the following errors trying composer update:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
The child node "instances" at path "fm_elfinder" must be configured.

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception

[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.

@helios-ag
Copy link
Owner

Well, you need to define at least one instance (under instances node) to use bundle. Check your intendation, i.e.

fm_elfinder:
    instances:
        default:
            locale: .... 

@nielvrom
Copy link
Author

In my config.yml I now have :

fm_elfinder:
    instances:
        default:
            locale: %locale% # defaults to current request locale
            editor: ckeditor # other choices are tinymce or simple
            #showhidden: false # defaults to false
            fullscreen: true # defaults true, applies to simple and ckeditor editors
            include_assets: true # disable if you want to handle loading of the javascript and css assets yourself
            compression: false # enable if you configured the uglifycss and uglifyjs2 assetic filters and want compression
            connector:
                debug: false # defaults to false
                roots:       # at least one root must be defined
                    uploads:
                        driver: LocalFileSystem
                        path: uploads
                        upload_allow: ['image/png', 'image/jpg', 'image/jpeg']
                        upload_deny: ['all']
                        upload_max_size: 2M

ivory_ck_editor:
    default_config: default
    configs:
        default:
            filebrowserBrowseRoute: elfinder
            filebrowserBrowseRouteParameters:
                instance: ckeditor

In my ArticleType (Form Type) I have:

->add('content', 'ckeditor', array(
    'filebrowser_image_browse_url' => array(
        'route'            => 'elfinder',
        'route_parameters' => array('instance' => 'ckeditor'),
    ),
))

But I get the following error:

The option "ivory_ck_editor" does not exist. 

What am I doing wrong?

@helios-ag
Copy link
Owner

Have you installed ivoryckeditorbundle and registered in AppKernel.php?

@nielvrom
Copy link
Author

Yes, I'm sorry but the error was:
The option "filebrowser_image_browse_url" does not exist.

@helios-ag
Copy link
Owner

In your form type, just add

->add('content', 'ckeditor')

It would be enough

@nielvrom
Copy link
Author

Thanks, now I can see the button "browse on server" when I try to upload an image. But when I click on it I get the error:
Notice: Undefined index: ckeditor in /Applications/MAMP/htdocs/myproject/vendor/helios-ag/fm-elfinder-bundle/Controller/ElFinderController.php line 25

@helios-ag
Copy link
Owner

Oh, i see

ivory_ck_editor:
    default_config: default
    configs:
        default:
            filebrowserBrowseRoute: elfinder
            filebrowserBrowseRouteParameters:
                instance: ckeditor <<--- your instance called default, change this

@nielvrom
Copy link
Author

Thanks! Works perfect now!

@helios-ag
Copy link
Owner

Issue is resolved, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants