summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-04-14 11:15:48 +0200
committerBrion Vibber <brion@pobox.com>2010-04-14 11:15:48 +0200
commitf789928942c5753d1109ef9609449e79564fda4e (patch)
treeedb5fbee620ecb753421f3536d94d70b0c256379 /classes
parent89f28c7a0f77b5e3debcf9ec4ce6e020b3f0f12b (diff)
parent3da50c19dfff7645dc46f1b836ebf4ecda726129 (diff)
Merge branch 'testing' into 0.9.x
Diffstat (limited to 'classes')
-rw-r--r--classes/Notice.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index dccc3685a..d65f0da9a 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -148,11 +148,11 @@ class Notice extends Memcached_DataObject
//turn each into their canonical tag
//this is needed to remove dupes before saving e.g. #hash.tag = #hashtag
for($i=0; $i<count($hashtags); $i++) {
+ /* elide characters we don't want in the tag */
$hashtags[$i] = common_canonical_tag($hashtags[$i]);
}
foreach(array_unique($hashtags) as $hashtag) {
- /* elide characters we don't want in the tag */
$this->saveTag($hashtag);
self::blow('profile:notice_ids_tagged:%d:%s', $this->profile_id, $hashtag);
}
@@ -374,18 +374,20 @@ class Notice extends Memcached_DataObject
$notice->saveReplies();
}
- if (isset($groups)) {
- $notice->saveKnownGroups($groups);
- } else {
- $notice->saveGroups();
- }
-
if (isset($tags)) {
$notice->saveKnownTags($tags);
} else {
$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)) {
$notice->saveKnownUrls($urls);
} else {