Skip to content

Commit

Permalink
Merge pull request #1040 from joaoinacio/ezimage_alt_text
Browse files Browse the repository at this point in the history
Fix EZP-23207: image alt text not modified if file is not set.
  • Loading branch information
glye committed Aug 1, 2014
2 parents d50f481 + 07d422a commit f2fc838
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions kernel/classes/datatypes/ezimage/ezimagetype.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ function deleteStoredObjectAttribute( $contentObjectAttribute, $version = null )
/** @var eZImageAliasHandler $imageHandler */
$imageHandler = $contentObjectAttribute->attribute( 'content' );
if ( $imageHandler )
{
$imageHandler->setAttribute( 'alternative_text', false );
$imageHandler->removeAliases();
$imageHandler->store( $contentObjectAttribute );
}
}

/**
Expand Down Expand Up @@ -298,9 +302,11 @@ function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )

}

if ( $result && $hasImageAltText )
if ( $content )
{
$content->setAttribute( 'alternative_text', $imageAltText );
if ( $hasImageAltText )
$content->setAttribute( 'alternative_text', $imageAltText );
$result = true;
}

return $result;
Expand Down Expand Up @@ -470,11 +476,7 @@ function customObjectAttributeHTTPAction( $http, $action, $contentObjectAttribut
{
if( $action == "delete_image" )
{
$content = $contentObjectAttribute->attribute( 'content' );
if ( $content )
{
$content->removeAliases();
}
$this->deleteStoredObjectAttribute( $contentObjectAttribute );
}
}

Expand Down

0 comments on commit f2fc838

Please sign in to comment.