1 (edited by namwebs 12-02-2016 10:55:21)

Topic: url filter not working for anonymous user, only logged in user

Hi,

I can't work this out...

I have a report which is meant to show records for the selected species only. The taxon_meaning_id is passed in the URL. It works correctly for a logged-in user but not for an anonymous user. I've checked permissions etc and I can't find any reason for this.

The report is here: http://the-eis.com/atlas/?q=mammal-reco … list=1593. If you log in (with test and test123) it correctly shows only giraffe records, but if you are not logged in it shows all mammal records.

Any ideas? I'm sure this must be simple!

Thanks, Alice

2

Re: url filter not working for anonymous user, only logged in user

Hi Alice,

I don't have any ideas at the moment. Could you provide a bit of extra information such as which Indicia page type this is and any settings you have entered so that I can have a go at recreating the problem.

Jim Bacon.

3

Re: url filter not working for anonymous user, only logged in user

Thanks for your reply, I need to sort this out and don't seem to be getting anywhere.

It's a report made using form category 'Reporting' and  the 'dynamic report explorer'.

Under 'Other IForm Parameters' there are no permissions set.

Under 'User interface', 'form structure' it has:

[standard_params]
@allowSave=true
@linkToMapDiv=map
@taxon_list_id=15
@filter-my_records=0
[map]
@dataSource=library/occurrences/filterable_explore_list_mapping
@dataSourceLoRes=library/occurrences/filterable_explore_list_mapping
=Records=
[report_grid]
@dataSource=library/alice/filterable_explore_list_allspecies
@rowId=occurrence_id
@downloadLink=true
=Summary=
[report_grid]
@dataSource=library/taxa/filterable_explore_list
@downloadLink=true
@rowId=taxon_meaning_id
@linkFilterToMap=false

Preset parameter values under 'Report settings' are:
smpattrs=
occattrs=
my_records=0
survey_id=9

What else would be helpful?

Alice

4

Re: url filter not working for anonymous user, only logged in user

Hi Alice,

With the information you provided I was able to recreate the situation you describe. I could then step through the code to see what was happening. This has taken me places I have never been before.

In client_helpers\prebuilt_forms\dynamic_report_explorer.php, in the get_control_standardparams() function, I came upon the crucial comment "if not logged in and linked to warehouse, we can't use standard params functionality"  I think it might be more accurate to say that you can't use warehouse-stored filters when not logged in.

You can see that, when you are logged in you get a filter bar above your map and this is absent when not logged in. The url filter you are using is based on the function of the filter bar and so cannot work when not logged in, as you have found.

What we need to do is pass a parameter direct to the report without messing with these warehouse-stored filters. It seems we can do this by simply replacing 'filter-' with 'dynamic-' in the url. ('dynamic' is the default value of an option called reportGroup.) The code that achieves this is in the get_report_grid_current_param_values() function in the client_helpers\report_helper.php file.

Try this: http://the-eis.com/atlas/?q=mammal-reco … _list=1593

Regards,
Jim Bacon.

5

Re: url filter not working for anonymous user, only logged in user

Wow, that works perfectly, THANK YOU! That's great. Such a simple solution but I appreciate that it took a lot of time to go digging in the code, these things always do.

Alice