[Solved] List view ignoring pre-filters

Status
Not open for further replies.

kamau

New Member
hi there,

i have two lists Company and Campaign linked so Company has primary key and Campaign has foreign key. i created the databasejoin element on Campaign to point to Company. I allow "show related link" under the data section of list A.

this correctly displays the related links in list view as follows
upload_2016-1-1_1-37-53.png

now i click "Show Campaigns" related link to view the list of campaigns for the company as shown below:
upload_2016-1-1_1-39-6.png
Now comes the problem, when i click the "Clear Filters" link I see ALL campaigns for ALL companies.
upload_2016-1-1_1-44-2.png

the prefilter i'm using is as follows:
upload_2016-1-1_1-51-57.png
the list access looks as follows:
upload_2016-1-1_1-53-59.png
NB: "Registered Marketer" is just a renaming of "Registered"

How it is supposed to work
  • each company belongs to a particular joomla user but a joomla user can have many companies
  • i configured the campaign list to pre-filter on the userid element but when this "clear filter" happens users can view other user's data
What i need
  1. a list should be absolutely locked down.
  2. a user can only see the records that they created (identified by the userid element)
so far i cannot get this to work

any assistance will be greatly appreciated

thanks
 
i'm not using a menu item. apparently a registered user can access any data on any form with permission "registered" under the list's Access page under View List and View Records

if i type this url http://localhost/index.php/company/list/9

and change the 9 to another id for a published list, i can view all of that lists content without any prefilter

is there a way we can have the "or use field" drop down in the Access page for the viewing options. that way it would be something like "View List 'Special' or use field 'userid'
 
Prefilters defined in list settings should always be applied (as long as they are not overriden by a menu item oder list module prefilter setting).
Can you set "allow fabrik debugging"=yes in Fabrik "Options"/Debugging?
Then append fabrikdebug=1 to your URL (http://localhost/index.php/company/list/9?fabrikdebug=1)

Click on "list GetData: your list" you should see the generated query
 
this is what is shown in the prefilters section. what does it mean?

Array
(
[join] => Array
(
[0] => OR
)

[search_type] => Array
(
[0] => prefilter
)

[key] => Array
(
[0] => isign_customer.owner
)

[value] => Array
(
[0] => {$my->id}
)

[origvalue] => Array
(
[0] => {$my->id}
)

[sqlCond] => Array
(
[0] =>
)

[no-filter-setup] => Array
(
[0] =>
)

[condition] => Array
(
[0] => equals
)

[grouped_to_previous] => Array
(
[0] => 0
)

[eval] => Array
(
[0] => 0
)

[match] => Array
(
[0] => 1
)

[full_words_only] => Array
(
[0] => 0
)

[label] => Array
(
[0] =>
)

[access] => Array
(
[0] =>
)

[key2] => Array
(
[0] =>
)

[required] => Array
(
[0] => 0
)

[hidden] => Array
(
[0] =>
)

[elementid] => Array
(
[0] => 0
)

[raw] => Array
(
[0] => 1
)

)
 
if i create a menu item and point it directly to campaign table without any pre-filters on the menu item, this is what i get at the preprocessor section:

Array
(
[join] => Array
(
[0] => AND
)

[search_type] => Array
(
[0] => prefilter
)

[key] => Array
(
[0] => isign_campaign.owner
)

[value] => Array
(
[0] => {$my->id}
)

[origvalue] => Array
(
[0] => {$my->id}
)

[sqlCond] => Array
(
[0] =>
)

[no-filter-setup] => Array
(
[0] =>
)

[condition] => Array
(
[0] => equals
)

[grouped_to_previous] => Array
(
[0] => 0
)

[eval] => Array
(
[0] => 0
)

[match] => Array
(
[0] => 1
)

[full_words_only] => Array
(
[0] => 0
)

[label] => Array
(
[0] =>
)

[access] => Array
(
[0] =>
)

[key2] => Array
(
[0] =>
)

[required] => Array
(
[0] => 0
)

[hidden] => Array
(
[0] =>
)

[elementid] => Array
(
[0] => 71
)

[raw] => Array
(
[0] => 1
)

)
 
Better click on "list GetData:" (or depending on list structure on the tab before this one) to see the SQL statement.

In your first example: was this while displaying the customer list or the campain list?
In your 2nd example: I assume this is keeping the prefilter even if you do a "Clear filter"? (as it should do)
 
the second prefilter correctly shows only the records for the current user.

the two prefilter results seem to differ in the following areas
-----------------------------------------------------------------------------------
Shows All records:
[join] => Array
(
[0] => OR
)

Shows only current user records:
[join] => Array
(
[0] => AND
)
-----------------------------------------------------------------------------------
Shows All records:
[key] => Array
(
[0] => isign_customer.owner
)

Shows only current user records:
[key] => Array
(
[0] => isign_campaign.owner
)
-----------------------------------------------------------------------------------
Shows All records:
[elementid] => Array
(
[0] => 0
)

Shows only current user records:
[elementid] => Array
(
[0] => 71
)
 
i went to listGetData:campaign on both the customer link and the campaign menu item. the two queries are pretty much the same except for the last part:

customer link
-------------------------
LEFT JOIN `#__users` AS `jmla_users` ON `jmla_users`.`id` = `isign_campaign`.`owner` ORDER BY `isign_campaign`.`customer` ASC

campaign menu item
---------------------------------
LEFT JOIN `#__users` AS `jmla_users` ON `jmla_users`.`id` = `isign_campaign`.`owner` WHERE ( `jmla_users`.`id` = '48' ) ORDER BY `isign_campaign`.`customer` ASC

for the one that is not working, the WHERE clause is missing
 
Can you describe your exact setup?

How do you call the customer list?
This list has a prefilter on customer.owner = {$my->id}?

Your campaign list has also an element "owner" and a prefilter campaign.owner = {$my->id}?
Both prefilters are applied to Public, all users have this accesslevel assigned?

Is the related data link really calling the campaign list with the prefilter (or do you have campaign list copies without prefilter)?


Which exact Fabrik version are you running? (There shouldn't be a "OR" in this prefilter array)
 
I had a menu item pre-filter on the customer list. not only that, but it had an always true "id greater than or equal to 0" for permission "special"

i'm so embarrassed :(
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top