Project

General

Profile

« Previous | Next » 

Revision 48936d85

Added by Andreas Kohlbecker 5 months ago

fix #9913 fixing collection label in select lists

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/util/CollectionCaptionGenerator.java
10 10

  
11 11
import java.util.Objects;
12 12

  
13
import org.apache.commons.lang3.StringUtils;
13 14
import org.vaadin.viritin.fields.CaptionGenerator;
14 15

  
15 16
import eu.etaxonomy.cdm.model.occurrence.Collection;
......
28 29
    @Override
29 30
    public String getCaption(Collection option) {
30 31
        String caption = Objects.toString(option.getCode(), "");
31
        option.getTitleCache();
32 32
        if(option.getInstitute() != null){
33 33
            caption += (caption.isEmpty() ? "" : " - ") + option.getInstitute().getTitleCache();
34 34
        }
35
        if(StringUtils.isBlank(caption)) {
36
            caption = option.getTitleCache();
37
        }
35 38
        return caption;
36 39
    }
37 40
}

Also available in: Unified diff