Views is the best thing since sliced bread but I've hit a snag.
I need to send multiple terms to a view, it works fine when addressing the view directly through the url e.g.
path/+2+1/+3+5+4
but when I send this from within a module the arguments are encoded to
path/%252B2%252B1%252F%252B3%252B5%252B4%252F
which of courses produces a negative result.

Is there a way to alter the separator characters to one that won't be encoded by Drupal?
Thanks

Comments

beeradb’s picture

Priority: Critical » Normal
dawehner’s picture

what do mean here

but when I send this from within a module the arguments

Could you please paste your code here?

thx!

kiteglinton’s picture

Hi, I was wanting to send a set of aguments to a view to list all nodes with a combination of taxonomy terms. The terms derived from a series of checkboxes and sends them as 4 strings, each a list of terms seaparated by "+"

$path = [path-to-view];
$args = "$types_str/$categories_str/$regions_str/$salary_str"; //
$form_state['redirect'] = $path.$args;

If I called the view directly then it dosplayed fine but the above code routes through the Drupal encoding and ends up undecipherable to the view. I've got round the problem in a very poor way by sending the strings with a "-" separator (which does not get encoded) and tweaking the views file "views_handler_arguments.inc" which I didn't like doing but could find no other solution to.
Thanks Kit

kiteglinton’s picture

Actually I'm not quite there yet. I managed to get a "-" to the view to replace a "+" but now I need to get an AND to the view represented by "," seaprator to the arguments.
As before a comma is encoded before it reaches the view so I need to find a better way to replace "+" and "," by characters which are not encoded.
My arguments are all numeric so I could use any alpha char but nit sure where the best place to tweak the code would be.
Thanks for any suggestions

esmerel’s picture

Status: Active » Closed (fixed)

Given the age of this issue, I have hope that it's resolved or no longer relevant.