Help with pre-filter

Status
Not open for further replies.

oreolana

Member
Hello,

I have a problem with pre-filter. It's didn't work.

There are three tables:

1) dbme_entity:
id,
entity_full_name,
user_access (user_access(raw)),
etc

2) dbme_users: (standart table of users in joomla 2.5.6)
id,
username,
name,
etc

3) dbme_entity_repeat_user_access: ( automaticly created databasejoin checkbox table)
id,
parent_id (=dbme_entity.id),
user_access (=dbme_users.id),
params.

I want to filter all records in table dbme_entity witch belong to logged on user. But it's not the records that are created by the user.

I made like this pre-filter:

WHERE
Field: id (pk of table dbme_entity)
Condition: IN (or maybe EQUALS)
Value: SELECT dbme_entity_repeat_user_access.parent_id FROM dbme_entity_repeat_user_access WHERE dbme_entity_repeat_user_access.user_access = {$my->id} as a query
Type: Query
Apply to: Registered

Where is my error?

P.S. Sorry for my English. I'm from Ukraine.
I use fabrik 3.0.6, joomla 2.5.6
 

Attachments

  • part1.JPG
    part1.JPG
    18.6 KB · Views: 388
  • part2.JPG
    part2.JPG
    23.1 KB · Views: 360
So the records are belonging to multiple users?

Delete " as a query".

You can enable fabrik debug (in fabrik options).
Then append &fabrikdebug=1 to your URL, click on "getListDate: xxx" to see if (and which) query is created
 
Yes, multiple users.
list GetData:????????
SELECT SQL_CALC_FOUND_ROWS DISTINCT `dbme_entity`.`id` AS `dbme_entity___id`, `dbme_entity`.`id` AS `dbme_entity___id_raw`, `dbme_entity`.`edrpou_code` AS `dbme_entity___edrpou_code`, `dbme_entity`.`edrpou_code` AS `dbme_entity___edrpou_code_raw`, `dbme_entity`.`entity_full_name` AS `dbme_entity___entity_full_name`, `dbme_entity`.`entity_full_name` AS `dbme_entity___entity_full_name_raw`, `dbme_entity`.`entity_abbreviation` AS `dbme_entity___entity_abbreviation`, `dbme_entity`.`entity_abbreviation` AS `dbme_entity___entity_abbreviation_raw`, `dbme_entity`.`entity_group_full_name` AS `dbme_entity___entity_group_full_name_raw`, `dbme_entity_group`.`entity_group_full_name` AS `dbme_entity___entity_group_full_name`, `dbme_entity`.`legal_address` AS `dbme_entity___legal_address`, `dbme_entity`.`legal_address` AS `dbme_entity___legal_address_raw`, `dbme_entity`.`area_code_coatuu` AS `dbme_entity___area_code_coatuu`, `dbme_entity`.`area_code_coatuu` AS `dbme_entity___area_code_coatuu_raw`, `dbme_entity`.`entity_organizational_legal_form_copfg` AS `dbme_entity___entity_organizational_legal_form_copfg`, `dbme_entity`.`entity_organizational_legal_form_copfg` AS `dbme_entity___entity_organizational_legal_form_copfg_raw`, `dbme_entity`.`modification_date` AS `dbme_entity___modification_date`, `dbme_entity`.`modification_date` AS `dbme_entity___modification_date_raw`, `dbme_entity`.`user` AS `dbme_entity___user_raw`, `dbme_users`.`username` AS `dbme_entity___user`, (SELECT GROUP_CONCAT(dbme_users.username SEPARATOR '//..*..//') FROM dbme_entity_repeat_user_access LEFT JOIN dbme_users ON dbme_users.id = dbme_entity_repeat_user_access.user_access WHERE dbme_entity_repeat_user_access.parent_id = `dbme_entity`.`id`) AS dbme_entity_repeat_user_access___user_access, (SELECT GROUP_CONCAT(id SEPARATOR '//..*..//') FROM dbme_entity_repeat_user_access WHERE parent_id = `dbme_entity`.`id`) AS `dbme_entity_repeat_user_access___user_access_raw`, (SELECT GROUP_CONCAT(user_access SEPARATOR '//..*..//') FROM dbme_entity_repeat_user_access WHERE dbme_entity_repeat_user_access.parent_id = `dbme_entity`.`id`) AS dbme_entity_repeat_user_access___user_access_id, (SELECT GROUP_CONCAT(params SEPARATOR '//..*..//') FROM dbme_entity_repeat_user_access WHERE parent_id = `dbme_entity`.`id`) AS `dbme_entity_repeat_user_access___params`, `dbme_entity`.`id` AS slug , `dbme_entity`.`id` AS `__pk_val` FROM `dbme_entity` LEFT JOIN `dbme_entity_group` AS `dbme_entity_group` ON `dbme_entity_group`.`id` = `dbme_entity`.`entity_group_full_name` LEFT JOIN `#__users` AS `dbme_users` ON `dbme_users`.`id` = `dbme_entity`.`user`
 
It looks as your prefilter isn't applied at all (no WHERE part at the end).

Check the apply to settings;
apply to registered won't be applied to e.g. public.
Does your user belong to a usergroup which has "apply to" accesslevel (registered in your text, usernova in your picture)?
 
It's work! Thank you!
I deleted ' as a query'.
Then chose Apply to (some regestered user's group).

UserUstanova - is a registered user's group.
It work to multiple users.

???! (russian word)
 
Status
Not open for further replies.
Back
Top