lolautruche / EzCoreExtraBundle

Extra features for eZ Platform (v1.x compatible with eZ Publish 5.4)
MIT License
28 stars 8 forks source link

paramProvider not working any more on last eZPlatform #23

Closed flovntp closed 7 years ago

flovntp commented 7 years ago

Since the new QueryType controller has been introduce for override rules in eZ Platform, it's not possible any more to use ParamProvider to inject new variable in a template. Debugger step by step is well going through paramProvider PHP function but array of variables returned are not taken in account.

ezpublish:
    system:
        fre:
            location_view:
                full:
                    site:
                        controller: "ez_query:contentQueryAction"
                        template: "@ezdesign/full/site.html.twig"
                        match:
                            Identifier\ContentType: site
                        params:
                            my_provider: {"provider": "footer_provider"}
                            query:
                                query_type: 'CRParameterProvider:SectionChildren'
                                parameters:
                                    parentLocationId: "@=location.id"
                                    type: ['blog_post']
                                assign_results_to: 'article'

In the final template, if we dump my_provider set in the override rule, we get the text of the paramProvider conf. So, within the site.html.twig template, we've got that result:

array:1 [
  "provider" => "footer_provider"
]

so, now, paramProvider is not replace by it's returned value from PHP code, but as a text variable. (And even if not using the QueryType syntax)

lolautruche commented 7 years ago

This is caused by a bug in ezpublish-kernel: https://jira.ez.no/browse/EZP-27331 Related PR: https://github.com/ezsystems/ezpublish-kernel/pull/1976