Tiki-Log sort by ID broken
- Status
- Closed
- Subject
- Tiki-Log sort by ID broken
- Version
- 8.x
- Category
- Consistency
- Usability
- Patch
- Feature
- Admin Interface (UI)
Logs (system & action)
Templates (Smarty) - Resolution status
- Fixed or Solved
- Submitted by
- Manuel Schneider
- Volunteered to solve
- Jean-François BILGER
- Lastmod by
- Manuel Schneider
- Rating
- Description
in debug mode (eg. when debugging ldap logins) many log entries are created at the same time so sorting by time is not sufficient to get the entries in their real order. Sorting by ID is better then.
Unfortunately sorting by ID leads to an unexpected result.
Looking at the code the problem can be fixed easily: The problem is that two tables are being joined (actionlog and actionlog_conf) and sorting by ID leads to sorting by actionlog_conf.id instead of actionlog.actionID.
Both needs to be fixed - in the SQL query the table for sorting must be added in the sort statement, in the template the columnname must be changed from Id to ActionId.
See patch.
- Solution
- lib/logs/logslib.phpCopy to clipboard411c411 - $query .= " order by ".$this->convertSortMode($sort_mode); + $query .= " order by a.".$this->convertSortMode($sort_mode);templates/tiki-syslog.tplCopy to clipboard30c30 - <th>{self_link _sort_arg="sort_mode" _sort_field="id"}{tr}Id{/tr}{/self_link}</th> + <th>{self_link _sort_arg="sort_mode" _sort_field="actionId"}{tr}Id{/tr}{/self_link}</th>
- Importance
- 2
- Easy to solve?
- 10 easy
- Priority
- 20
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 4148
- Created
- Monday 30 January, 2012 15:43:32 UTC
by Manuel Schneider - LastModif
- Monday 27 February, 2012 18:43:19 UTC