Coroico / AdvSearch

Dynamic content search add-on for MODx Revolution that supports results highlighting, faceted search and search in custom packages
21 stars 14 forks source link

Adding all placeholders to the chunk #86

Open Mark-H opened 7 years ago

Mark-H commented 7 years ago

While fields may be selected in the query, they're not automatically made available in the chunk. In this particular case the fields I need come from a joined table with translated content (lingua) which are added in a query hook. Similar situation to #85. They're selected, but not returned.

I've tried several ways of getting the placeholders added normally, but eventually I ended up with a rather simple tweak in AdvSearch. Perhaps this is a change you'd be interested in adding to a future release?

core/components/advsearch/controllers/advsearch.mysql.controller.class.php

Line 325-ish:

-$result = $resource->get($displayedFields);
+$result = $resource->toArray('', true, false);

Line 335-ish:

-$results[] = $resource->get($displayedFields);
+$results[] = $resource->toArray('', true, false);