low_search_excerpt, low_search_score & low_search_keywords all failed to render
Hi Low
Below is the code I'm using for search results display.
{exp:low_search:results
query="{segment_2}"
limit="20"
status="not closed"
}
{if count == 1}<h2>Searched for <strong>{low_search_keywords}</strong>.</h2>{/if}
<p>
<a href="{page_uri}"><strong>{if pages_title}{pages_title}{/if}{if pages_title == ''}{title}{/if}</strong></a> <em>score: {low_search_score}</em><br />
{low_search_excerpt}
</p>
{if no_results}<p>Sorry, no results were found</p>{/if}
{/exp:low_search:results}
Results displayed without variables rendered e.g.
Searched for {low_search_keywords}
Newsroom score: {low_search_score}
{low_search_excerpt}
Any ideas why they're not rendering?
Replies
Low 20 Sep 2012 08:44
Hmm, not sure. Seems like the extension part of the add-on isn't kicking in correctly.
Can you check if the extension is enabled correctly? What other extensions are running?
Cem Meric 20 Sep 2012 10:22
Uninstalled reinstalled, same result.
These are current extensions enabled
Zoo Flexible Admin
URL Helper
Structure
Store
SafeCracker
QuickSave
Playa
MX Title Control
MX Cloner
Missing Link
Matrix
Low Variables
Low Search
Low Alphabet
Low 20 Sep 2012 10:24
Taking a look myself would probably be quickest. is it online somewhere, so I can take a look? You can send superadmin login credentials to hi at gotolow dot com.
Cem Meric 20 Sep 2012 10:32
All internal at the moment Low. I'll move it to staging server sometime next week though.
Low 20 Sep 2012 10:37
Well, you'll need to disable any extensions that use the channel_entries_query_result hook one by one, to see if that interferes somehow.
I know Low Alphabet uses it, but that shouldn't be the cause of it. Any other extensions use that hook? You can check by looking at the exp_extensions table in the SQL manager.
Cem Meric 20 Sep 2012 10:37
If I change keywords as in
Searched for {exp:low_search:keywords query='{segment_2}'}
I can then see the keywords but low_search_score & low_search_excerpt still has no output.
Low 20 Sep 2012 10:39
The extension sets those variables to be replaced by the native channel:entries tag. I'm guessing another extension isn't using the last_call variable and thus overwriting the vars set by LS.
Cem Meric 20 Sep 2012 11:15
If I leave only the exp:low_search:keywords in template this is the run down I'm getting
(0.011856 / 7.34MB) Parse Date Format String Constants
(0.011902 / 7.34MB) Parse Current Time Variables
(0.011968 / 7.34MB) Parsing Segment, Embed, and Global Vars Conditionals
(0.017045 / 7.35MB) - Beginning Tag Processing -
(0.017099 / 7.35MB) Parsing Tags in Template
(0.017165 / 7.35MB) Tag: {exp:low_search:results query="eyJrZXl3b3JkcyI6Im9yZGVyIiwic2VhcmNoX21vZGUiOiJhbGwiLCJyZXN1bHRfcGFnZSI6Ilwvc2VhcmNoIiwiY29sbGVjdGlvbiI6eyIwIjoiMiIsIjEiOiIxIn19" limit="20" status="not closed" }
(0.017335 / 7.35MB) Closing Tag Found
(0.017461 / 7.35MB) Processing Tags
(0.017528 / 7.36MB) Module Tag: Low_search/results
(0.017560 / 7.36MB) Including Files for Plugins and Modules
(0.025209 / 7.74MB) Files for Plugins and Modules All Included
(0.026121 / 7.76MB) Beginning Final Tag Data Processing
(0.026166 / 7.76MB) Calling Class/Method: Low_search/results
(0.026589 / 7.76MB) -> Class Called: Low_search
(0.036856 / 8.24MB) -> Method Called: results
(0.054869 / 8.35MB) Low Search: starting search (fulltext)
(0.056589 / 8.38MB) Low Search: Applying collection modifier to search results
(0.057022 / 8.38MB) Low Search: Caching search results
(0.057094 / 8.38MB) Low Search: Setting fixed_order parameter
(0.057266 / 8.38MB) Low Search: Calling the channel module
(0.139707 / 12.24MB) Calling Extension Class/Method: Low_alphabet_ext/channel_entries_query_result
(0.142369 / 12.34MB) Calling Extension Class/Method: Low_search_ext/channel_entries_query_result
(0.364963 / 12.56MB) Calling Extension Class/Method: Store_ext/channel_entries_query_result
(0.437380 / 15.71MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.439668 / 15.74MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.444221 / 15.77MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.444675 / 15.77MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.448112 / 15.78MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.448555 / 15.78MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.452002 / 15.79MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.452441 / 15.79MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.455916 / 15.79MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.456376 / 15.80MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.459852 / 15.80MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.460308 / 15.80MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.463829 / 15.81MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.464291 / 15.81MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.467785 / 15.82MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.468235 / 15.82MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.471767 / 15.83MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.472201 / 15.83MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.474303 / 15.83MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.474733 / 15.83MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.478232 / 15.84MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.478659 / 15.84MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.482203 / 15.85MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.482631 / 15.85MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.486133 / 15.86MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.486565 / 15.86MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.490124 / 15.87MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.490577 / 15.87MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.492739 / 15.87MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.493170 / 15.87MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.496716 / 15.88MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.497150 / 15.88MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.500652 / 15.89MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.501090 / 15.89MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.504616 / 15.90MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.505050 / 15.90MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.507143 / 15.91MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.507601 / 15.91MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.511041 / 15.91MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.511562 / 15.91MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.515134 / 15.66MB) -> Data Returned
(0.515442 / 15.64MB) Parsing Tags in Template
(0.515520 / 15.65MB) Tag: {exp:low_search:keywords query='eyJrZXl3b3JkcyI6Im9yZGVyIiwic2VhcmNoX21vZGUiOiJhbGwiLCJyZXN1bHRfcGFnZSI6Ilwvc2VhcmNoIiwiY29sbGVjdGlvbiI6eyIwIjoiMiIsIjEiOiIxIn19'}
(0.515699 / 15.65MB) No Closing Tag
(0.515827 / 15.65MB) Processing Tags
(0.515897 / 15.65MB) Module Tag: Low_search/keywords
(0.515929 / 15.65MB) Including Files for Plugins and Modules
(0.515958 / 15.65MB) Files for Plugins and Modules All Included
(0.515984 / 15.65MB) Beginning Final Tag Data Processing
(0.516016 / 15.65MB) Calling Class/Method: Low_search/keywords
(0.516214 / 15.65MB) -> Class Called: Low_search
(0.516625 / 15.65MB) -> Method Called: keywords
(0.516897 / 15.65MB) -> Data Returned
(0.516992 / 15.65MB) - End Tag Processing -
(0.517048 / 15.65MB) Processing Advanced Conditionals
(0.529960 / 15.66MB) Calling Extension Class/Method: Structure_ext/template_post_parse
(0.530204 / 15.65MB) - End Template Processing -
(0.530229 / 15.65MB) Parse Global Variables
(0.532822 / 15.65MB) Template Parsing Finished
It looks like last called class is LS. Is that right?
Low 20 Sep 2012 11:19
Nope, Store is calling the hook after Low Search. What happens if you disable that? You can also try and change the priority of that row in the exp_extensions table to, say, 5.
Cem Meric 20 Sep 2012 11:30
Ok, these all have priority as 10.
Do you want me to try changing Low_search_ext rows to 5?
Low 20 Sep 2012 11:32
No, try and change the priority of the Store_ext/channel_entries_query_result row to 5.
Cem Meric 20 Sep 2012 11:38
Done!
Changed Store_ext channel_entries_query_result priority to 5. All working fine.
Do you mind explaining how would priority effect each other extension? Would this create a problem in the future for Store_ext?
Low 20 Sep 2012 11:48
Apparently, that particular method in Store_ext isn't checking the last_call property, explained here.
Basically, all methods (add-ons, in this case) using the same hook are executed in order of priority -- the priority 1 extension is called first, then 2 etc. In order to 'keep' the changes made in each method, they must check the last_call property. If they don't, changes made before will get overwitten. In this case, the setting of the {low_search_...} variables is being negated by Store. This will also be the case of {low_alphabet_...} vars, in the {exp:low_alphabet:entries} tag. Same principle.
So, if you want to be sure that it will work for you in the future, set the Store_ext/channel_entries_query_result to 1 (instead of 5), so it is executed first; then set Low_alphabet_ext/channel_entries_query_result to 5, so it is executed after Store and which does contain the last_call check. Then everything should work fine, *including* LA and LS tags.
Finally, create a bug report over at the Store devs, saying they should check for last_call in their extension methods.
Cem Meric 20 Sep 2012 23:51
Thanks Low, much appreciated & bug reported http://is.gd/VOs88B :)
Low 21 Sep 2012 07:27
Cool. Looks like they're pretty quick with the fix, too!