8000 Allow array return from Twig workflow_metadata() · Issue #36391 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Allow array return from Twig workflow_metadata() #36391
Closed
@gisostallenberg

Description

@gisostallenberg

Description
The workflow metadata store can contain not only strings, but setting nested metadata results in an error when workflow_metadata() is used in Twig.
image

Example
This example is made up, but I had a case in my project where I expected this working, but got an error. In some issues reported in Symfony I see people using deeper nested metadata (but apparently they do not use the Twig function, yet...)

framework:
    workflows:
        blog_publishing:
                # ...
            transitions:
                to_review:
                    from: draft
                    to:   review
                    metadata:
                        publish:
                            label: Publish
                            icon: paper

I suggest removing the return type at

public function getMetadata(object $subject, string $key, $metadataSubject = null, string $name = null): ?string
, or some other change which avoids an error in Twig.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0