bpn Posted June 18, 2017 Posted June 18, 2017 I want to make a link that displays a database listing based on searching one field for a value and sort the list alphanumeric on another field. Any help appreciated.
opentype Posted June 19, 2017 Posted June 19, 2017 To get the query data, you just make this search and then copy the stuff you need from the URL. The filter looks something like …&content_field_286[1]= The ordering looks something like …&sortby=record_comments&sortdirection=desc The problem is though: filter fields are user-specific. There is no one link that works for everyone. You would have to dynamically create the link in the template adding a csrfKey.
bpn Posted June 19, 2017 Author Posted June 19, 2017 Many thanks. Not sure what you mean by user-specific, I haven't seen that in any query-links. If I just use the sort order button in the default database listing display I get this URL, example: domain.com/pagename/?d=3&sortby=field_5&sortdirection=desc "d=3": the database ID is 3. How do I add the search-part, I have tried &field_5=searchstring, but that does not work. Same for &content_field_5[1]=searchstring. (not knowing the meaning of 'content_field' and [1])
opentype Posted June 22, 2017 Posted June 22, 2017 On 6/19/2017 at 8:13 PM, bpn said: Many thanks. Not sure what you mean by user-specific, I haven't seen that in any query-links. Example: https://invisioncommunity.com/4bugtrack/alpha-and-beta-reports/ Select a status in the filter menu and click update. Check the resulting URL: https://invisioncommunity.com/4bugtrack/alpha-and-beta-reports/?advanced_search_submitted=1&csrfKey=d75ae71a4aa6c02c7a63a6df46c272eb&content_field_106[1]=2&sortby=record_last_comment&sortdirection=desc&record_type=all&time_frame=show_all See the csrfKey? That’s dynamically created. We can’t create a general, public link that would link to the search result pages. Yes, it sucks, but if that’s what you are trying to do, don’t bother. It won’t work.
xtech Posted November 8, 2017 Posted November 8, 2017 @opentype is it a security issue showing the csrfKey? I mean, when generating a dynamic link, if user can see the link like dumbaddress.com/pages?advanced_search_submitted=1&csrfKey=950ec5a522d64d3ab8dd0474a492854e&content_field_333[1]=109 Is this a security problem?
opentype Posted November 8, 2017 Posted November 8, 2017 Not sure what you mean. Who sees which links in which situation? The point of these keys is that they are unique to each user. They won’t work for different users. That’s the point. They also don’t protect any sensitive data in the cases shown above – just temporary, personal database filter settings.
xtech Posted November 8, 2017 Posted November 8, 2017 I was referring when you mouse over a link or if you check the html output code. Thank you, you've cleared my doubt!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.