From 8b4f1796fa752b9f3681e822d2ff6ad4520d613c Mon Sep 17 00:00:00 2001
From: llaffont <llaffont@git-test.afi-sa.fr>
Date: Mon, 7 May 2012 13:42:22 +0000
Subject: [PATCH] =?UTF-8?q?OAI:=20fonctionne=20si=20aucun=20metadataPrefix?=
 =?UTF-8?q?=20donne=CC=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 library/Class/WebService/OAI/Request/ListIdentifiers.php  | 5 +----
 .../opac/controllers/OAIControllerListIdentifiersTest.php | 8 --------
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/library/Class/WebService/OAI/Request/ListIdentifiers.php b/library/Class/WebService/OAI/Request/ListIdentifiers.php
index b4aa291705e..dae415b5384 100644
--- a/library/Class/WebService/OAI/Request/ListIdentifiers.php
+++ b/library/Class/WebService/OAI/Request/ListIdentifiers.php
@@ -35,7 +35,7 @@ class Class_WebService_OAI_Request_ListIdentifiers {
 	
 	public function __construct($params, $baseUrl) {
 		$this->_baseUrl = $baseUrl;
-		$this->_params = array_merge(array('metadataPrefix' => null,
+		$this->_params = array_merge(array('metadataPrefix' => 'oai_dc',
 																			 'set' => null,
 																			 'from' => null,
 																			 'until' => null,
@@ -58,9 +58,6 @@ class Class_WebService_OAI_Request_ListIdentifiers {
 
 
 	public function getErrorOn($builder) {
-		if (!$this->_metadataPrefix) 
-			return $builder->error(array('code' => 'badArgument'), 'Missing metadataPrefix');
-
 		if ('oai_dc' != $this->_metadataPrefix) 
 			return $builder->error(array('code' => 'cannotDisseminateFormat'));
 
diff --git a/tests/application/modules/opac/controllers/OAIControllerListIdentifiersTest.php b/tests/application/modules/opac/controllers/OAIControllerListIdentifiersTest.php
index 6353c83f36a..b0ea4edf2f7 100644
--- a/tests/application/modules/opac/controllers/OAIControllerListIdentifiersTest.php
+++ b/tests/application/modules/opac/controllers/OAIControllerListIdentifiersTest.php
@@ -228,14 +228,6 @@ class OAIControllerListIdentifiersInvalidParamsTest extends AbstractControllerTe
 	}
 
 
-	/** @test */
-	public function withoutMetadataPrefixErrorCodeShouldBeBadArgument() {
-		$this->dispatch('/opac/oai/request?verb=ListIdentifiers');
-		$this->_xpath->assertXPath($this->_response->getBody(), 
-															 '//oai:error[@code="badArgument"]');
-	}
-
-
 	/** @test */
 	public function withUnknownFormatErrorCodeShouldBeCannotDisseminateFormat() {
 		$this->dispatch('/opac/oai/request?verb=ListIdentifiers&metadataPrefix=zork');
-- 
GitLab