setNextRoute changes fullstops to slashes

Hi

Seems to be having an issue with setNextRoute, if there is a fullstop
in any of the variables passed to it, its converts them to
backslashes.

So

<cfset setNextRoute("search?c=m.i.a")>

Will take me to index.cfm/search?c=m/i/a

Has anyone else noticed this, and know how to change it?

Thanks

Have you tried URLEncoding the variable beforehand?

Hi

Thanks for your response

I havent tried that, would i use the URLEncodedFormat tag for this?

Thanks

Please use setNextEvent() as the default way of relocations, setnextRoute and relocate() are deprecated.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Hi Luis

Even when using the setNextEvent function its still converting the
full stops to slashes, would you know why?

Thanks

Yes, the relocation is trying to be smart and convert the event syntax dot notations to /. In order to allow for the dots, you will need to use the URI parameter so it does not get translated

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Hi there

Sorry, bit confused..url parameter?

At the moment, my code stands as

<cfset setNextEvent("search?c=#rc.searchCategory#&q=#rc.q#")>

Thanks

If you are using coldbox 3, the setnextEvent has more arguments, named arguments. Use the URI named argument for routing.
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Ok, thanks for the info

Hi luis, could i get an example of how to do this, i dont seem to be
able to see anything in the docs

Thanks

This should do the trick for you:

<cfset setNextEvent( uri = "search?c=m.i.a") >

.brett

works like a charm

Thanks for your help