mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-01 13:48:37 +02:00
BUGFIX Avoid ajax evaluator errors by checking if $resizedImage actually exists before calling relativePath() on it
MINOR Code formatting cleanup git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64850 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
2c4edddd1b
commit
68326a5eac
@ -235,8 +235,8 @@ function HtmlEditorField_dataValue_processImage($parts) {
|
|||||||
// If we have an image, insert the resampled one into the src attribute; otherwise, leave the img src alone.
|
// If we have an image, insert the resampled one into the src attribute; otherwise, leave the img src alone.
|
||||||
if($image && $image->getWidth() != $width && $image->getHeight != $height) {
|
if($image && $image->getWidth() != $width && $image->getHeight != $height) {
|
||||||
// If we have an image, generate the resized image.
|
// If we have an image, generate the resized image.
|
||||||
$resizedImage = $image->getFormattedImage("ResizedImage",$width, $height);
|
$resizedImage = $image->getFormattedImage('ResizedImage', $width, $height);
|
||||||
$parts[$partSource['src="']] = $resizedImage->getRelativePath() ;
|
if($resizedImage) $parts[$partSource['src="']] = $resizedImage->getRelativePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
$parts[0] = "";
|
$parts[0] = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user