Problem with conditionals
Hi,
I was having difficulty getting Low Search to work using the examples in the documentation. A string containing a bunch of odd characters is returned and all the html is cut off after the string. I setup a clean install of EE and tracked it down to the conditionals for outputting the start and end "ol" in the example results code. If I remove the conditionals the search works fine.
I'm using EE 2.3.1 and Low Search 1.0.6.
PHP version is 5.3.3.
Any help would be appreciated.
Cheers,
Dylan
Replies
Dylan 15 Nov 2011 12:15
Any conditional on my fields is triggering this. I've attached a screen grab of the output. I'm now getting SQL as well.
Low 15 Nov 2011 12:15
Hi Dylan,
Can't seem to reproduce any errors with conditionals in the search results tag. What's the template code you're using? And what's the output (the odd chars you're mentioning)?
Dylan 15 Nov 2011 12:22
Hi Low,
Here's the search form:
{exp:low_search:form collection="pages" search_mode="all" result_page="search/results" secure="no"}
<fieldset>
<label for="keywords">Keywords</label>
<input type="search" name="keywords" id="keywords" />
<button type="submit">Search</button>
</fieldset>
{/exp:low_search:form}
And the results tag:
{exp:low_search:results query="{segment_3}" limit="10"}
{if count == 1}<ol>{/if}
<li><a href="{comment_url_title_auto_path}">{title}</a></li>
{if count == total_results}</ol>{/if}
{if no_results}No search results{/if}
{/exp:low_search:results}
And the results on a clean install of EE. This will sometimes change when refreshing the page like the output is being cached.
o93H7p0Y � � � � dy> RzIj�0?ې ��)C' �� ��> �� ��' �3z /users/dylan/sites/trials/ee2/system/expressionengine/third_party/low_search/mod.low_search.php {if cou��?ې ��)C' @� 8 � �K 8� �?) /users/dylan/sites/trials/ee2/system/expressionengine/third_party/low_search/mod.low_
Low 15 Nov 2011 12:34
Hey Dylan,
This almost looks as if the downloaded files were corrupted somehow. Can you try downloading the files again?
I take it this is local? If you have an example site live somewhere, I'd like to take a look myself.
Dylan 15 Nov 2011 12:42
The production server is returning a more meaningful error but it's still probably not that useful:
Parse error: syntax error, unexpected '?' in /home/superbia/subdomains/materchristi/ee_system/expressionengine/libraries/Functions.php(656) : eval()'d code on line 1
I'll send you the login details.
Low 16 Nov 2011 11:10
I've tracked the bug down and will release a fix soon. It's fixed on your server.
Dylan 17 Nov 2011 00:05
Thanks, everything is working great now. I appreciate the time you put into working this one out.