"We are unable to find this record" on detail view of prefiltered list

pie

Member
Hi, I have a prefiltered list that works as expected,
however the Detail view button (the default one, not custom) somehow is unable to find the detail view of the record it just listed.
The message says
We are unable to find this record
What could be the cause of this?

Thank you
 
Last edited:
I dunno. Try appending &fabrikdebug=1 to the details link, and look at the "form:render" query in the debug output. Paste the WHERE part of it here.

Make sure Debug is enabled in Fabrik's global options.

-- hugh
 
Code:
WHERE locations_repeat_calendario_eventi.parent_id = locations.id) AS `locations___calendario_eventi`, (SELECT GROUP_CONCAT(id SEPARATOR '//..*..//') FROM locations_repeat_calendario_eventi WHERE parent_id = locations.id) AS `locations___calendario_eventi_raw`, (SELECT GROUP_CONCAT(calendario_eventi SEPARATOR '//..*..//') FROM locations_repeat_calendario_eventi WHERE locations_repeat_calendario_eventi.parent_id = locations.id) AS `locations___calendario_eventi_id`, (SELECT GROUP_CONCAT(params SEPARATOR '//..*..//') FROM locations_repeat_calendario_eventi WHERE parent_id = locations.id) AS `locations___calendario_eventi___params`, `locations`.`id` AS slug , `locations`.`id` AS `__pk_val` FROM `locations` LEFT JOIN `#__users` AS `jos_users` ON `jos_users`.`id` = `locations`.`owner` WHERE locations.id = '3'AND (( locations.id IN (SELECT p.id FROM locations AS p INNER JOIN locations_repeat_calendario_eventi AS pe ON pe.parent_id = p.id WHERE pe.calendario_eventi = '{event_id}') ))
 
You have a placeholder event-id in your WHERE part.
Where does it come from. what do you expect to be replaced.

Gesendet mit Tapatalk
 
Nice spot! :) Thank you
It is being replaced by a url parameter (&event_id=X) but looking at the "form:render" from another (working) prefiltered table I'd say it's expected to stay as a placeholder.

edit. prefilter works as expected even in this list, what doesn't work is only the "view detail button".

What else could it be? thank you
 
Last edited:
I assume &event_id=X is only part of the list URL, but not longer existing in the details (standard) URL.
Try a custom details link
&event_id=[event_id]
(I didn't test).
 
I assume &event_id=X is only part of the list URL, but not longer existing in the details (standard) URL.
Try a custom details link
&event_id=[event_id]
(I didn't test).
Correct, you'll need to use a custom details link, setting event_id with whatever it is coming from, so & event_id={event_id} if it's coming from the query string that loads the list. I think we parse query strings when we build the custom details link (it's not an automatic part of our usual placeholder replacement). If not, I'll have to add a line of code to the list view.

l

Sent from my HTC6545LVW using Tapatalk
 
Cool. Yup, remember that we don't automagically add query string args from the URL that loaded the list view to the automatically generated edit/view links, as that can cause nasty problems. If you want a query string arg to be passed through, you have to do it yourself in a custom link.

-- hugh
 
I'm sorry I am not sure that I understood: :)
In list view (prefiltered or not) the detail view button should open the details of its row.

I didn't need to pass further parameters to the query (the list is prefiltered already) - but in this list the detail button doesn't work and I need a custom link with event_id parameter to view the details.
Is my first assumption wrong?

Thank you
 
Not sure how I can summarize it any better, except perhaps to mention that all access to a list's data has the pre-filters applied to it, not just the list view. Pre-filters are access control mechanisms, not just list display filters (that's what the element filters are for). So when you load (say) a form or details view, the list pre-filters will be applied. And if your event_id query string is not present on the details view URL, the pre-filter won't work.

You were loading your list view with your event_id query string, but the standard details view links in the list display do not automagically include (custom) query string args that are present on the URL that loads the list. We just construct a normal details link, with option=com_fabrik&view=details&formid=X&rowid=Y (and an itemid if applicable). The event_id=Z from your list's URL won't get included.

Hence, you need to use a custom details view link, which adds your custom query string name and value. The {event_id} placeholder you are using in your custom link will be replaced with the value of the event_id query string you are loading the list with.

The reason we don't automatically pass query string args through to form/detail view links is that often you really don't want that to happen, and it could cause unwanted behavior on the form/details view. For example, if you are filtering a list with &table___element=foo, passing that through to a form view (wjere it would be interpreted as a default value) could have undesired effects (or might be what you wanted ... but we don't know that). We don't have the a-priori knowledge of which ones you do want to use, so rather than try to be clever (like, say, looking for what looks like query string args used in a pre-filter and include those), we just leave that decision up to you.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top