@@ -659,21 +659,23 @@ private function imageDetails($p, $f) {
659659 if (\TracyDebugger::getDataValue ('imagesInFieldListValues ' )) {
660660 $ inputfield = $ f ->getInputfield ($ p );
661661 }
662- if ($ f ->type instanceof FieldtypePage || $ f -> type instanceof FieldtypeRepeater) {
662+ if ($ f ->type instanceof FieldtypeRepeater) {
663663 if (is_object ($ p ->$ f ) && count ($ p ->$ f )) {
664- // $subpage is referenced page or repeater item
665664 foreach ($ p ->$ f as $ subpage ) {
666- $ subpage_of = $ subpage ->of ();
667- $ subpage ->of (false );
668- foreach ($ subpage as $ field => $ item ) {
669- $ f = $ this ->wire ('fields ' )->get ($ field );
670- if ($ item && $ f && $ f ->type instanceof FieldTypeImage) {
671- foreach ($ item as $ image ) {
672- $ imageStr .= $ this ->imageStr ($ f ->getInputfield ($ p ), $ image );
673- }
674- }
665+ $ imageStr .= $ this ->getImages ($ subpage );
666+ }
667+ }
668+ }
669+ elseif ($ f ->type instanceof FieldtypePage) {
670+ if (is_object ($ p ->$ f )) {
671+ $ fieldArray = array ();
672+ if ($ p ->$ f instanceof PageArray) {
673+ foreach ($ p ->$ f as $ subpage ) {
674+ $ imageStr .= $ this ->getImages ($ subpage );
675675 }
676- $ subpage ->of ($ subpage_of );
676+ }
677+ else {
678+ $ imageStr .= $ this ->getImages ($ p ->$ f );
677679 }
678680 }
679681 }
@@ -687,6 +689,24 @@ private function imageDetails($p, $f) {
687689 }
688690
689691
692+ private function getImages ($ p ) {
693+ $ p_of = $ p ->of ();
694+ $ p ->of (false );
695+ $ imageStr = '' ;
696+ foreach ($ p as $ field => $ item ) {
697+ $ f = $ this ->wire ('fields ' )->get ($ field );
698+ if ($ item && $ f && $ f ->type instanceof FieldTypeImage) {
699+ foreach ($ item as $ image ) {
700+ $ imageStr .= $ this ->imageStr ($ f ->getInputfield ($ p ), $ image );
701+ }
702+ }
703+ }
704+ $ p ->of ($ p_of );
705+
706+ return $ imageStr ;
707+ }
708+
709+
690710 private function imageStr ($ inputfield , $ image ) {
691711 if (isset ($ inputfield ) && $ inputfield ) {
692712 $ thumb = $ inputfield ->getAdminThumb ($ image );
0 commit comments