Project

General

Profile

« Previous | Next » 

Revision 6ffb5f98

Added by Andreas Kohlbecker almost 5 years ago

fix #8220 TaxonNamePopupEditor to review or complete the exiting name to be registered

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java
274 274

  
275 275
            //getView().getNomReferenceCombobox().setEnabled(nomRef.isOfType(ReferenceType.Section));
276 276
            publishedUnit = nomRef;
277
            while(publishedUnit.isOfType(ReferenceType.Section) && publishedUnit.getInReference() != null){
278
                publishedUnit = nomRef.getInReference();
277
            if(publishedUnit != null){
278
                while(publishedUnit.isOfType(ReferenceType.Section) && publishedUnit.getInReference() != null){
279
                    publishedUnit = nomRef.getInReference();
280
                }
281
                // reduce available references to those which are sections of the publishedUnit and the publishedUnit itself
282
                // nomReferencePagingProvider
283
                nomReferencePagingProvider.getCriteria().add(Restrictions.or(
284
                        Restrictions.and(Restrictions.eq("inReference", publishedUnit), Restrictions.eq("type", ReferenceType.Section)),
285
                        Restrictions.idEq(publishedUnit.getId())
286
                        )
287
                );
279 288
            }
280
            // reduce available references to those which are sections of the publishedUnit and the publishedUnit itself
281
            // nomReferencePagingProvider
282
            nomReferencePagingProvider.getCriteria().add(Restrictions.or(
283
                    Restrictions.and(Restrictions.eq("inReference", publishedUnit), Restrictions.eq("type", ReferenceType.Section)),
284
                    Restrictions.idEq(publishedUnit.getId())
285
                    )
286
            );
287 289
            // and remove the empty option
288 290
            getView().getNomReferenceCombobox().getSelect().setNullSelectionAllowed(false);
289 291

  

Also available in: Unified diff