Hi,

This may be a very simple problem, or an overly complex one. I am trying to create views to use as a REST API for my site (I'll write my own custom style type to output the node information as required for the XML unless anyone knows a working module that does this automatically?). One of my REST API's requires multiple parameters to be passed for one filter. I.e.:

/GetFeatures?fid=1&fid=2&fid=3&fid=4 or ?fid=1,2,3,4,5 if views doesn't support GET arrays

I need the view to send back only the nodes that are in the list. Does anyone know how to do this? Is there a plugin moule for this?

Thanks,

David

Comments

merlinofchaos’s picture

Status: Active » Fixed

That would be an exposed filter. Neither one is quite correct; it'd be fid[]=1&fid[]=2&fid[]=3, etc.

drazzig’s picture

Status: Fixed » Active

Hi merlinofchaos,

I just tried what you said: /GetFeatures?fid[]=1&fid[]=2&fid[]=3

However when I do this for the view I get the following error:

* warning: mb_strlen() expects parameter 1 to be string, array given in /home/sites/mysite/public_html/includes/unicode.inc on line 404.
* warning: preg_match() expects parameter 2 to be string, array given in /home/sites/mysite/public_html/includes/bootstrap.inc on line 761.

Is there anything else I need to do to enable my exposed filter (of integer is equal to) to work properly?

Thanks,

David

esmerel’s picture

Status: Active » Fixed

This request is a year old; I'm presuming it's either figured out, or no longer applicable.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.