Project

General

Profile

« Previous | Next » 

Revision 72dad6d3

Added by Andreas Kohlbecker over 12 years ago

fixing #2551 (Taxon profile image sometimes substituted by other images)

View differences:

cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonPortalController.java
820 820
        // collect all media of the given taxon
821 821
        boolean limitToGalleries = false;
822 822
        List<Media> taxonMedia = new ArrayList<Media>();
823
        List<Media> taxonGalleryMedia = new ArrayList<Media>();
823 824
        for(TaxonDescription desc : p.getRecords()){
824
            if(!limitToGalleries || desc.isImageGallery()){
825

  
826
            if(desc.isImageGallery()){
827
                for(DescriptionElementBase element : desc.getElements()){
828
                    for(Media media : element.getMedia()){
829
                        taxonGalleryMedia.add(media);
830
                    }
831
                }
832
            } else if(!limitToGalleries){
825 833
                for(DescriptionElementBase element : desc.getElements()){
826 834
                    for(Media media : element.getMedia()){
827 835
                        taxonMedia.add(media);
828 836
                    }
829 837
                }
830 838
            }
839

  
831 840
        }
832 841

  
833
        List<Media> returnMedia = MediaUtils.findPreferredMedia(taxonMedia, type,
842
        taxonGalleryMedia.addAll(taxonMedia);
843

  
844
        List<Media> returnMedia = MediaUtils.findPreferredMedia(taxonGalleryMedia, type,
834 845
                mimeTypes, null, widthOrDuration, height, size);
835 846

  
836 847
        return returnMedia;

Also available in: Unified diff