From: Michael J. Rubinsky Date: Fri, 30 Oct 2009 23:07:24 +0000 (-0400) Subject: I guess we're not returning status AND results from ajax calls after all... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=1a673846064fc925a7f86e23c7295542a80796c4;p=horde.git I guess we're not returning status AND results from ajax calls after all... --- diff --git a/ansel/lib/Ajax/Imple/LocationAutoCompleter.php b/ansel/lib/Ajax/Imple/LocationAutoCompleter.php index 1042c15c1..f3eadd51d 100644 --- a/ansel/lib/Ajax/Imple/LocationAutoCompleter.php +++ b/ansel/lib/Ajax/Imple/LocationAutoCompleter.php @@ -60,19 +60,11 @@ class Ansel_Ajax_Imple_LocationAutoCompleter extends Horde_Ajax_Imple_AutoComple } $locs = $GLOBALS['ansel_storage']->searchLocations($input); if (is_a($locs, 'PEAR_Error')) { - return array('response' => 0); + Horde::logMessage($locs->getMessage(), __FILE__, __LINE__, PEAR_LOG_ERR); + $locs = array(); } - $results = $locs; - - if (count($results) == 0) { - $results = array('response' => 0, 'message' => array()); - } else { - $results = array('response' => count($results), - 'message' => Horde_Serialize::serialize($results, Horde_Serialize::JSON, Horde_Nls::getCharset())); - } - - return $results; + return Horde_Serialize::serialize($locs, Horde_Serialize::JSON, Horde_Nls::getCharset()); } }