Problem :: set permision

More
7 years 8 months ago #102249 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Problem :: set permision
It is not that simple as the value of custom field data for subscription is stored in a separate table #__osmembership_field_value (not main table #__osmembership_subscribers)

The file which you need to edit is components/com_osmembership/model/members.php, method buildQueryWhere

If the fields are fixed fields, you can add this extra fields to #__osmembership_subscribers table so that the data for the custom field will be stored in that new fields and it is easier to modify the $query object to get the filtered data

However, if you want to have dynamic fields like that, honestly, I don't really know how you will modify the query

Tuan

Please Log in or Create an account to join the conversation.

  • mostafa norouzi
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 8 months ago #102255 by mostafa norouzi
Replied by mostafa norouzi on topic Problem :: set permision
Thank you for your guidance
I put this :
Code:
for ($i = 0, $n = count($items); $i < $n; $i++) { if($fieldsData[$items[$i]->id][FIELD_ID]!=FIELD_VALUE) unset($items[$i]); }

in line 22 of : components\com_osmembership\view\members\tmpl\columns.php
and array filtered!

I know that it's not a fantastic solution but for now it's working ;)

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #102257 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Problem :: set permision
The code is wrong, unfortunately. It works because you only have few members at the moment. What happens if you have more subscriptions and need pagination? You will see that one page might display just few records (match the filter) but there are still pagination for next pages...

Not sure if you get my point but this is clearly not the right solution

Tuan

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #102259 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Problem :: set permision
Better ask them for a fixed field which they want to filter data. Then maybe wait for the next release 2.10.0 (will be released in 1 to 2 weeks), I will guide you with a better code (if they provide a fixed field which they want to filter data)

Tuan

Please Log in or Create an account to join the conversation.

  • mostafa norouzi
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 8 months ago #102261 by mostafa norouzi
Replied by mostafa norouzi on topic Problem :: set permision
Yes it has problem with pagination.
You mean we have to use "core field"?

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #102283 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Problem :: set permision
Yes, or a similar concept. It would be possible to use a none core field, but writing code would be quite difficult (and the search is also slow, too)

So the idea is having the data for that field stored in #__osmembership_subscribers table, then it would be simpler to modify the members.php to query for matching data

That's the reason in the next release 2.10.0, I add a tool which will make a none core field behavior in the same with a core field, just have to access the URL like that

domain.com/administrator/index.php?optio...d_id=ID_OF_THE_FIELD

Running that tool will create a new field for that custom field in #__osmembership_subscribers table, migrate existing data for that field into the #__osmembership_subscribers , make it searchable ... from the search textbox in the backend automatically (just enter keyword for search for data from that field)

With your requirement, the modification will be simpler, too, if you have a fixed field. If you can ask the client for the field (fixed field), we can help with this modification when 2.10.0 release

Regards,

Tuan

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #102284 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Problem :: set permision
BTW, don't you want to update your review with correct rating for my support? I still believe that it is not correct to get that low rating (and not good review) for my support, so I might report that review to JED team

No hard feeling, I will continue providing support for you as how it has been. I just disagree with the rating for support which I received :)

Tuan

Please Log in or Create an account to join the conversation.

  • mostafa norouzi
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 8 months ago #102295 by mostafa norouzi
Replied by mostafa norouzi on topic Problem :: set permision
Hello again,

I moved data from extra (dynamic) field to a core-field and after that buildQueryWhere mehtod modified.
it's now working!

I also delete my review and send again on Joomla extensions directory (because there isn't edit item over there!)
Thank you.

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #102296 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Problem :: set permision
Great. Many thanks :)
The following user(s) said Thank You: mostafa norouzi

Please Log in or Create an account to join the conversation.