From fa5ed04139cdcbb3beeb63b80536b0ab58760322 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 27 Mar 2015 23:53:57 +0100 Subject: [PATCH] Needed to add notice_id to selected fields ... :-( Signed-off-by: Roland Haeder --- lib/attachmenttagcloudsection.php | 2 +- lib/grouptagcloudsection.php | 2 +- lib/inboxtagcloudsection.php | 2 +- lib/personaltagcloudsection.php | 2 +- lib/publictagcloudsection.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/attachmenttagcloudsection.php b/lib/attachmenttagcloudsection.php index 2c8fc5ee1a..5a8614ebb1 100644 --- a/lib/attachmenttagcloudsection.php +++ b/lib/attachmenttagcloudsection.php @@ -75,7 +75,7 @@ class AttachmentTagCloudSection extends TagCloudSection function getTags() { $notice_tag = new Notice_tag; - $query = 'select tag,count(tag) as weight from notice_tag join file_to_post on (notice_tag.notice_id=post_id) join notice on notice_id = notice.id where file_id=' . $notice_tag->escape($this->out->attachment->id) . ' group by tag order by weight desc'; + $query = 'select tag, notice_id, count(tag) as weight from notice_tag join file_to_post on (notice_tag.notice_id=post_id) join notice on notice_id = notice.id where file_id=' . $notice_tag->escape($this->out->attachment->id) . ' group by tag order by weight desc'; $notice_tag->query($query); return $notice_tag; } diff --git a/lib/grouptagcloudsection.php b/lib/grouptagcloudsection.php index 5ed14560ce..68af4d3074 100644 --- a/lib/grouptagcloudsection.php +++ b/lib/grouptagcloudsection.php @@ -76,7 +76,7 @@ class GroupTagCloudSection extends TagCloudSection $namestring = implode(',', $quoted); - $qry = 'SELECT notice_tag.tag, '. + $qry = 'SELECT notice_tag.tag, notice_tag.notice_id, '. $weightexpr . ' as weight ' . 'FROM notice_tag JOIN notice ' . 'ON notice_tag.notice_id = notice.id ' . diff --git a/lib/inboxtagcloudsection.php b/lib/inboxtagcloudsection.php index d19f76366d..fbc137041f 100644 --- a/lib/inboxtagcloudsection.php +++ b/lib/inboxtagcloudsection.php @@ -72,7 +72,7 @@ class InboxTagCloudSection extends TagCloudSection $weightexpr = common_sql_weight('notice_tag.created', common_config('tag', 'dropoff')); // @fixme should we use the cutoff too? Doesn't help with indexing per-user. - $qry = 'SELECT notice_tag.tag, '. + $qry = 'SELECT notice_tag.tag, notice_tag.notice_id, '. $weightexpr . ' as weight ' . 'FROM notice_tag JOIN notice ' . 'ON notice_tag.notice_id = notice.id ' . diff --git a/lib/personaltagcloudsection.php b/lib/personaltagcloudsection.php index c861c4f57f..957def042c 100644 --- a/lib/personaltagcloudsection.php +++ b/lib/personaltagcloudsection.php @@ -61,7 +61,7 @@ class PersonalTagCloudSection extends TagCloudSection $weightexpr = common_sql_weight('notice_tag.created', common_config('tag', 'dropoff')); // @fixme should we use the cutoff too? Doesn't help with indexing per-user. - $qry = 'SELECT notice_tag.tag, '. + $qry = 'SELECT notice_tag.tag, notice_tag.notice_id, '. $weightexpr . ' as weight ' . 'FROM notice_tag JOIN notice ' . 'ON notice_tag.notice_id = notice.id ' . diff --git a/lib/publictagcloudsection.php b/lib/publictagcloudsection.php index 1d9dd0e751..082c455259 100644 --- a/lib/publictagcloudsection.php +++ b/lib/publictagcloudsection.php @@ -77,7 +77,7 @@ class PublicTagCloudSection extends TagCloudSection $weightexpr = common_sql_weight('notice_tag.created', common_config('tag', 'dropoff')); // @fixme should we use the cutoff too? Doesn't help with indexing per-user. - $qry = 'SELECT notice_tag.tag, '. + $qry = 'SELECT notice_tag.tag, notice_tag.notice_id, '. $weightexpr . ' as weight ' . 'FROM notice_tag JOIN notice ' . 'ON notice_tag.notice_id = notice.id ' . -- 2.39.5