Page MenuHomePhabricator
Paste P2014

Search Double
ActivePublic

Authored by chad on Oct 15 2016, 4:21 AM.
Tags
None
Referenced Files
F1871160: Search Double
Oct 15 2016, 4:21 AM
Subscribers
<?php
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())
->setViewer($viewer)
->withIDs(array($conpherence_id))
->executeOne();
if (!$conpherence) {
return new Aphront404Response();
}
$engine = new ConpherenceThreadSearchEngine();
$engine->setViewer($viewer);
$saved = $engine->buildSavedQueryFromBuiltin('all')
->setParameter('phids', array($conpherence->getPHID()))
->setParameter('fulltext', $fulltext);
$pager = $engine->newPagerForSavedQuery($saved);
$pager->setPageSize(15);
$query = $engine->buildQueryFromSavedQuery($saved);
$results = $engine->executeQuery($query, $pager);
$view = $engine->renderResults($results, $saved);
$content = $view->getContent();
$content->render();
return $this->newPage()
->appendChild($content);
}
}

Event Timeline

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?

yay I found the double render

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