Page MenuHomePhabricator
Paste P2014

Search Double

Authored by chad on Oct 15 2016, 4:21 AM.
final class ConpherenceThreadSearchController
extends ConpherenceController {
public function shouldAllowPublic() {
return true;
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$conpherence_id = $request->getURIData('id');
$fulltext = $request->getStr('fulltext');
$conpherence = id(new ConpherenceThreadQuery())
if (!$conpherence) {
return new Aphront404Response();
$engine = new ConpherenceThreadSearchEngine();
$saved = $engine->buildSavedQueryFromBuiltin('all')
->setParameter('phids', array($conpherence->getPHID()))
->setParameter('fulltext', $fulltext);
$pager = $engine->newPagerForSavedQuery($saved);
$query = $engine->buildQueryFromSavedQuery($saved);
$results = $engine->executeQuery($query, $pager);
$view = $engine->renderResults($results, $saved);
$content = $view->getContent();
return $this->newPage()

Event Timeline

chad created this paste.Oct 15 2016, 4:21 AM

This page renders transactions twice, by example, at line 39. Nothing else renders twice. I poked around AphrontAjaxResponse and nothing looked hokey, but I can't really figure this out. The double transactions appear to come from multiple render calls somewhere in AphrontAjaxResponse?

chad added a comment.Oct 15 2016, 4:33 AM

yay I found the double render

chad added a comment.Oct 15 2016, 4:33 AM

probably still a bug somewhere else tho, but i solved my problemo