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.
- Create two items, one parent item (P) and one child item (C), for example a sample and an extract.
- Create an annotation type (AT) for the parent item.
- Annnotate P with AT. This is the annotation A.
- Let C inherit A from P. NOTE! Do not inherit the entire annotation set!
- Go to "Item overview" for C.
- Shift-click on the P listed in the annotations section
- 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 , 15 years ago
comment:2 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(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.
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.