Copying a collection with SmartEvidence throws errors
Bug #1997298 reported by
Gold
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Mahara | ||||||
22.10 |
Fix Released
|
High
|
Unassigned | |||
23.04 |
Fix Released
|
High
|
Doris Tam |
Bug Description
When copying a Collection with SmartEvidence the attached errors show up.
This appears to be from the foreach ($evidences as $evidence) loop when $newartefact does not appear as a key in $newblocks.
To replicate:
* Create a Collection
* Add SmarteEvidence
* Add an Annotation block
* Copy the Collection.
Changed in mahara: | |
assignee: | nobody → Doris Tam (doristam) |
Changed in mahara: | |
status: | New → In Progress |
summary: |
- Copying a Collection with SmartEvidence throws errors + Copying a collection with SmartEvidence throws errors |
Changed in mahara: | |
milestone: | 23.04.0 → none |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
no longer affects: | mahara |
To post a comment you must log in.
Here are some testing instructions to replicate the issue:
1) Create site and login as admin
2) Turn on annotation blocktype in Extensions -> Plugin administration (if it's not active)
3) In Institutions -> Settings enable Smart Evidence for 'mahara' institution
Login as normal user
4) make a blank page (Create button)
5) make a collection (Create button) and choose a 'SmartEvidence framework' then save and add the page to it
6) Go to the collection an on the Smart Evidence page of collection click a spot
7) add annotation text AND embed an image by uploading a new image
8) go to the normal page of the collection
9) copy the collection via the 3 dots menu on right and choose 'collection'
Get the error!!!!
[WAR] 1a (lib/collection .php:711) Undefined offset: 184 .php:711) Trying to get property 'view' of non-object
[WAR] 1a (lib/collection
The reason for this (I believe) is the SQL to match up the evidence finds not only the annotation artefact attached to the block (the block id found in the annotation column in framework_evidence table) but also the embedded image artefact associated with the block (vie view_artefact table) and it's trying to handle this artefact as an annotation artefact too and failing