Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…PreferredSpeciesList 500 error. Only get the list where imageId is set. Also remove the functionality to update Bie from species list
  • Loading branch information
patkyn committed Mar 2, 2017
1 parent 3e2b872 commit aefa972
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
}
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -703,6 +704,7 @@ class HelperService {
}
}
}
*/


/**
Expand Down

0 comments on commit aefa972

Please sign in to comment.