Fixed replace creating a new image instead of replacing, fixed null source causing repalce error
This commit is contained in:
parent
30761e6d1f
commit
ea96f415c5
@ -180,11 +180,13 @@ class ImageIO extends Extension
|
||||
throw new ImageReplaceException($error);
|
||||
}
|
||||
|
||||
if (strlen(trim($image->source)) == 0) {
|
||||
if (strlen(trim($image->source ?? '')) == 0) {
|
||||
$image->source = $existing->get_source();
|
||||
}
|
||||
|
||||
// Update the data in the database.
|
||||
$image->id = $id;
|
||||
send_event(new MediaCheckPropertiesEvent($image));
|
||||
$image->save_to_db();
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user