Skip to content

Commit

Permalink
Fix for broken assetic:dump --env=prod
Browse files Browse the repository at this point in the history
  • Loading branch information
nervetattoo committed Sep 25, 2013
1 parent 90ab855 commit 9f640b4
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/KTQ/Bundle/eZExceedBundle/Model/Pencil.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ class Pencil
// @var boolean
protected $canCurrentUserEditCurrentContent;

// @var object
protected $serviceContainer;


public function __construct( $serviceContainer, Repository $repository, PageService $pageService )
{
Expand All @@ -90,20 +93,27 @@ public function __construct( $serviceContainer, Repository $repository, PageServ
$this->languageService = $this->repository->getContentLanguageService();
$this->pageService = $pageService;

$locationId = $serviceContainer->get('request')->attributes->get('locationId');
if ($locationId) {
$this->currentLocation = $this->locationService->loadLocation($locationId);
$this->currentContent = $this->contentService->loadContentByContentInfo($this->currentLocation->contentInfo);
$this->currentContentId = $this->currentContent->getVersionInfo()->contentInfo->id;
$this->canCurrentUserEditCurrentContent = $this->repository->canUser( 'content', 'edit', $this->currentContent );
}

$this->serviceContainer = $serviceContainer;
// TODO: Remove
$this->zoneIndex = 0;
}

protected function loadLocation()
{
if (!$this->currentContent) {
$locationId = $this->serviceContainer->get('request')->attributes->get('locationId');
if ($locationId) {
$this->currentLocation = $this->locationService->loadLocation($locationId);
$this->currentContent = $this->contentService->loadContentByContentInfo($this->currentLocation->contentInfo);
$this->currentContentId = $this->currentContent->getVersionInfo()->contentInfo->id;
$this->canCurrentUserEditCurrentContent = $this->repository->canUser( 'content', 'edit', $this->currentContent );
}
}
}

public function fill($input)
{
$this->loadLocation();
$this->entities = array();
if (is_array($input)) {
foreach ($input as $key => $value) {
Expand Down

0 comments on commit 9f640b4

Please sign in to comment.