diff --git a/grails-app/controllers/au/org/ala/specieslist/EditorController.groovy b/grails-app/controllers/au/org/ala/specieslist/EditorController.groovy index dc982f0ae..7f12baf71 100644 --- a/grails-app/controllers/au/org/ala/specieslist/EditorController.groovy +++ b/grails-app/controllers/au/org/ala/specieslist/EditorController.groovy @@ -246,10 +246,11 @@ class EditorController { // find common name and save it helperService.matchCommonNamesForSpeciesListItems([sli]) - def preferredSpeciesImageListName = grailsApplication.config.ala.preferred.species.name + // Commented out as we would like to keep species list generic + /* def preferredSpeciesImageListName = grailsApplication.config.ala.preferred.species.name if (sl.listName == preferredSpeciesImageListName) { helperService.syncBieImage (sli, params.imageId) - } + }*/ render(text: "Record successfully created", status: 200) } else { diff --git a/grails-app/controllers/au/org/ala/specieslist/WebServiceController.groovy b/grails-app/controllers/au/org/ala/specieslist/WebServiceController.groovy index 34b621791..7dc8bb90a 100644 --- a/grails-app/controllers/au/org/ala/specieslist/WebServiceController.groovy +++ b/grails-app/controllers/au/org/ala/specieslist/WebServiceController.groovy @@ -250,8 +250,15 @@ class WebServiceController { if (preferredSpeciesListDruid) { def speciesList = SpeciesListItem.findAllByDataResourceUid(preferredSpeciesListDruid) if (speciesList.size() > 0) { - newList = speciesList.collect({ - [name: it.rawScientificName, imageId: it.kvpValues.first().grep { it.value }.value.get(0)] + speciesList.each({ + def scientificName = it.rawScientificName + if (it.kvpValues) { + it.kvpValues.each { + if (it.key == 'imageId' && it.value != "") { + newList.push(name: scientificName, imageId: it.getValue()) + } + } + } }) } } diff --git a/grails-app/services/au/org/ala/specieslist/HelperService.groovy b/grails-app/services/au/org/ala/specieslist/HelperService.groovy index c48d8883d..ccab3fb8e 100644 --- a/grails-app/services/au/org/ala/specieslist/HelperService.groovy +++ b/grails-app/services/au/org/ala/specieslist/HelperService.groovy @@ -678,6 +678,7 @@ class HelperService { } } +/* Commented out to keep species list from updating Bie def syncBieImage (sli, imageId) { boolean updateBieImage = false int imageIdPos = sli.getImageUrl()? sli.getImageUrl().toLowerCase().indexOf("?imageid=") : 0 @@ -703,6 +704,7 @@ class HelperService { } } } +*/ /**