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

Preview issue when relying on locations for unpublished content

    Details

      Description

      There appears to be a regression in the eZ Publish 5.2 version of the patch from issue https://jira.ez.no/browse/EZP-22781, that occurs in the conditions described below.

      Steps to reproduce:

      1. Prepare an eZ Publish 5.2 installation, fully patched;
      2. Install eZ Publish 5.2 patch from https://jira.ez.no/browse/EZP-22781;
      3. Preview the first draft of a page that is being served by a new stack full view template with an Image attribute. If the page is published preview doesn't crash. The problem appears to be happening if you have a custom controller that is trying to access the location ID. In the example below, it is the line that is trying loadLocation() that is failing:

      public function webinarEnterpriseAction( $locationId, $viewType, $layout = false, array $params = array() ) {
      	$params += array();
       
      	$repository = $this->getRepository();
      	$location = $repository->getLocationService()->loadLocation( $locationId );
      	$content = $repository->getContentService()->loadContentByContentInfo( $location->contentInfo );
       
      	$params['tz_dates'] = $this->globalWebinarDates( $content );
       
      	// Forward the request to the Default Controller
      	$response = $this->get( 'ez_content' )->viewLocation( $locationId, $viewType, $layout, $params );
       
      	return $response;
      }
      

      In the customer's case, it happens that their site has an Image attribute on that content class. Therefore, to test you just have to create a custom controller and try to access the location ID. It will always crash on a first draft:

       
       
      Full stack trace is below. Is there a follow-up patch that needs to be applied as well?
       
      [1] eZPublishCoreBaseExceptionsNotFoundException: Could not find 'location' with identifier
      at n/a
      in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Location/Gateway/EzcDatabase.php line 79
       
      at eZPublishCorePersistenceLegacyContentLocationGatewayEzcDatabase->getBasicNodeData(null)
      in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Location/Gateway/ExceptionConversion.php line 56
       
      at eZPublishCorePersistenceLegacyContentLocationGatewayExceptionConversion->getBasicNodeData(null)
      in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Location/Handler.php line 100
       
      at eZPublishCorePersistenceLegacyContentLocationHandler->load(null)
      in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Cache/LocationHandler.php line 32
       
      at eZPublishCorePersistenceCacheLocationHandler->load(null)
      in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/LocationService.php line 205
       
      at eZPublishCoreRepositoryLocationService->loadLocation(null)
      in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/LocationService.php line 102
       
      at eZPublishCoreSignalSlotLocationService->loadLocation(null)
      in /var/www/src/Hootsuite/BaseBundle/Controller/WebinarsController.php line 925
       
      at HootsuiteBaseBundleControllerWebinarsController->webinarEnterpriseAction(null, 'full', true, array('content' => object(Content), 'location' => object(Location), 'isPreview' => true))
      in line
       
      at call_user_func_array(array(object(WebinarsController), 'webinarEnterpriseAction'), array(null, 'full', true, array('content' => object(Content), 'location' => object(Location), 'isPreview' => true)))
      in /var/www/ezpublish/bootstrap.php.cache line 2889
       
      at SymfonyComponentHttpKernelHttpKernel->handleRaw(object(Request), '2')
      in /var/www/ezpublish/bootstrap.php.cache line 2863
       
      at SymfonyComponentHttpKernelHttpKernel->handle(object(Request), '2', true)
      in /var/www/ezpublish/bootstrap.php.cache line 2992
       
      at SymfonyComponentHttpKernelDependencyInjectionContainerAwareHttpKernel->handle(object(Request), '2')
      in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/Controller/Content/PreviewController.php line 89
       
      at eZPublishCoreMVCSymfonyControllerContentPreviewController->previewContentAction('3461', '1', 'eng-US', 'eng')
      in line
       
      at call_user_func_array(array(object(PreviewController), 'previewContentAction'), array('3461', '1', 'eng-US', 'eng'))
      in /var/www/ezpublish/bootstrap.php.cache line 2889
       
      at SymfonyComponentHttpKernelHttpKernel->handleRaw(object(Request), '1')
      in /var/www/ezpublish/bootstrap.php.cache line 2863
       
      at SymfonyComponentHttpKernelHttpKernel->handle(object(Request), '1', true)
      in /var/www/ezpublish/bootstrap.php.cache line 2992
       
      at SymfonyComponentHttpKernelDependencyInjectionContainerAwareHttpKernel->handle(object(Request), '1', true)
      in /var/www/ezpublish/bootstrap.php.cache line 2272
       
      at SymfonyComponentHttpKernelKernel->handle(object(Request), '1', true)
      in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Kernel.php line 62
       
      at eZBundleEzPublishCoreBundleKernel->handle(object(Request))
      in /var/www/web/index.php line 64
      

        Issue Links

          Activity

          Nuno Oliveira (Inactive) created issue -
          Nuno Oliveira (Inactive) made changes -
          Field Original Value New Value
          Summary Preview issue after installing patch from https://jira.ez.no/browse/EZP-22781 (possible regression) Preview issue after installing patch from EZP-22781 (possible regression)
          Nuno Oliveira (Inactive) made changes -
          Description There appears to be a regression in the eZ Publish 5.2 version of the patch from issue https://jira.ez.no/browse/EZP-22781, that occurs in the conditions described below.

          h4. Steps to reproduce:

          1. Prepare an eZ Publish 5.2 installation, fully patched;
          2. Install eZ Publish 5.2 patch from https://jira.ez.no/browse/EZP-22781;
          3. Preview *the first draft* of a page that is being served by a new stack full view template with an Image attribute. If the page is published preview doesn't crash. The problem appears to be

          happening if you have a custom controller that is trying to access the location ID. In the example below, it is the line that is trying loadLocation() that is failing:

          {noformat}
          public function webinarEnterpriseAction( $locationId, $viewType, $layout = false, array $params = array() ) {
          $params += array();

          $repository = $this->getRepository();
          $location = $repository->getLocationService()->loadLocation( $locationId );
          $content = $repository->getContentService()->loadContentByContentInfo( $location->contentInfo );

          $params['tz_dates'] = $this->globalWebinarDates( $content );

          // Forward the request to the Default Controller
          $response = $this->get( 'ez_content' )->viewLocation( $locationId, $viewType, $layout, $params );

          return $response;
          }
          {noformat}

          In the customer's case, it happens that their site has an Image attribute on that content class. Therefore, to test you just have to create a custom controller and try to access the location ID. It will always crash on a first draft:

          {noformat}


          Full stack trace is below. Is there a follow-up patch that needs to be applied as well?

          [1] eZPublishCoreBaseExceptionsNotFoundException: Could not find 'location' with identifier
          at n/a
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Location/Gateway/EzcDatabase.php line 79

          at eZPublishCorePersistenceLegacyContentLocationGatewayEzcDatabase->getBasicNodeData(null)
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Location/Gateway/ExceptionConversion.php line 56

          at eZPublishCorePersistenceLegacyContentLocationGatewayExceptionConversion->getBasicNodeData(null)
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Location/Handler.php line 100

          at eZPublishCorePersistenceLegacyContentLocationHandler->load(null)
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Cache/LocationHandler.php line 32

          at eZPublishCorePersistenceCacheLocationHandler->load(null)
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/LocationService.php line 205

          at eZPublishCoreRepositoryLocationService->loadLocation(null)
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/LocationService.php line 102

          at eZPublishCoreSignalSlotLocationService->loadLocation(null)
          in /var/www/src/Hootsuite/BaseBundle/Controller/WebinarsController.php line 925

          at HootsuiteBaseBundleControllerWebinarsController->webinarEnterpriseAction(null, 'full', true, array('content' => object(Content), 'location' => object(Location), 'isPreview' => true))
          in line

          at call_user_func_array(array(object(WebinarsController), 'webinarEnterpriseAction'), array(null, 'full', true, array('content' => object(Content), 'location' => object(Location), 'isPreview' => true)))
          in /var/www/ezpublish/bootstrap.php.cache line 2889

          at SymfonyComponentHttpKernelHttpKernel->handleRaw(object(Request), '2')
          in /var/www/ezpublish/bootstrap.php.cache line 2863

          at SymfonyComponentHttpKernelHttpKernel->handle(object(Request), '2', true)
          in /var/www/ezpublish/bootstrap.php.cache line 2992

          at SymfonyComponentHttpKernelDependencyInjectionContainerAwareHttpKernel->handle(object(Request), '2')
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/Controller/Content/PreviewController.php line 89

          at eZPublishCoreMVCSymfonyControllerContentPreviewController->previewContentAction('3461', '1', 'eng-US', 'eng')
          in line

          at call_user_func_array(array(object(PreviewController), 'previewContentAction'), array('3461', '1', 'eng-US', 'eng'))
          in /var/www/ezpublish/bootstrap.php.cache line 2889

          at SymfonyComponentHttpKernelHttpKernel->handleRaw(object(Request), '1')
          in /var/www/ezpublish/bootstrap.php.cache line 2863

          at SymfonyComponentHttpKernelHttpKernel->handle(object(Request), '1', true)
          in /var/www/ezpublish/bootstrap.php.cache line 2992

          at SymfonyComponentHttpKernelDependencyInjectionContainerAwareHttpKernel->handle(object(Request), '1', true)
          in /var/www/ezpublish/bootstrap.php.cache line 2272

          at SymfonyComponentHttpKernelKernel->handle(object(Request), '1', true)
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Kernel.php line 62

          at eZBundleEzPublishCoreBundleKernel->handle(object(Request))
          in /var/www/web/index.php line 64
          {noformat}
          There appears to be a regression in the eZ Publish 5.2 version of the patch from issue https://jira.ez.no/browse/EZP-22781, that occurs in the conditions described below.

          h4. Steps to reproduce:

          1. Prepare an eZ Publish 5.2 installation, fully patched;
          2. Install eZ Publish 5.2 patch from https://jira.ez.no/browse/EZP-22781;
          3. Preview *the first draft* of a page that is being served by a new stack full view template with an Image attribute. If the page is published preview doesn't crash. The problem appears to be happening if you have a custom controller that is trying to access the location ID. In the example below, it is the line that is trying loadLocation() that is failing:

          {noformat}
          public function webinarEnterpriseAction( $locationId, $viewType, $layout = false, array $params = array() ) {
          $params += array();

          $repository = $this->getRepository();
          $location = $repository->getLocationService()->loadLocation( $locationId );
          $content = $repository->getContentService()->loadContentByContentInfo( $location->contentInfo );

          $params['tz_dates'] = $this->globalWebinarDates( $content );

          // Forward the request to the Default Controller
          $response = $this->get( 'ez_content' )->viewLocation( $locationId, $viewType, $layout, $params );

          return $response;
          }
          {noformat}

          In the customer's case, it happens that their site has an Image attribute on that content class. Therefore, to test you just have to create a custom controller and try to access the location ID. It will always crash on a first draft:

          {noformat}


          Full stack trace is below. Is there a follow-up patch that needs to be applied as well?

          [1] eZPublishCoreBaseExceptionsNotFoundException: Could not find 'location' with identifier
          at n/a
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Location/Gateway/EzcDatabase.php line 79

          at eZPublishCorePersistenceLegacyContentLocationGatewayEzcDatabase->getBasicNodeData(null)
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Location/Gateway/ExceptionConversion.php line 56

          at eZPublishCorePersistenceLegacyContentLocationGatewayExceptionConversion->getBasicNodeData(null)
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Location/Handler.php line 100

          at eZPublishCorePersistenceLegacyContentLocationHandler->load(null)
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Cache/LocationHandler.php line 32

          at eZPublishCorePersistenceCacheLocationHandler->load(null)
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/LocationService.php line 205

          at eZPublishCoreRepositoryLocationService->loadLocation(null)
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/LocationService.php line 102

          at eZPublishCoreSignalSlotLocationService->loadLocation(null)
          in /var/www/src/Hootsuite/BaseBundle/Controller/WebinarsController.php line 925

          at HootsuiteBaseBundleControllerWebinarsController->webinarEnterpriseAction(null, 'full', true, array('content' => object(Content), 'location' => object(Location), 'isPreview' => true))
          in line

          at call_user_func_array(array(object(WebinarsController), 'webinarEnterpriseAction'), array(null, 'full', true, array('content' => object(Content), 'location' => object(Location), 'isPreview' => true)))
          in /var/www/ezpublish/bootstrap.php.cache line 2889

          at SymfonyComponentHttpKernelHttpKernel->handleRaw(object(Request), '2')
          in /var/www/ezpublish/bootstrap.php.cache line 2863

          at SymfonyComponentHttpKernelHttpKernel->handle(object(Request), '2', true)
          in /var/www/ezpublish/bootstrap.php.cache line 2992

          at SymfonyComponentHttpKernelDependencyInjectionContainerAwareHttpKernel->handle(object(Request), '2')
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/Controller/Content/PreviewController.php line 89

          at eZPublishCoreMVCSymfonyControllerContentPreviewController->previewContentAction('3461', '1', 'eng-US', 'eng')
          in line

          at call_user_func_array(array(object(PreviewController), 'previewContentAction'), array('3461', '1', 'eng-US', 'eng'))
          in /var/www/ezpublish/bootstrap.php.cache line 2889

          at SymfonyComponentHttpKernelHttpKernel->handleRaw(object(Request), '1')
          in /var/www/ezpublish/bootstrap.php.cache line 2863

          at SymfonyComponentHttpKernelHttpKernel->handle(object(Request), '1', true)
          in /var/www/ezpublish/bootstrap.php.cache line 2992

          at SymfonyComponentHttpKernelDependencyInjectionContainerAwareHttpKernel->handle(object(Request), '1', true)
          in /var/www/ezpublish/bootstrap.php.cache line 2272

          at SymfonyComponentHttpKernelKernel->handle(object(Request), '1', true)
          in /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Kernel.php line 62

          at eZBundleEzPublishCoreBundleKernel->handle(object(Request))
          in /var/www/web/index.php line 64
          {noformat}
          Nuno Oliveira (Inactive) made changes -
          Status Open [ 1 ] Confirmed [ 10037 ]
          Nuno Oliveira (Inactive) made changes -
          Link This issue relates to EZP-22781 [ EZP-22781 ]
          Paulo Lopes (Inactive) made changes -
          Status Confirmed [ 10037 ] InputQ [ 10001 ]
          André Rømcke made changes -
          Rank Ranked higher
          André Rømcke made changes -
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          André Rømcke made changes -
          Issue Type Improvement [ 4 ] Bug [ 1 ]
          André Rømcke made changes -
          Link This issue relates to EZP-22314 [ EZP-22314 ]
          André Rømcke made changes -
          Component/s Documentation [ 10793 ]
          André Rømcke made changes -
          Status InputQ [ 10001 ] Development Acceptance Done [ 10030 ]
          Fix Version/s 5.2 Maintenance [ 12782 ]
          Fix Version/s 5.3.4 [ 13879 ]
          Fix Version/s 5.4.0-rc1 [ 13883 ]
          André Rømcke made changes -
          Summary Preview issue after installing patch from EZP-22781 (possible regression) Preview issue when relying on locations for unpublished content
          Sarah Haïm-Lubczanski (Inactive) made changes -
          Status Development Acceptance Done [ 10030 ] Documentation [ 10010 ]
          Assignee Sarah Haïm-Lubczanski [ sarah.haim-lubczanski@ez.no ]
          André Rømcke made changes -
          Status Documentation [ 10010 ] InputQ [ 10001 ]
          Assignee Sarah Haïm-Lubczanski [ sarah.haim-lubczanski@ez.no ]
          André Rømcke made changes -
          Fix Version/s Engineering tracked issues [ 11179 ]
          Fix Version/s Customer request [ 11018 ]
          Fix Version/s 5.2 Maintenance [ 12782 ]
          Fix Version/s 5.3.4 [ 13879 ]
          André Rømcke made changes -
          Fix Version/s 5.4.0-rc1 [ 13883 ]
          Sarah Haïm-Lubczanski (Inactive) made changes -
          Status InputQ [ 10001 ] Documentation [ 10010 ]
          Assignee Sarah Haïm-Lubczanski [ sarah.haim-lubczanski@ez.no ]
          Sarah Haïm-Lubczanski (Inactive) made changes -
          Status Documentation [ 10010 ] InputQ [ 10001 ]
          Assignee Sarah Haïm-Lubczanski [ sarah.haim-lubczanski@ez.no ]
          André Rømcke made changes -
          Fix Version/s Customer request [ 11018 ]
          André Rømcke made changes -
          Fix Version/s 5.2 Maintenance [ 12782 ]
          Fix Version/s 5.2 [ 12582 ]
          André Rømcke made changes -
          Fix Version/s 5.2 [ 12582 ]
          André Rømcke made changes -
          Labels SilverBullet
          Bertrand Dunogier made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Bertrand Dunogier [ bertrand.dunogier@ez.no ]
          Bertrand Dunogier made changes -
          Comment [ Oh, one more thing (tm).

          I'm thinking that the fake location_id in the LocationDraft object does not help at all, in the end. I'd rather remove it from the backport. What do you think (I'd rather focus on getting the parent there...) ? ]
          Bertrand Dunogier made changes -
          Status Development [ 3 ] Development review [ 10006 ]
          Bertrand Dunogier made changes -
          Status Development review [ 10006 ] Development Review done [ 10028 ]
          Bertrand Dunogier made changes -
          Status Development Review done [ 10028 ] Documentation done [ 10011 ]
          Ricardo Correia (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Bertrand Dunogier [ bertrand.dunogier@ez.no ] Ricardo Correia [ ricardo.correia@ez.no ]
          Ricardo Correia (Inactive) made changes -
          Flagged Impediment [ 10000 ]
          Bertrand Dunogier made changes -
          Link This issue relates to EZP-23793 [ EZP-23793 ]
          Bertrand Dunogier made changes -
          Link This issue relates to EZP-23793 [ EZP-23793 ]
          Ricardo Correia (Inactive) made changes -
          Link This issue relates to EZP-23807 [ EZP-23807 ]
          Ricardo Correia (Inactive) made changes -
          Assignee Ricardo Correia [ ricardo.correia@ez.no ]
          Status QA [ 10008 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          André Rømcke made changes -
          Workflow eZ Engineering Scrumban Workflow [ 65063 ] EZ* Development Workflow [ 85489 ]
          Alex Schuster made changes -
          Workflow EZ* Development Workflow [ 85489 ] EZEE Development Workflow [ 124325 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Nuno Oliveira (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: