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

Allow injecting arrays and other types as a QueryTypes parameters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 1.7.0-rc1
    • Fix Version/s: 1.7.1, 1.8.0
    • Component/s: None
    • Labels:

      Description

      When I try to inject array as a QueryType parameter I get:

      Warning: substr() expects parameter 1 to be string, array given
      

      Stacktrace:

      [1] Symfony\Component\Debug\Exception\ContextErrorException: Warning: substr() expects parameter 1 to be string, array given
          at n/a
              in /Users/clash82/Documents/workspace/ezplatform.lh/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/QueryType/QueryParameterContentViewQueryTypeMapper.php line 70
      
          at Symfony\Component\Debug\ErrorHandler->handleError('2', 'substr() expects parameter 1 to be string, array given', '/Users/clash82/Documents/workspace/ezplatform.lh/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/QueryType/QueryParameterContentViewQueryTypeMapper.php', '70', array('contentView' => object(ContentView), 'queryParameterValue' => array('layout', 'article')))
              in  line 
      
          at substr(array('layout', 'article'), '0', '2')
              in /Users/clash82/Documents/workspace/ezplatform.lh/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/QueryType/QueryParameterContentViewQueryTypeMapper.php line 70
      
          at eZ\Publish\Core\QueryType\QueryParameterContentViewQueryTypeMapper->evaluateExpression(object(ContentView), array('layout', 'article'))
              in /Users/clash82/Documents/workspace/ezplatform.lh/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/QueryType/QueryParameterContentViewQueryTypeMapper.php line 55
      
          at eZ\Publish\Core\QueryType\QueryParameterContentViewQueryTypeMapper->extractParameters(object(ContentView))
              in /Users/clash82/Documents/workspace/ezplatform.lh/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/QueryType/QueryParameterContentViewQueryTypeMapper.php line 40
      
          at eZ\Publish\Core\QueryType\QueryParameterContentViewQueryTypeMapper->map(object(ContentView))
              in /Users/clash82/Documents/workspace/ezplatform.lh/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/Controller/Content/QueryController.php line 80
      
          at eZ\Publish\Core\MVC\Symfony\Controller\Content\QueryController->runQuery(object(ContentView), 'findLocations')
              in /Users/clash82/Documents/workspace/ezplatform.lh/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/Controller/Content/QueryController.php line 53
      
          at eZ\Publish\Core\MVC\Symfony\Controller\Content\QueryController->locationQueryAction(object(ContentView))
              in  line 
      
          at call_user_func_array(array(object(QueryController), 'LocationQueryAction'), array(object(ContentView)))
              in /Users/clash82/Documents/workspace/ezplatform.lh/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 144
      
          at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
              in /Users/clash82/Documents/workspace/ezplatform.lh/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 64
      
          at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
              in /Users/clash82/Documents/workspace/ezplatform.lh/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php line 69
      
          at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
              in /Users/clash82/Documents/workspace/ezplatform.lh/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php line 185
      
          at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
              in /Users/clash82/Documents/workspace/ezplatform.lh/web/app.php line 67
      

      Working example can be found in here: https://github.com/ezsystems/ezplatform-com/pull/58

        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: