Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Upgrade Notes

## 5.3.1
- **[BUGFIX]** [FUNNEL] Add channel context handling to FunnelWorker [#518](https://github.com/dachcom-digital/pimcore-formbuilder/issues/518)
- **[BUGFIX]** [FUNNEL] Render `_token` in funnel base template if available and renderable

## 5.3.0
- **[IMPROVEMENT]** New field added to `form_builder_form_attributes`: `autocomplete`
- **[BUGFIX]** Solidify check for empty value in output transformer [#486](https://github.com/dachcom-digital/pimcore-formbuilder/issues/508)
Expand Down
8 changes: 8 additions & 0 deletions src/OutputWorkflow/FunnelWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
use FormBuilderBundle\Model\FunnelActionElement;
use FormBuilderBundle\Model\OutputWorkflowChannelInterface;
use FormBuilderBundle\Model\OutputWorkflowInterface;
use FormBuilderBundle\OutputWorkflow\Channel\ChannelContext;
use FormBuilderBundle\OutputWorkflow\Channel\ChannelContextAwareInterface;
use FormBuilderBundle\OutputWorkflow\Channel\ChannelResponseAwareInterface;
use FormBuilderBundle\OutputWorkflow\Channel\Funnel\Action\FunnelActionElementStack;
use FormBuilderBundle\OutputWorkflow\Channel\FunnelAwareChannelInterface;
Expand Down Expand Up @@ -164,13 +166,19 @@ protected function processDataFunnel(FunnelWorkerData $funnelWorkerData): Respon
$dataChannelResponse = null;
$channelProcessor = $funnelWorkerData->getChannelProcessor();

$channelContext = new ChannelContext();

try {
$arguments = [
$funnelWorkerData->getSubmissionEvent(),
$funnelWorkerData->getOutputWorkflow()->getName(),
$funnelWorkerData->getChannel()->getConfiguration()
];

if ($channelProcessor instanceof ChannelContextAwareInterface) {
$channelProcessor->setChannelContext($channelContext);
}

if ($channelProcessor instanceof ChannelResponseAwareInterface) {
$dataChannelResponse = $channelProcessor->dispatchResponseOutputProcessing(...$arguments);
} else {
Expand Down
2 changes: 2 additions & 0 deletions src/Registry/ConditionalLogicRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ public function register(string $identifier, mixed $service, ?string $type = nul

if (!is_null($service)) {
$interfaceReference = $type . 'Interface';
/* @phpstan-ignore-next-line */
if (!in_array($this->{$interfaceReference}, class_implements($service), true)) {
throw new \InvalidArgumentException(
/* @phpstan-ignore-next-line */
sprintf('%s needs to implement "%s", "%s" given.', get_class($service), $this->{$interfaceReference}, implode(', ', class_implements($service)))
);
}
Expand Down
4 changes: 4 additions & 0 deletions templates/funnel/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
{{ view|raw }}
{% endif %}

{% if form._token is defined and not form._token.isRendered %}
{{ form_widget(form._token) }}
{% endif %}

{{ form_end(form, {render_rest: formRenderRest}) }}

{% endblock funnel_content %}