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

Inheritance issue setting up a custom workflow channel #493

Closed
bbdammert opened this issue Nov 21, 2024 · 1 comment
Closed

Inheritance issue setting up a custom workflow channel #493

bbdammert opened this issue Nov 21, 2024 · 1 comment
Labels
Milestone

Comments

@bbdammert
Copy link

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no

Environment: Pimcore 11.3.1, FormBuilderBundle 5.1.4

I'm trying to setup a custom workflow channel, following the steps described in the documentation.

The first issue is with the documentation itself: using the code examples without any changes and registering the ExtJS class using the \Pimcore\Event\BundleManagerEvents::JS_PATHS event, results in an internal error, as \App\FormBuilder\MyChannel::getUsedFormFieldNames() and \App\FormBuilder\MyChannel::dispatchOutputProcessing() lack the required return types.

After adding the return types, I see the new workflow channel in the workflow settings of a form. Selecting it, results in a Javascript error message: Uncaught TypeError: channelConfigPanel.setVirtualFunnelAware is not a function. It seems, inheritance doesn't work.

Changing the name in the ExtJS class to Formbuilder.extjs.formPanel.outputWorkflow.channel.my (i.e. removing the Channel suffix as with the integrated workflow channels) removes this error. But then, no configuration is found (message
No configuration for myChannel found. instead of the configuration form). Additionally removing the Channel suffix in the service registration in services.yaml, makes the initial Javascript error message reappear.

@solverat solverat added the bug label Nov 26, 2024
@solverat solverat added this to the 5.1.5 milestone Nov 26, 2024
@solverat
Copy link
Member

@bbdammert Thanks for your Report.

I'll update the docs, since they seem to be a bit outdated. However, your ExtJs issue is a priority problem!

    public static function getSubscribedEvents(): array
    {
        return [
            # make sure, the priority is low to load fb resources first!
            BundleManagerEvents::JS_PATHS => ['addJsFiles', -255], 
        ];
    }

    public function addJsFiles(PathsEvent $event): void
    {
        $event->addPaths([
            '/path/to/your/channel.js'
        ]);
    }

I just checked it by myself and everything works as expected:

image

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

No branches or pull requests

2 participants