diff --git a/library/Class/IntBib.php b/library/Class/IntBib.php index e471f5fd69a97d3ca4803bee35482cda1a651699..83505894d4a4cb5850a6db320875df3ed3f930c6 100644 --- a/library/Class/IntBib.php +++ b/library/Class/IntBib.php @@ -71,7 +71,7 @@ class Class_IntBib extends Storm_Model_Abstract { public function setCommParams($string_or_array) { if (is_array($string_or_array)) - $cfg = ZendAfi_Filters_Serialize::serialize($string_or_array); + $cfg = serialize($string_or_array); else $cfg = $string_or_array; return $this->_set('comm_params', $cfg); @@ -79,7 +79,7 @@ class Class_IntBib extends Storm_Model_Abstract { public function getCommParamsAsArray() { - $a = ZendAfi_Filters_Serialize::unserialize($this->getCommParams()); + $a = unserialize($this->getCommParams()); if (!is_array($a)) return []; return $a; diff --git a/library/Class/WebService/SIGB/Koha/GetRecordsResponseReader.php b/library/Class/WebService/SIGB/Koha/GetRecordsResponseReader.php index 3454128630ff0bf6aaed63e5304a80ec6f0d88a9..5d060435a69d85bced131df8ebc21b77eef2d59c 100644 --- a/library/Class/WebService/SIGB/Koha/GetRecordsResponseReader.php +++ b/library/Class/WebService/SIGB/Koha/GetRecordsResponseReader.php @@ -49,6 +49,8 @@ class Class_WebService_SIGB_Koha_GetRecordsResponseReader { public function setCodificationDisponibilites($codif) { + if (!trim($codif)) + return $this; foreach($codif as $status => $libelle) $this->_not_for_loan_status[$status] = $libelle; return $this; diff --git a/tests/library/Class/CommSigbTest.php b/tests/library/Class/CommSigbTest.php index 65e9c92e18fa57a4beb72c3d68256da4aea57c45..88b8c0e82db60497617ff05bb8843b40ffb54d5e 100644 --- a/tests/library/Class/CommSigbTest.php +++ b/tests/library/Class/CommSigbTest.php @@ -346,11 +346,12 @@ class CommSigbMeuseKohaTest extends CommSigbTestCase { public function setUp() { parent::setUp(); - $params = ['url_serveur' => 'http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl']; + $params = ['url_serveur' => 'http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl', + 'Codification_disponibilites' => "1:En prêt\r\n2:Réservable"]; $this->bib_koha = Class_IntBib::getLoader() ->newInstanceWithId(5) - ->setCommParams($params) + ->setCommParams(serialize($params)) ->setCommSigb(5); Class_WebService_SIGB_Koha::setService(array_merge($params, @@ -364,7 +365,8 @@ class CommSigbMeuseKohaTest extends CommSigbTestCase { public function getModeCommShouldReturnAnArrayWithCommParams() { $this->assertEquals(array("url_serveur" => 'http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl', "type" => Class_IntBib::COM_KOHA, - 'id_bib' => 5), + 'id_bib' => 5, + 'Codification_disponibilites' => "1:En prêt\r\n2:Réservable"), $this->bib_koha->getModeComm(5)); } }