-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Recently upgraded this extra and now I am not getting any results in my output.
Site is running on MODX 2.7.3, PHP 7.3 and Zend libraries included
I am using the following call on my results page:
[[!AdvSearch? &queryHook=`propertyQHook` &showExtract=`1:price` &containerTpl=`propertyAdvSearchResults` &tpl=`SearchResultTpl` &perPage=`5` ]]
And whilst the page returns results, none of the placeholders in the chunk are returned. I have prefixed all the placeholders with advsearch. but still nothing comes back.
Below is an extract from my chunk:
``
Property Type: [[+advsearch.property_type:ucwords]]
[[+advsearch.bedrooms:is=1:then=`1 bedroom`:else=`[[+advsearch.bedrooms]] bedrooms`]]
[[+advsearch.heating]]
[[+advsearch.furnish]]
Availability: [[+advsearch.availability:strtotime:date=`%e %b %Y`]]
There is nothing in the error log to suggest the issue.
My snippet is:
``<?php
/**
- AdvSearch
- Copyright 2012 by Coroico coroico@wangba.fr
- Query hook
*/
/*
Main class:
package - The name of the schema Package to add. e.g: dvd
packagePath - The path to the model/ directory where the package is located. Use {core_path} as generic variable.
class - The class name of the table you want to search. e.g: dvd
and optionally (these parameters could be passed thru the snippet call):
withFields - A comma-separated list of column names where to search.
fields - A comma-separated list of column names to display.
ids - A comma-separated list of primary keys to filter where the search should occurs.
where - criteria or Array of criteria. e.g: "studio IN ('20th Century Fox','DreamWorks Home Ent.','Warner Bros') "
sortby - csv list of couple 'columnName (ASC| DESC)'.
*/
$main = array(
'package' => 'lettings',
'packagePath' => '{core_path}components/lettings/model/',
'class' => 'Lettings',
'fields' => 'feature_image , street , town , county , price , bedrooms , property_type , heating , furnish , availability , status', // displayed
'withFields' => 'property_name , town , bedrooms , property_type , generic_property_type , bedrooms , price', // where we do the search
'where' => '(Lettings.published = 1)',
'sortby' => 'Lettings.price DESC',
'tablePrefix' => 'tls_'
);
$andConditions = array(
'Lettings.town:=' => 'town:request:all',
'Lettings.generic_property_type:=' => 'generic_property_type:request:all',
'Lettings.price:>=' => 'min-price:request:none',
'Lettings.price:<=' => 'max-price:request:none',
'Lettings.bedrooms:=' => 'bedrooms:request:all'
);
//$main['tablePrefix'] = 'modx_';
// set the query hook declaration
$qhDeclaration = array(
'qhVersion' => '1.2', // version of queryHook - to manage futures changes
'main' => $main,
'andConditions' => $andConditions
);
$hook->setQueryHook($qhDeclaration);
return true;``
Please could you suggest a resolution.