Opened 15 years ago

Closed 15 years ago

#1430 closed defect (fixed)

Removing an annotation from an item may cause "Item not found" error in item overview

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: minor Milestone: BASE 2.14.1
Component: web Version:
Keywords: Cc:

Description

This requires several steps to reproduce.

  1. Create two items, one parent item (P) and one child item (C), for example a sample and an extract.
  2. Create an annotation type (AT) for the parent item.
  3. Annnotate P with AT. This is the annotation A.
  4. Let C inherit A from P. NOTE! Do not inherit the entire annotation set!
  5. Go to "Item overview" for C.
  6. Shift-click on the P listed in the annotations section
  7. Remove the value for A from P. Save.

This should result in an error message in the right-hand information frame: Item not found: Annotation[id=xxxx]. The id references the id of the removed annotation. Clicking on the 'Validate' button seems to get rid of the error.

Looking behind the scenes the following can be observed:

  • After step 5, there are two annotation set snapshots in the cache. One for P and one for C.
  • The snapshot for P is removed in step 7 as is expected.
  • But it is also expected that an updated snapshot file for P should appear when the annotation information is requested by the information frame.
  • The snapshot file for P is created again when 'Validate' is clicked.

Clicking in other places in the gui where annotations for P or C are displayed seems to work. The snapshot for P is created automatically if needed.

Change History (3)

comment:1 by Nicklas Nordborg, 15 years ago

Hmmm... after submitting this I discovered that this happens in a much more simple case also. We can leave out the child C in the above instructions and get the same error with only P and A.

comment:2 by Nicklas Nordborg, 15 years ago

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:3 by Nicklas Nordborg, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [5180]) Fixes #1430: Removing an annotation from an item may cause "Item not found" error in item overview

The problem was that the GenericOverview was keeping an old SnapshotManager in memory that was used by the information page. The deletion of the annotation is of course not recorded by the snapshot manager. The solution is to always create a new snapshot manager for every transaction.

Note: See TracTickets for help on using tickets.