Skip to content

Commit

Permalink
If we try to find a page in database, check page validity too
Browse files Browse the repository at this point in the history
  • Loading branch information
paulandrieux committed Sep 16, 2015
1 parent b3fa0ad commit b912287
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Bundle/PageBundle/Helper/PageHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ public function findPageByParameters($parameters)
{
if (!empty($parameters['id']) && !preg_match('/^ref_/', $parameters['id'])) {
$page = $this->em->getRepository('VictoireCoreBundle:View')->findOneById($parameters['id']);

$entity = null;
if (method_exists($page, 'getBusinessEntity')) {
$entity = $page->getBusinessEntity();
}
$this->checkPageValidity($page, $entity, $parameters);
} else {
$viewReference = $this->viewCacheHelper->getReferenceByParameters($parameters);
if ($viewReference === null && !empty($parameters['viewId'])) {
Expand Down

0 comments on commit b912287

Please sign in to comment.