Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: High High
    • Resolution: Fixed
    • Affects Version/s: 5.1, 5.2-alpha1, 2013.07, 5.2-beta1
    • Fix Version/s: Customer request, 5.2-rc1
    • Component/s: Platform stack
    • Labels:
    • Environment:

      eZ Publish 5.1 with eZ Demo

      Description

      The usage of Compound\LogicalAnd matching system is broken when using ESI or Hinclude subrequests.
      The following exception is thrown:

      Exception: Serialization of 'Closure' is not allowed at /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Fragment/FragmentUriGenerator.php:31

      steps to reproduce:

      . configure eZ Publish 5.1 with eZ Demo (it uses an hinclude subrequest)
      . configure match as below

              match:
                  Compound\LogicalAnd:
                      -
                          matchers:
                              Map\URI:
                                  the_front: true
                              Map\Host:
                                  <somehost>: true
                          match: ezdemo_site_user
                      -
                          matchers:
                              Map\URI:
                                  the_back: true
                              Map\Host:
                                  <somehost>: true
                          match: ezdemo_site_admin
      

      Opening <somehost>/the_back will work as expected (admin interface, which is run in legacy => no subrequest)
      Opening <somehost>/the_front won't work (the exception will be thrown)

        Issue Links

          Activity

          Hide
          Joaquim Cavalleri (Inactive) added a comment - - edited

          [2013-09-24 18:31:29] app.INFO: Router eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter was not able to match, message "" [] []
          [2013-09-24 18:31:29] app.INFO: UrlAlias matched location #2. Forwarding to ViewController [] []
          [2013-09-24 18:31:29] request.INFO: Matched route "ez_urlalias" (parameters: "_route": "ez_urlalias", "_controller": "ez_content:viewLocation", "locationId": "2", "viewType": "full", "layout": "true") [] []
          [2013-09-24 18:31:29] security.DEBUG: Read SecurityContext from the session [] []
          [2013-09-24 18:31:29] security.DEBUG: Reloading user from user provider. [] []
          [2013-09-24 18:31:29] security.DEBUG: Username "anonymous" was reloaded from user provider. [] []
          [2013-09-24 18:31:29] app.DEBUG: Checking secure context token: PreAuthenticatedToken(user="anonymous", authenticated=false, roles="") [] []
          [2013-09-24 18:31:29] app.DEBUG: Trying to pre-authenticate user "-1" [] []
          [2013-09-24 18:31:29] app.INFO: Authentication success: PreAuthenticatedToken(user="anonymous", authenticated=false, roles="") [] []
          [2013-09-24 18:31:29] app.NOTICE: 'location' is not scalar, cannot pass it to legacy content module. Skipping. ["eZ\\Publish\\Core\\MVC\\Legacy\\View\\Provider\\Location::eZ\\Publish\\Core\\MVC\\Legacy\\View\\Provider\\{closure}"] []
          [2013-09-24 18:31:29] app.NOTICE: 'content' is not scalar, cannot pass it to legacy content module. Skipping. ["eZ\\Publish\\Core\\MVC\\Legacy\\View\\Provider\\Location::eZ\\Publish\\Core\\MVC\\Legacy\\View\\Provider\\{closure}"] []
          [2013-09-24 18:31:29] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("SplObjectStorage::serialize() must return a string or NULL") in "{% extends "eZDemoBundle::pagelayout.html.twig" %}
          

          (...}

          Exception: Serialization of 'Closure' is not allowed at /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Fragment/FragmentUriGenerator.php:31, Exception: Serialization of 'Closure' is not allowed at /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Fragment/FragmentUriGenerator.php:31, Exception: Serialization of 'Closure' is not allowed at /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Fragment/FragmentUriGenerator.php:31)"} []
          

          Show
          Joaquim Cavalleri (Inactive) added a comment - - edited [2013-09-24 18:31:29] app.INFO: Router eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter was not able to match, message "" [] [] [2013-09-24 18:31:29] app.INFO: UrlAlias matched location #2. Forwarding to ViewController [] [] [2013-09-24 18:31:29] request.INFO: Matched route "ez_urlalias" (parameters: "_route": "ez_urlalias", "_controller": "ez_content:viewLocation", "locationId": "2", "viewType": "full", "layout": "true") [] [] [2013-09-24 18:31:29] security.DEBUG: Read SecurityContext from the session [] [] [2013-09-24 18:31:29] security.DEBUG: Reloading user from user provider. [] [] [2013-09-24 18:31:29] security.DEBUG: Username "anonymous" was reloaded from user provider. [] [] [2013-09-24 18:31:29] app.DEBUG: Checking secure context token: PreAuthenticatedToken(user="anonymous", authenticated=false, roles="") [] [] [2013-09-24 18:31:29] app.DEBUG: Trying to pre-authenticate user "-1" [] [] [2013-09-24 18:31:29] app.INFO: Authentication success: PreAuthenticatedToken(user="anonymous", authenticated=false, roles="") [] [] [2013-09-24 18:31:29] app.NOTICE: 'location' is not scalar, cannot pass it to legacy content module. Skipping. ["eZ\\Publish\\Core\\MVC\\Legacy\\View\\Provider\\Location::eZ\\Publish\\Core\\MVC\\Legacy\\View\\Provider\\{closure}"] [] [2013-09-24 18:31:29] app.NOTICE: 'content' is not scalar, cannot pass it to legacy content module. Skipping. ["eZ\\Publish\\Core\\MVC\\Legacy\\View\\Provider\\Location::eZ\\Publish\\Core\\MVC\\Legacy\\View\\Provider\\{closure}"] [] [2013-09-24 18:31:29] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("SplObjectStorage::serialize() must return a string or NULL") in "{% extends "eZDemoBundle::pagelayout.html.twig" %} (...} Exception: Serialization of 'Closure' is not allowed at /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Fragment/FragmentUriGenerator.php:31, Exception: Serialization of 'Closure' is not allowed at /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Fragment/FragmentUriGenerator.php:31, Exception: Serialization of 'Closure' is not allowed at /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Fragment/FragmentUriGenerator.php:31)"} []
          Hide
          Joaquim Cavalleri (Inactive) added a comment - - edited

          From apache log:

          Fatal error:  Class 'eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess\\Matcher\\CompoundLogicalAnd' not found in /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/SiteAccess/MatcherBuilder.php on line 37
           
          15. eZ\\Publish\\Core\\MVC\\Symfony\\EventListener\\SiteAccessMatchListener->onKernelRequest() /Users/tretas/git.sources/ezsupport/ezsystems/vendor_at_dev/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:164
          16. eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess\\Router->match() /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/EventListener/SiteAccessMatchListener.php:85
          17. eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess\\Router->doMatch() /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/SiteAccess/Router.php:149
          18. eZ\\Bundle\\EzPublishCoreBundle\\SiteAccess\\MatcherBuilder->buildMatcher() /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/SiteAccess/Router.php:164
          19. eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess\\MatcherBuilder->buildMatcher() /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/SiteAccess/MatcherBuilder.php:59
          

          The class is called *LogicalAnd*in https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalAnd.php
          The same much likely will happen with CompoundLogicalOr

          Show
          Joaquim Cavalleri (Inactive) added a comment - - edited From apache log: Fatal error: Class 'eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess\\Matcher\\CompoundLogicalAnd' not found in /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/SiteAccess/MatcherBuilder.php on line 37   15. eZ\\Publish\\Core\\MVC\\Symfony\\EventListener\\SiteAccessMatchListener->onKernelRequest() /Users/tretas/git.sources/ezsupport/ezsystems/vendor_at_dev/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:164 16. eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess\\Router->match() /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/EventListener/SiteAccessMatchListener.php:85 17. eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess\\Router->doMatch() /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/SiteAccess/Router.php:149 18. eZ\\Bundle\\EzPublishCoreBundle\\SiteAccess\\MatcherBuilder->buildMatcher() /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/SiteAccess/Router.php:164 19. eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess\\MatcherBuilder->buildMatcher() /Users/tretas/git.sources/ezsupport/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/SiteAccess/MatcherBuilder.php:59 The class is called *LogicalAnd*in https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalAnd.php The same much likely will happen with CompoundLogicalOr
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          [~joaquim.cavalleri@ez.no]: I don't know how you got this error, but I can assure you this has nothing to do with the issue. My guess is that you misconfigured somehow.
          I was able to find out the cause of this bug and will do a PR shortly

          Show
          Jérôme Vieilledent (Inactive) added a comment - [~joaquim.cavalleri@ez.no] : I don't know how you got this error, but I can assure you this has nothing to do with the issue. My guess is that you misconfigured somehow. I was able to find out the cause of this bug and will do a PR shortly
          Show
          Jérôme Vieilledent (Inactive) added a comment - PR: https://github.com/ezsystems/ezpublish-kernel/pull/529
          Show
          Jérôme Vieilledent (Inactive) added a comment - Fixed in master: https://github.com/ezsystems/ezpublish-kernel/commit/b45c76c36179acb15b7884ba9b8849c61b2a9e68
          Hide
          Joaquim Cavalleri (Inactive) added a comment - - edited

          [~jerome.vieilledent@ez.no]. You're right. The logs were generated while I was configuring the site and don't show up once it is setup as indicated in the steps to reproduce.

          Show
          Joaquim Cavalleri (Inactive) added a comment - - edited [~jerome.vieilledent@ez.no] . You're right. The logs were generated while I was configuring the site and don't show up once it is setup as indicated in the steps to reproduce.

            People

            • Assignee:
              Unassigned
              Reporter:
              Joaquim Cavalleri (Inactive)
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours
                5h