Skip to content

Commit

Permalink
Make sure ezimage field type handler generates full image URI even …
Browse files Browse the repository at this point in the history
…when variation returns the relative URI
  • Loading branch information
emodric committed Aug 17, 2015
1 parent 91c9b2c commit 72420a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Handler/FieldType/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ protected function getFieldValue( Field $field, $tagName, array $params = array(

try
{
return $this->imageVariationService->getVariation( $field, $this->content->versionInfo, $variationName )->uri;
$variationUri = $this->imageVariationService->getVariation( $field, $this->content->versionInfo, $variationName )->uri;

if ( $variationUri[0] === '/' && ( $request = $this->requestStack->getCurrentRequest() ) !== null )
{
$variationUri = $request->getUriForPath( '/' . ltrim( $variationUri, '/' ) );
}

return $variationUri;
}
catch ( InvalidVariationException $e )
{
Expand Down
4 changes: 4 additions & 0 deletions Resources/doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Netgen Open Graph Bundle changelog
==================================

## 1.1.1 (17.08.2015)

* Make sure `ezimage` field type handler generates full image URI even when variation returns the relative URI

## 1.1 (15.05.2015)

* Implement the ability to define the array of field identifiers to be used in field type handlers
Expand Down

0 comments on commit 72420a5

Please sign in to comment.