Fix for "#foo !foo" in same notice failing during save, causing failout before distribution. Move saveGroups after saveTags when saving notices; groups may save additional tags, so need to be moved after so the check for duplicates actually works.

This commit is contained in:
Brion Vibber 2010-04-14 11:11:02 +02:00
parent d445b977fc
commit a21a172639

View File

@ -373,18 +373,20 @@ class Notice extends Memcached_DataObject
$notice->saveReplies(); $notice->saveReplies();
} }
if (isset($groups)) {
$notice->saveKnownGroups($groups);
} else {
$notice->saveGroups();
}
if (isset($tags)) { if (isset($tags)) {
$notice->saveKnownTags($tags); $notice->saveKnownTags($tags);
} else { } else {
$notice->saveTags(); $notice->saveTags();
} }
// Note: groups may save tags, so must be run after tags are saved
// to avoid errors on duplicates.
if (isset($groups)) {
$notice->saveKnownGroups($groups);
} else {
$notice->saveGroups();
}
if (isset($urls)) { if (isset($urls)) {
$notice->saveKnownUrls($urls); $notice->saveKnownUrls($urls);
} else { } else {