Loading...
 
Features / Usability

Features / Usability


System Error - Sorting attachments when "LIST" Plugin is used in the wiki page content

posts: 13 Canada

I have created the code below to allow my users to create a tracker item/log entry when a wiki page has been reviewed and the information has been confirmed as valid.

I have this code included at the top of every wiki page.


{FADE( label="Page Validation" bootstrap="y")} {HTML()} Page Validation Log var fullURL = window.location.href; var Purl1, Purl2, finalURL; var lURL = "http://csckb/tracker4?trackerId=4&status=o&sort_mode=f_10_desc&filterfield=11&filtervalue="; Purl1 = fullURL.split("csckb/")[1]; Purl2 = Purl1.split("?")[0]; finalURL = lURL + Purl2; document.getElementById("lx2").href= finalURL; {HTML} {LIST()} {pagination max="1"} {filter type=trackeritem} {filter field=tracker_id content=4} {filter field=tracker_field_pageValidated exact=} {sort mode="tracker_field_dateValidated_ndesc"} {OUTPUT()} Last Validation: {display name="tracker_field_dateValidated" format="date"} {OUTPUT} {ALTERNATE()} {HTML()} This page has not been validated {HTML} {ALTERNATE} {LIST} {LIST()} {pagination max="1"} {filter type=trackeritem} {filter field=tracker_id content=4} {filter field=tracker_field_pageValidated exact=} {sort mode=tracker_field_dateValidated_ndesc} {OUTPUT()} Primary Function: {display name="tracker_field_functionResponsible" format="plain"} {OUTPUT} {ALTERNATE()}{tracker(trackerId="4" fields="11:10:13:14")}{ALTERNATE} {LIST} {FADE}


Only on pages where this code is present an error is thrown when users attempt to sort any attachments that are attached to the page

~np~System error.
The following error message was returned:

Unknown column 'comment' in 'order clause'
The query was:

SELECT * FROM `index_5979816193e7b` WHERE 1=1 AND (`searchable` = 'y' AND `object_type` = 'trackeritem' AND `tracker_id` = '4' AND `tracker_field_pageValidated` = 'MAT Student Laptop Deployment Checklist') ORDER BY `comment` desc
The built query was likely:

SELECT * FROM `index_5979816193e7b` WHERE 1=1 AND (`searchable` = 'y' AND `object_type` = 'trackeritem' AND `tracker_id` = '4' AND `tracker_field_pageValidated` = 'MAT Student Laptop Deployment Checklist') ORDER BY `comment` desc~np~

I have checked the table in question "index_5979816193e7b" and there is no "comment" column in that table at all and I don't know why the sorting of the attachments is calling "object_type=trackeritem and tracker_id=4". Tracker 4 is the tracker that I am using in the "Page Validation" code.

I make the assumption that attaching files to wiki documents uses a Tracker and the fact there is now an additional tracker in the page that exists higher in the code than the attachments tracker is messing with the sort function.

Is this an accurate assumption? How do I fix this error? Would best practice be to place this kind of code in an independent module? How should I move forward?

An additional problem that I have just discovered is that when the Page Validation code is not present, the attachment sorting doesn't work at all. The page reloads and the URL changes but the order in which the attachments are displayed does not change.

Thoughts?

There are no comments at this time.

Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting