diff --git a/VERSIONS_HOTLINE/186851 b/VERSIONS_HOTLINE/186851 new file mode 100644 index 0000000000000000000000000000000000000000..e82bb2de4dce4b657b8bc08ba4176aab0826a510 --- /dev/null +++ b/VERSIONS_HOTLINE/186851 @@ -0,0 +1 @@ + - correctif #186851 : Moissonage OAI : Toutes les notices d'un domaine sont maintenant moissonables via OAI. \ No newline at end of file diff --git a/library/Class/WebService/OAI/Request/ListIdentifiers.php b/library/Class/WebService/OAI/Request/ListIdentifiers.php index 261ad44cfafc945eda453fb58719bf7b26bf06ab..c8700096cec250b5c039a461554acf8f4210dd22 100644 --- a/library/Class/WebService/OAI/Request/ListIdentifiers.php +++ b/library/Class/WebService/OAI/Request/ListIdentifiers.php @@ -130,9 +130,7 @@ class Class_WebService_OAI_Request_ListIdentifiers { : 1; $this->_notices = Class_Catalogue::getNoticesByPreferences(['id_catalogue' => $this->_catalogue->getId(), - 'start_limit' => $page_number==1 - ? 0 - : ($page_number -1) *self::$identifiers_by_page + 1, + 'start_limit' => ($page_number -1) *self::$identifiers_by_page, 'nb_notices' => self::$identifiers_by_page]); if (empty($this->_notices)) return $builder->error(['code' => 'noRecordsMatch']); diff --git a/tests/application/modules/opac/controllers/OAIControllerListIdentifiersTest.php b/tests/application/modules/opac/controllers/OAIControllerListIdentifiersTest.php index 9f74b310c23edf2a35707ce5fc6080448939beb3..0c25833fc66b3e326772ca15bfb9876acf0b21d5 100644 --- a/tests/application/modules/opac/controllers/OAIControllerListIdentifiersTest.php +++ b/tests/application/modules/opac/controllers/OAIControllerListIdentifiersTest.php @@ -202,14 +202,7 @@ class OAIControllerListIdentifiersWithPaginatorTest public function setUp() { parent::setUp(); Class_WebService_OAI_Request_ListIdentifiers::$identifiers_by_page = 3; - $this->fixture(Class_Notice::class, - ['id' => 1, - 'type_doc' => 1, - 'clef_alpha' => 'STARWARS1', - 'created_at' => '2001-12-14', - 'date_maj' => '2017-10-09 11:42:42', - 'titre_principal' => 'Star Wars']); - for($i=5; $i<=8; $i++) + for($i=5; $i<=9; $i++) $this->fixture(Class_Notice::class, ['id' => $i, 'type_doc' => 1, @@ -233,13 +226,13 @@ class OAIControllerListIdentifiersWithPaginatorTest ->answers(8) ->whenCalled('fetchAllByColumn') ->with('select notices.id_notice from notices Where (MATCH(facettes) AGAINST(\'+T1\' IN BOOLEAN MODE)) and type=1 order by alpha_titre LIMIT 0,3') - ->answers([1, 2, 3]) + ->answers([2, 3, 4]) ->whenCalled('fetchAllByColumn') - ->with('select notices.id_notice from notices Where (MATCH(facettes) AGAINST(\'+T1\' IN BOOLEAN MODE)) and type=1 order by alpha_titre LIMIT 4,3') - ->answers([4, 5, 6]) + ->with('select notices.id_notice from notices Where (MATCH(facettes) AGAINST(\'+T1\' IN BOOLEAN MODE)) and type=1 order by alpha_titre LIMIT 3,3') + ->answers([5, 6, 7]) ->whenCalled('fetchAllByColumn') - ->with('select notices.id_notice from notices Where (MATCH(facettes) AGAINST(\'+T1\' IN BOOLEAN MODE)) and type=1 order by alpha_titre LIMIT 7,3') - ->answers([7, 8]); + ->with('select notices.id_notice from notices Where (MATCH(facettes) AGAINST(\'+T1\' IN BOOLEAN MODE)) and type=1 order by alpha_titre LIMIT 6,3') + ->answers([8, 9]); }