correct some seemingly innocent behaviour, and thus fix a corner case in another extension

This commit is contained in:
Shish 2010-02-03 23:54:43 +00:00
parent 937a430a50
commit c22f28072f

View file

@ -246,7 +246,14 @@ class ImageIO extends SimpleExtension {
log_info("image", "Uploaded Image #{$image->id} ({$image->hash})");
send_event(new TagSetEvent($image, $image->get_tag_array()));
# at this point in time, the image's tags haven't really been set,
# and so, having $image->tag_array set to something is a lie (but
# a useful one, as we want to know what the tags are /supposed/ to
# be). Here we correct the lie, by first nullifying the wrong tags
# then using the standard mechanism to set them properly.
$tags_to_set = $image->get_tag_array();
$image->tag_array = array();
send_event(new TagSetEvent($image, $tags_to_set));
}
// }}}
// fetch image {{{