Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix EZP-21786: Using Page fieldtype, valid block items should be pass…
…ed to the block templates See [EZP-21786](https://jira.ez.no/browse/EZP-21786). This prevents fetch function revival when designing frontpages with Page fieldtype. Note that PageService injection in template is kept for BC sake. To be removed in v6.0
- Loading branch information
1 parent
828b015
commit 3738718
Showing
4 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
eZ/Bundle/EzPublishCoreBundle/Controller/PageController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* File containing the PageController class. | ||
* | ||
* @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved. | ||
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 | ||
* @version //autogentag// | ||
*/ | ||
|
||
namespace eZ\Bundle\EzPublishCoreBundle\Controller; | ||
|
||
use eZ\Bundle\EzPublishCoreBundle\FieldType\Page\PageService as CoreBundlePageService; | ||
use eZ\Publish\Core\FieldType\Page\Parts\Block; | ||
use eZ\Publish\Core\MVC\Symfony\Controller\PageController as BasePageController; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
class PageController extends BasePageController | ||
{ | ||
public function viewBlock( Block $block, array $params = array(), array $cacheSettings = array() ) | ||
{ | ||
// Inject valid items as ContentInfo objects if possible. | ||
if ( $this->pageService instanceof CoreBundlePageService ) | ||
{ | ||
$params += array( | ||
'valid_contentinfo_items' => $this->pageService->getValidBlockItemsAsContentInfo( $block ) | ||
); | ||
} | ||
|
||
return parent::viewBlock( $block, $params, $cacheSettings ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters