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

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Confirmed Confirmed
          6m 19s 1 nuno.oliveira@ez.no 05/Nov/14 10:58 PM
          Confirmed Confirmed InputQ InputQ
          9h 32m 1 Paulo Lopes (Inactive) 06/Nov/14 8:31 AM
          InputQ InputQ Removed Status Removed Status
          8d 3h 18m 1 André Rømcke 14/Nov/14 11:49 AM
          Removed Status Removed Status Documentation Documentation
          3d 22h 13m 1 sarah.haim-lubczanski@ez.no 18/Nov/14 10:02 AM
          InputQ InputQ Documentation Documentation
          1d 15h 57m 1 sarah.haim-lubczanski@ez.no 03/Dec/14 11:00 AM
          Documentation Documentation InputQ InputQ
          15d 16h 8m 2 sarah.haim-lubczanski@ez.no 05/Dec/14 6:07 PM
          InputQ InputQ Development Development
          4d 21h 26m 1 Bertrand Dunogier 10/Dec/14 3:33 PM
          Development Development Development Review Development Review
          21s 1 Bertrand Dunogier 10/Dec/14 3:34 PM
          Development Review Development Review Development Review done Development Review done
          9m 27s 1 Bertrand Dunogier 10/Dec/14 3:43 PM
          Development Review done Development Review done Documentation Review done Documentation Review done
          8s 1 Bertrand Dunogier 10/Dec/14 3:43 PM
          Documentation Review done Documentation Review done QA QA
          1d 21m 1 ricardo.correia@ez.no 11/Dec/14 4:04 PM
          QA QA Closed Closed
          4d 23h 47m 1 ricardo.correia@ez.no 16/Dec/14 3:51 PM

            People

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

              Dates

              • Created:
                Updated:
                Resolved: