Loading...
 
Skip to main content

Architecture / Installation


Tracker Item Sort Error

posts: 2

Hi there,

I'm having a problem with sorting any table of tracker items. When clicking on the table heading, I get the following error:

Warning: mysql error: Unknown column '' in 'order clause' in query:
select * from `tiki_tracker_items` where `trackerId`=? order by `` desc
in /xxx/yyy/www/xxxxxx/lib/tikidblib.php on line 125
Values:
Array ( 0 => 1 )
$result is false
$result is empty

Sorting works in other contexts, e.g. in the forum.

I'm running 1.8.1 with mysql. Any hints or even fixes? I've seen this problem posted for a 1.7. version but there the suggestion was to use 1.8.

Regards,
Thorsten

posts: 1001 Canada

Hi Thorsten,
I saw this if fixed in HEAD😛
I tried but abandonned to get it owkring on BRANCH-1-8. The link generated in tiki-view_tracker.php is wrong (the sortmode misses the field indication. The problem seems to be in the Smarty template around this part :
href="tiki-view_tracker.php?{if $status}status={$status}&{/if}trackerId={$trackerId}&offset={$offset}&sort_mode=f_{if $sort_mode eq 'f_'|cat:$fields[ix].fieldId|cat:'_asc'}{$fields[ix].fieldId|escape:"url"}_desc{else}{$fields[ix].fieldId|escape:"url"}_asc{/if}">{$fields[ix].name|truncate:255:"..."|default:" "}
That's from HEAD. 1.8 CVS reads :
href="tiki-view_tracker.php?status={$status}&find={$find}&trackerId={$trackerId}&offset={$offset}{section name=x loop=$fields}{if $fields[x].value}&{$fields[x].name}={$fields[x].value}{/if}{/section}&sort_mode={if $sort_mode eq $fields[x].name|escape:'url'|cat:'_desc'}{$fields[x].name|escape:"url"}_asc{else}{$fields[x].name|escape:"url"}_desc{/if}">{$fields[ix].name}
There are important differences, and although I can't guarantee only the template is wrong, it's possible that taking enough time one can fix it by checking the differences more carefully than me.


posts: 2881 United Kingdom

Possibly comparing the trackers to those in HEAD is bad, as HEAD has had a good rewrite.

My guess would be to double check fields passed in the sort parameters on the tables and take it from there.

If you get stuck send me a tiki email and take some time out to find a suitable fix.

Damian


posts: 2

Hi there,

thanks for your help, but as far as I understand it, the problem is deeper. The "sort" is tried on table "tiki_tracker_items". However, this table only includes the default column "lastModif". All other columns are in table "tiki_tracker_item_fields".

So the select should be on "tiki_tracker_item_fields", if I'm correct. However, I don't have an idea how to change the templates accodingly. 😑

Best,
Thorsten