Skip to content

Commit

Permalink
- Small bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagocamposviana committed Jan 1, 2014
1 parent 269b0a8 commit 8f7b748
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 7 additions & 3 deletions Classes/Components/Blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,13 @@ public function render()
} else {

$sourceId = $block->valueObject->getFieldValue('source')->destinationContentId;
$sourceObj = $repository->getContentService()->loadContent($sourceId);
$parentId = $sourceObj->versionInfo->contentInfo->mainLocationId;
$blocks[$blockLocationId]['children'] = SearchHelper::fetchChildren($this->controller, $parentId, array(), $limit, $offset);
try {
$sourceObj = $repository->getContentService()->loadContent($sourceId);
$parentId = $sourceObj->versionInfo->contentInfo->mainLocationId;
$blocks[$blockLocationId]['children'] = SearchHelper::fetchChildren($this->controller, $parentId, array(), $limit, $offset);
} catch (\Exception $e) {
$blocks[$blockLocationId]['children'] = SearchHelper::fetchChildren($this->controller, $blockLocationId, array(), $limit, $offset);
}

}
}
Expand Down
5 changes: 2 additions & 3 deletions Resources/views/content/image/content_line.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{% if not ez_is_field_empty( content, 'image' ) %}
{% if content.fields.image is defined and not ez_is_field_empty( content, 'image' ) %}
{% set image_alias = ez_image_alias( content.getField('image'), content.versionInfo, alias|default('original') ) %}

<img class="image-small" src="{{asset( image_alias.uri )}}" alt="{{ ez_content_name(content) }}" />

{% endif %}

{% endif %}

0 comments on commit 8f7b748

Please sign in to comment.