Skip to content
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

I can't trigger the PRE/POST Execution events #514

Open
BackNot opened this issue Sep 13, 2023 · 3 comments
Open

I can't trigger the PRE/POST Execution events #514

BackNot opened this issue Sep 13, 2023 · 3 comments

Comments

@BackNot
Copy link

BackNot commented Sep 13, 2023

Describe the bug
I want to trigger the events, but it seems that it doesn't happen. If I understood correctly they should be triggered on elfinder actions like "open", etc.

To Reproduce
I use symfony 6.2 and version 12.3 of elfinder bundle.

My fm_elfinder.yaml:

fm_elfinder:
  instances:
    default:
      editor: ckeditor
      cors_support : true 
      connector:
        roots:
          uploads:
            driver : LocalFileSystem
            path : ../uploads
            url : /show
            upload_deny: ['all']
            upload_allow: [
              'text/plain',
              'application/pdf',
              'application/x-pdf',
              'image/bmp',
              'application/msword',
              'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
              'image/gif',
              'image/jpeg',
              'application/vnd.oasis.opendocument.presentation',
              'application/vnd.oasis.opendocument.spreadsheet',
              'application/vnd.oasis.opendocument.text',
              'image/png',
              'application/vnd.ms-powerpoint',
              'application/vnd.openxmlformats-officedocument.presentationml.presentation',
              'application/vnd.ms-excel',
              'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
            ]
            upload_max_size: 10M
            alias: Home

My services.yaml:

  post_execution_listener :
    class : App\EventListener\PostExecutionListener
    tags :
      - { name : fm_elfinder.event_listener, event : fm_elfinder.event.post_execution, method : onPostExecute }

PostExecutionListener:

namespace App\EventListener;

use FM\ElfinderBundle\Event\ElFinderPostExecutionEvent;

class PostExecutionListener
{
    public function onPostExecute(ElFinderPostExecutionEvent $event): void
    {
        dd("HERE");
    }
}

Am I missing something?

Thanks.

@helios-ag
Copy link
Owner

I think they not working right now, they were introduced when we relied on separate elfinder-php lib (that was extracted from original project). Probably if you extend Connector class (or even add there, and create PR), and fire events from there, they will work.

@Daniel-Ovejero
Copy link

Hello any updates on this ?

@BackNot
Copy link
Author

BackNot commented Dec 22, 2023

I could not make the events work. However I accomplished my task by using custom elfinder configurator which is used prior to loading of elfinder:

In fm_elfinder.yaml:

fm_elfinder:
  configuration_provider : elfinder_custom_configurator

services.yaml:

  elfinder_custom_configurator :
    class : App\Folder\ElfinderCustomConfigurator
    arguments : [ "@fm_elfinder.configurator.default" ]

And then in this class I changed some properties of elfinder. I don't know if it is going to be useful in your case.

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

3 participants