Outputting pipe in keyword modifier failing


(Tim Davison) #1

Having an issue where I'm trying to output a pipe (i.e. | ) from a keyword modifier.  E.g.

%globals_asset_url^contains:.vic.gov.au/heritage:<input type="hidden" name="f.Section|14" value="Heritage">: %

This is within a site search form, and what the code is attempting to do is output a hidden form field that gets sent to Funnelback Enterprise version so that it's defaults to the appropriate facet (based on gscope).  In this case the site section is 'Heritage' based on the url, so we want to invoke the heritage facet (gscope 14).  I know - pipe in URL and the value part of the arg name like this is weird, but that's how Funnelback Enterprise expects it.  

 

When I try to add the above code to a page in matrix, I get an error:

PHP Warning
preg_replace(): Unknown modifier '1' 

I've narrowed it down to the pipe.  I've tried escaping with backslash (no effect) and url-encoding (which fails because of the percentage sign),

 

Is there any way in a keyword modifier like this to output a pipe symbol?  

 

Or another way to invoke a faceted search directly on Enterprise Funnelback that does not need a pipe symbol in the URL?

 

Thanks

 

Matrix v4.12


(Joel Porgand) #2

fwiw I've also been unable to use a pipe in keyword modifiers 


(Bart Banda) #3

This works for me in 5.1.4.0, but I believe it would have been fixed a lot earlier, not sure which exact version though. 


(Tim Davison) #4

Thanks Bart.  Glad to know it's been fixed - we'll be upgrading to Matrix v5....soon....ish.

 

I've worked around it by using a series of at least 10 keywords and modifiers, which due to the nature of the HTML need to all be on the same line.  That line is currently 1726 characters long.  It works, but I pity the poor soul that ever has to change it.  (Ok - it will probably be me).

 

Cheers


(Joel Porgand) #5

I've worked around it by using a series of at least 10 keywords and modifiers, which due to the nature of the HTML need to all be on the same line.  That line is currently 1726 characters long.  It works, but I pity the poor soul that ever has to change it. 

 

I like the way you roll.


(David Schoen) #6

http://xkcd.com/1421/


(Tim Davison) #7

One regex to rule them all!