Changeset 7285


Ignore:
Timestamp:
Jan 26, 2017, 1:52:55 PM (5 years ago)
Author:
Nicklas Nordborg
Message:

References #2049: Project-specific annotations

Fixes a minor issue in the "Edit annotation" dialog that caused it to select a different annotation than the one that was clicked on in the following circumstances:

  • A project-specific annotation was selected to be inherited from a parent item
  • The default annotation was already inherited
  • The annotation type can be used on both the parent and child item type but it has no current value on the child item

When clicking on the project-specific annotation that is about to be inherited the annotation type without a value was selected instead.

Saving seems to work as expected and re-opening the edit dialog gets rid of the problem.

The cause of the problem was that more than one entry was created with the same id (=the id of the annotation type).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.10-stable/src/clients/web/net/sf/basedb/clients/web/AnnotationUtil.java

    r7208 r7285  
    167167    // The base object has 'id', 'source', 'annotationType' and 'annotation'
    168168    JSONObject json = new JSONObject();
    169     json.put("id", ""+at.getId() + (a!=null ? "-" + a.getId() : ""));
     169    String id = ""+at.getId();
     170    if (a != null) id += "-" + a.getId();
     171    if (inherited != null) id += "-" + inherited.getId();
     172    json.put("id", id);
    170173    // If 'a' is null this is a primary annotation that has no current values
    171174    json.put("source", a == null ? (inherited == null ? "PRIMARY" : "INHERITED") : a.getSource().name());
Note: See TracChangeset for help on using the changeset viewer.