Changeset 2122

Show
Ignore:
Timestamp:
29-11-11 15:18:19 (2 years ago)
Author:
work@…
Message:

fixed issue #518 where some templates did not show all template fields when multiple templates exist for different entities but with the same name

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/studycapturing/StudyWizardController.groovy

    r2121 r2122  
    16141614                def number              = params.get('addNumber') as int 
    16151615                def species             = Term.findByName(params.get('species')) 
    1616                 def template    = Template.findByName(params.get('template')) 
     1616                def template    = Template.findAllByName( params.get('template')).find { it.entity == dbnp.studycapturing.Subject } 
    16171617 
    16181618                // can we add subjects? 
     
    18981898                        def templateName = params.get('template_' + sample.getIdentifier()) 
    18991899                        if (templateName && sample.template?.name != templateName) { 
    1900                                 sample.template = Template.findByName(templateName) 
     1900                                sample.template = Template.findAllByName(params.get(templateName)).find { it.entity == dbnp.studycapturing.Sample } 
    19011901                        } 
    19021902