Changeset 3980


Ignore:
Timestamp:
Nov 19, 2007, 2:20:14 PM (14 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #829: Item not found: Annotation[new]

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/Base.java

    r3979 r3980  
    10621062        {
    10631063          AnnotationType at = AnnotationType.getById(dc, annotationTypeId);
     1064          String[] values = request.getParameterValues(String.valueOf(at.getId()));
    10641065          Annotation oldAn = oldAs == null || !oldAs.hasAnnotation(at) ?
    10651066            null : oldAs.getAnnotation(at);
    1066           Annotation newAn = newAs.getAnnotation(at);
     1067          Annotation newAn = newAs.hasAnnotation(at) || values != null ?
     1068            newAs.getAnnotation(at) : null;
     1069          if (newAn == null) continue;
     1070
    10671071          if (oldAn == null && newAn.isInDatabase() || oldAn != null && oldAn.getValuesVersion() != newAn.getValuesVersion())
    10681072          {
     
    10701074          }
    10711075          Type valueType = at.getValueType();
    1072           String[] values = request.getParameterValues(String.valueOf(at.getId()));
    10731076          if (values == null)
    10741077          {
  • trunk/src/core/net/sf/basedb/core/AnnotationSet.java

    r3979 r3980  
    430430    {
    431431      AnnotationData ad = getData().getAnnotations().remove(annotationType.getData());
    432       if (ad != null)
     432      if (ad != null && ad.getId() != 0)
    433433      {
    434434        Annotation a = dc.getItem(Annotation.class, ad);
Note: See TracChangeset for help on using the changeset viewer.