Extension talk:SemanticFormsSelect
Contents
| Thread title | Replies | Last modified |
|---|---|---|
| Barfs on properties with certain characters | 2 | 03:06, 11 May 2012 |
| Is this what I think it is? | 3 | 01:46, 28 January 2012 |
I have a number of properties with parentheses, and this extension doesn't quite work with them. I presume it's due to the substitutions done to ease the parsing.
The query is passed to serve using ajax call. You can use your favorite web debug tool to check what the query looks like with parenthesis in properties. If the query is not good for SMW, this extension will not work for your properties.
$query=preg_replace('/(?<!\\\\)\\(/','[',$query);
$query=preg_replace('/(?<!\\\\)\\)/',']',$query);
$query=preg_replace('/\\\\\\(/','(',$query);
$query=preg_replace('/\\\\\\)/',')',$query);
For anyone who faces a similar problem, these lines should replace the lines at ~97 and 98 that look like this:
$query=str_replace("(", "[", $query);
$query=str_replace(")", "]", $query);
This will enable you to use backslashes ('\') to escape your parentheses.
I almost think this does what I want it to do, but I'm honestly not sure. It's a bit complex to follow with the text and the examples, will there be a usable, running sample soon?
Thanks.
I do not right now have a public site to host a demo. I have a series of pages for demo. I will upload those pages so that you can run demo locally.
-jason
Added Demonstration section in documentation. You can set up a workable example in your local installation.