From c4936399c685f390e7a74d359721d18ba4146fd7 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Mon, 12 Nov 2012 19:29:48 +0100 Subject: [PATCH] Fix tests --- lib/Alchemy/Phrasea/Controller/Admin/Users.php | 6 +++--- lib/Alchemy/Phrasea/Controller/Prod/Edit.php | 2 +- lib/classes/databox.class.php | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Users.php b/lib/Alchemy/Phrasea/Controller/Admin/Users.php index a863ee8466..562518b00f 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Users.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Users.php @@ -98,7 +98,7 @@ class Users implements ControllerProviderInterface $rights = new UserHelper\Edit($app, $app['request']); $rights->apply_quotas(); - return; + return $app->json(array('message' => '', 'error' => false)); }); $controllers->post('/rights/time/', function(Application $app) { @@ -111,7 +111,7 @@ class Users implements ControllerProviderInterface $rights = new UserHelper\Edit($app, $app['request']); $rights->apply_time(); - return; + return $app->json(array('message' => '', 'error' => false)); }); $controllers->post('/rights/masks/', function(Application $app) { @@ -124,7 +124,7 @@ class Users implements ControllerProviderInterface $rights = new UserHelper\Edit($app, $app['request']); $rights->apply_masks(); - return; + return $app->json(array('message' => '', 'error' => false)); }); $controllers->match('/search/', function(Application $app) { diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Edit.php b/lib/Alchemy/Phrasea/Controller/Prod/Edit.php index ba10870ccf..6462b07966 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Edit.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Edit.php @@ -302,7 +302,7 @@ class Edit implements ControllerProviderInterface } if (!is_array($request->request->get('mds'))) { - return; + return $app->json(array('message' => '', 'error' => false)); } $databoxes = $records->databoxes(); diff --git a/lib/classes/databox.class.php b/lib/classes/databox.class.php index 6b6ea9199e..bb90fc248e 100644 --- a/lib/classes/databox.class.php +++ b/lib/classes/databox.class.php @@ -965,10 +965,14 @@ class databox extends base $thesaurus = $this->get_thesaurus(); - if ($thesaurus && ($tmp = DomDocument::loadXML($thesaurus)) !== false) + $dom = new DOMDocument(); + + if ($thesaurus && false !== $tmp = $dom->loadXML($thesaurus)) { self::$_dom_thesaurus[$sbas_id] = $tmp; - else + } else { self::$_dom_thesaurus[$sbas_id] = false; + unset($dom); + } return self::$_dom_thesaurus[$sbas_id]; }