Details
-
Bug
-
Resolution: Fixed
-
High
-
5.2
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