Loading...
 
Skip to main content

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
(0)
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.php
Copy to clipboard
411c411 - $query .= " order by ".$this->convertSortMode($sort_mode); + $query .= " order by a.".$this->convertSortMode($sort_mode);
templates/tiki-syslog.tpl
Copy to clipboard
30c30 - <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+
Demonstrate Bug (older Tiki versions)
Ticket ID
4148
Created
Monday 30 January, 2012 15:43:32 UTC
by Manuel Schneider
LastModif
Monday 27 February, 2012 18:43:19 UTC


Show PHP error messages