Skip to content

Commit 72420a5

Browse files
committed
Make sure ezimage field type handler generates full image URI even when variation returns the relative URI
1 parent 91c9b2c commit 72420a5

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Handler/FieldType/Image.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ protected function getFieldValue( Field $field, $tagName, array $params = array(
7474

7575
try
7676
{
77-
return $this->imageVariationService->getVariation( $field, $this->content->versionInfo, $variationName )->uri;
77+
$variationUri = $this->imageVariationService->getVariation( $field, $this->content->versionInfo, $variationName )->uri;
78+
79+
if ( $variationUri[0] === '/' && ( $request = $this->requestStack->getCurrentRequest() ) !== null )
80+
{
81+
$variationUri = $request->getUriForPath( '/' . ltrim( $variationUri, '/' ) );
82+
}
83+
84+
return $variationUri;
7885
}
7986
catch ( InvalidVariationException $e )
8087
{

Resources/doc/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Netgen Open Graph Bundle changelog
22
==================================
33

4+
## 1.1.1 (17.08.2015)
5+
6+
* Make sure `ezimage` field type handler generates full image URI even when variation returns the relative URI
7+
48
## 1.1 (15.05.2015)
59

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

0 commit comments

Comments
 (0)