Loading...
 
Skip to main content

Sorting by points in forum threads produces mysql error

Status
Open
Subject
Sorting by points in forum threads produces mysql error
Version
12.x Regression
Category
  • Error
  • Regression
Feature
Forum
Resolution status
New
Submitted by
Xavier de Pedro
Lastmod by
Xavier de Pedro
Rating
(0)
Description

When clicking at "points" in the forum thread list, a mysql error is produced. This worked in old versions (Tiki3, at least), and fails in Tiki9 also.

Example of working example in a Tiki3:
http://edu.tiki.org/tiki-view_forum.php?forumId=1&thread_sort_mode=average_desc

Similar url in a Tiki9 & Tiki12 site produces:

Copy to clipboard
The built query was likely: SELECT COUNT(*) FROM (SELECT `a`.`threadId`, COALESCE(a.`archived`, 'n') as `archived`, COALESCE(max(b.`commentDate`), a.`commentDate`) as `lastPost`, COALESCE(a.`type`='s', false) as `sticky`, count(distinct b.`threadId`) as `replies` from `tiki_comments` a left join `tiki_comments` b on b.`parentId`=a.`threadId` where 1 = 1 AND a.`object`='5' and (a.`archived` is null or a.`archived`='n') and a.`objectType` = 'forum' and a.`parentId` = '0' group by a.`threadId`order by `sticky` desc, `average` asc, `threadId`) a Stacktrace: * /var/www/12.x/tiki-view_forum.php : 0 -> {main}(array ( )) * /var/www/12.x/tiki-view_forum.php : 400 -> count_forum_topics(array ( )) * /var/www/12.x/lib/comments/commentslib.php : 749 -> getOne(array ( )) * /var/www/12.x/lib/core/TikiDb/Bridge.php : 42 -> getOne(array ( )) * /var/www/12.x/lib/core/TikiDb.php : 65 -> query(array ( )) * /var/www/12.x/lib/core/TikiDb/Pdo.php : 121 -> handleQueryError(array ( )) * /var/www/12.x/lib/core/TikiDb.php : 148 -> handle(array ( ))


To reproduce, use the show.t.o instance and login with:
u: admin
p: 12345

And visit http://xavi-9794-5149.show.tikiwiki.org/tiki-view_forum.php?forumId=1&thread_sort_mode=average_desc

Importance
4
Easy to solve?
8
Priority
32
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
5149
Created
Friday 21 February, 2014 18:28:26 UTC
by Xavier de Pedro
LastModif
Friday 21 February, 2014 21:24:18 UTC


Show PHP error messages