-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chunk not rendering results after upgrade to 2.0.0-beta2 #91
Comments
Can you please wrap your code blocks in double or triple backtick, so they are readable? So to display this: It'd be easier to help if decoding of your code was not an issue. ;) |
OK - I've updated it. Does that work? Or I can add a file instead |
Could benefit the other two code sections too, since those are hard to read as well right now. |
Well, I was just trying to help so you can submit readable ModX code segments in markdown, which in turn would help you to get meaningful answers. Regarding your issue: I've had lot of problems with v2.0.0-beta2 around not handling extracts properly. I have lot of fixes in my local repo, but haven't got the time yet to make PRs for them. I'll take a look at some point and I may be able to help or at least to explain why is it not working. Will keep an eye out for this ticket. For reference:
And the extract from the chunk:
By the way, which chunk is it from? |
The &tpl chunk
|
Ended up rolling back to version 1.0.1 as I need the chunk to render the results. |
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
/**
*/
/*
Main class:
*/
$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.
The text was updated successfully, but these errors were encountered: