mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #29235
[Bug 1499122] Re: Threaded comments display in the wrong order
As long as comment ID numbers keep incrementing (so that "SORT BY id"
gives the same order as "SORT BY ctime") this problem only shows up when
comment IDs "Roll over" to the next larger size, i.e. 1 digit -> 2
digits; 2 digits -> 3 digits, etc. That's why it's easiest to test it if
this is the first thing you do on a clean install.
In the forum posts, which also sort threaded data in ascending manner,
we solved the problem by padding the IDs in the paths out to 10 digits
with leading zeroes. This ensures that e.g. 0000000006 comes before
0000000011 in string sort order.
That is a possibility here too... but in this case the path column is
artefact.path, and it's used for many purposes, so I think it's probably
not safe to assume that we can just drop leading zeroes in there and
it'll keep working for everything.
Instead, perhaps what we can do is add an additional column to
artefact_comment_comment that contains the path with padded IDs for each
comment artefact.
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1499122
Title:
Threaded comments display in the wrong order
Status in Mahara:
Confirmed
Status in Mahara 15.10 series:
Confirmed
Bug description:
To replicate:
1. Clean install of Mahara
2. In the "No institution" settings, turn on threaded comments. Leave the comment sort order on the default "ascending"
3. Create a page
4. Leave about 10 comments on the page. Don't make any of them be replies.
Expected result: Because the comments aren't replies, they should be displayed on the page in the order they were created
Actual result: After the first few comments are posted, comments will start showing up at the top of the list of comments
The reason for this is because the sortorder for "threaded ascending"
is (artefact.path, artefact.ctime, id). Since artefact.path is a
string, and gets sorted in alphabetical order, when the artefact IDs
go from 1 digit to 2 digits, the 1 digit ones will start sorting below
the 2 digit ones. I.e. "/11" comes before "/6", in string sorting
order.
A similar thing will happen if threaded comments are sorted in
descending order.
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1499122/+subscriptions
References