diff --git a/kernel/classes/datatypes/ezimage/ezimagetype.php b/kernel/classes/datatypes/ezimage/ezimagetype.php index 43eceaa7997..9977ea88d92 100644 --- a/kernel/classes/datatypes/ezimage/ezimagetype.php +++ b/kernel/classes/datatypes/ezimage/ezimagetype.php @@ -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 ); + } } /** @@ -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; @@ -470,11 +476,7 @@ function customObjectAttributeHTTPAction( $http, $action, $contentObjectAttribut { if( $action == "delete_image" ) { - $content = $contentObjectAttribute->attribute( 'content' ); - if ( $content ) - { - $content->removeAliases(); - } + $this->deleteStoredObjectAttribute( $contentObjectAttribute ); } }