File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -418,7 +418,20 @@ private function referenceFields()
418418
419419 /* filter on indizes */
420420 if ($ _indexRange = $ this ->getIndexRange ($ this ->spec ['field ' ], count ($ this ->fields ))) {
421- $ this ->fields = array_intersect_key ($ this ->fields , array_flip ($ _indexRange ));
421+ $ prevTag = "" ;
422+ $ index = 0 ;
423+ foreach ($ this ->fields as $ position => $ field ) {
424+ if (false == ($ field instanceof File_MARC_Field)) {
425+ continue ;
426+ }
427+ $ tag = $ field ->getTag ();
428+ $ index = ($ prevTag == $ tag or "" == $ prevTag ) ? $ index : 0 ;
429+ if (!in_array ($ index , $ _indexRange )) {
430+ unset($ this ->fields [$ position ]);
431+ }
432+ $ index ++;
433+ $ prevTag = $ tag ;
434+ }
422435 }
423436
424437 /* filter on indicators */
Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ public function testGetRepeatable()
7979 $ this ->assertTrue (17 == $ Reference ->data [0 ]->getPosition ());
8080 $ this ->assertTrue (18 == $ Reference ->data [1 ]->getPosition ());
8181 }
82+
83+ public function testGetRepeatableWildcard ()
84+ {
85+ $ Reference = new File_MARC_Reference ('0..[1] ' , $ this ->record );
86+ $ this ->assertSame (1 , count ($ Reference ->data ));
87+ }
8288
8389 public function testGetRepeatableWildCardSubstring ()
8490 {
You can’t perform that action at this time.
0 commit comments