diff --git a/module/VuFind/src/VuFind/RecordDriver/Feature/MarcAdvancedTrait.php b/module/VuFind/src/VuFind/RecordDriver/Feature/MarcAdvancedTrait.php index 901227f913e..700c88f799b 100644 --- a/module/VuFind/src/VuFind/RecordDriver/Feature/MarcAdvancedTrait.php +++ b/module/VuFind/src/VuFind/RecordDriver/Feature/MarcAdvancedTrait.php @@ -1198,11 +1198,7 @@ protected function checkIndicatorFilter($marc_data, $indFilter): bool * Check if the indicator filters match the provided marc data * * @param array $marc_data MARC data for a specific field - * @param array $indData Array containing the indicator number as the key - * and the value as an array of strings for the allowed indicator values - * ex: [['1' => ['1', '2']], ['2' => ['']]] would filter fields ind1 = 1 or 2 or ind2 = blank - * ex: [['1' => ['1'], '2' => ['7']]] would filter fields with ind1 = 1 and ind2 = 7 - * ex: [] would apply no filtering based on indicators + * @param array $indData Indicator filters as described in getMarcFieldWithInd() * * @return bool */ @@ -1227,8 +1223,10 @@ protected function checkIndicatorFilters($marc_data, $indData): bool * * @param string $field Marc field to search within * @param ?array $subfield Sub-fields to return or empty for all - * @param array $indData Array containing the indicator number as the key - * and the value as an array of strings for the allowed indicator values + * @param array $indData Array of filter arrays, each in the format indicator number => + * array of allowed indicator values. If any one of the filter arrays fully matches the indicator + * values in the field, data will be returned. If no filter arrays are defined, data will always + * be returned regardless of indicators. * ex: [['1' => ['1', '2']], ['2' => ['']]] would filter fields ind1 = 1 or 2 or ind2 = blank * ex: [['1' => ['1'], '2' => ['7']]] would filter fields with ind1 = 1 and ind2 = 7 * ex: [] would apply no filtering based on indicators diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/Feature/MarcAdvancedTraitTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/Feature/MarcAdvancedTraitTest.php index f18435316f5..588c8d16645 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/Feature/MarcAdvancedTraitTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/Feature/MarcAdvancedTraitTest.php @@ -239,7 +239,7 @@ public function testGetMarcFieldWithIndTwoValues(): void /** * Test getMarcFieldWithInd when multiple indicators are requested - * as OR conditions + * as AND conditions * * @return void */ @@ -256,7 +256,7 @@ public function testGetMarcFieldWithIndMultAndInds(): void /** * Test getMarcFieldWithInd when multiple indicators are requested - * as AND conditions + * as OR conditions * * @return void */