Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-26086

Unable to inject additional service or value into QueryType as a service

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 1.4.0, 1.4.1
    • Fix Version/s: 1.5.0, 1.4.2
    • Component/s: None
    • Labels:
      None

      Description

      When working with QueryType as a service, it's impossible to inject anything into this service using constructor or setter (Symfony `caller` method).

      I was trying to create a new QueryType as a service on ezplatform-demo to use it for displaying blog posts on Top Stories section.

      I was trying to inject languages array via Symfony caller method:

      app.blog_posts_query_type:
          class: AppBundle\QueryType\BlogPostsQueryType
          calls:
              - [setLanguages, ["$languages$"]]
          tags:
              - { name: ezpublish.query_type }
      

      Unfortunately setLanguages method is never fired.

      Same for passing variables via constructor - it doesn't work.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            rafal.toborek-obsolete@ez.no RafaƂ Toborek (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: