Problem with annotation feedback and draft feedback

Bug #1959613 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Dianne Tennent

Bug Description

Problem:

Person A creates a SmartEvidence collection and has an annotation block on a page
Person B adds a draft comment to it
Person A requests the comment to be made public
Person B gets an email and follows the link

-- gets error
[WAR] e2 (artefact/lib.php:353) Artefact type mismatch. You are trying to use this annotation as a comment.
Call stack (most recent first):

    ArtefactType->__construct() at /../htdocs/artefact/comment/lib.php:193
    ArtefactTypeComment->__construct() at /../htdocs/view/view.php:563

To test:

1 Set up new site
2 Go to Plugin Extensions page and activate annotation
3 Edit 'No institution' and allow SmartEvidence
4 Create accounts via CSV
5 Log in as Person A and create a page
6 Create a collection with a SmartEvidence option chosen and add page to it
7 Share the collection to Person B with special role Peer
8 Go to the collection's SmartEvidence page and add annotation to one of the dots
9 Log in as Person B and go to the collection SmartEvidence page and click on the circle dot
10 Leave some feedback and turn 'Mark public' to No - the feedback should have "This feedback is private."
11 Log in as Person A and go to the page itself in the collection and click on Feedback (1) link in annotation block
12 In the modal click the 'Make public' button - you should see "A message has been sent to Person B to request that the feedback be made public."
13 Log in as Person B and go to the page itself in the collection - you see "You cannot see the content on this page because it does not require a peer assessment."
14 Go to your inbox and see "Request to change private feedback to public"
15 Click the 'Annotation' link in the email and get the error.

Revision history for this message
Robert Lyon (robertl-9) wrote :

Making the following adjustments will stop the error

/htdocs/artefact/annotation/lib.php
@@ -226,6 +226,7 @@ class ArtefactTypeAnnotation extends ArtefactType {
     protected $artefact; // artefactid of the artefact this annotation is linked to.
     protected $view; // viewid of the view this annotation is linked to.
     protected $lastcontentupdate; // last updated as a datetime.
+ protected $onartefact;

/htdocs/view/view.php
@@ -560,7 +560,9 @@ $smarty = smarty(
 $commentonartefact = param_integer('artefact', null);
 // doublecheck it's a comment on artefact in case is old email
 if ($showcomment) {
- $tmpcomment = new ArtefactTypeComment($showcomment);
+ $artefacttype = get_field('artefact', 'artefacttype', 'id', $showcomment);
+ $classname = generate_artefact_class_name($artefacttype);
+ $tmpcomment = new $classname($showcomment);
     if ($tmpcomment->get('onartefact') && !$commentonartefact) {
         redirect(get_config('wwwroot') . 'view/view.php?id=' . $viewid . '&showcomment=' . $showcomment . '&modal=1&artefact=' . $tmpcomment->get('onartefact'));
     }

But there is still the issue that because the page is shared to the person as a peer they cannot see the annotation block and therefore are not able to make the private annotation feedback public

Robert Lyon (robertl-9)
Changed in mahara:
assignee: nobody → Robert Lyon (robertl-9)
assignee: Robert Lyon (robertl-9) → nobody
assignee: nobody → Dianne Tennent (dianne-t)
milestone: none → 22.04.0
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Dianne Tennent (dianne-t) wrote (last edit ):

I had to change a couple of things in the testing scenario:
- Step 3: There appears to be no 'turn on Annotations' setting in Institution settings
- I had to create a new Institution to be able to switch on the 'Allow peers to see portfolio content' setting, which I switched on.

With these settings, at Step 13, I was able to view Person A's page as Person B
But at Step 15, I got the same error - will fix as per above adjustments.

Revision history for this message
Robert Lyon (robertl-9) wrote :

Ah, step 3 would be turn on Smart Evidence

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "main" branch: https://reviews.mahara.org/12381

Revision history for this message
Dianne Tennent (dianne-t) wrote (last edit ):

After fixing this issue, there is another bug:

When I get to step 15, Person B can successfully view the page by clicking on the link in their inbox, without any error messages.

However, when they then click 'Feedback(1)' to view the feedback given on that page, the modal appears, and the page is still visible, but an error message appears behind it above the page content saying 'Access denied'

If you close the modal, and refresh the page, this message disappears.

This has been reported as a separate bug here: https://bugs.launchpad.net/mahara/+bug/1960988

See attachment.

Changed in mahara:
status: Confirmed → In Progress
Revision history for this message
Dianne Tennent (dianne-t) wrote :

After further investigation, the 'Access denied' error above no longer appears for some reason.

So we have a case where annotations have been enabled for the site, but the institution settings have not been changed to 'Allow peers to see portfolio content'.

In this case, when someone shares their smart evidence portfolio with a peer, their peer cannot see their portfolio content, but they can add feedback to annotations.

At the moment, even for a page, someone can choose to share their portfolio with a peer, even if their institution hasn't allowed peers to see portfolio content.

Perhaps we need to review 'Allow peers to see portfolio content' settings, to remove the option for sharing with peers and remove ability to add feedback as a peer, if this setting hasn't been enabled.

description: updated
description: updated
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

We had decided to not change anything in the behaviour right now as peers who don't have access to the content of a page should not give feedback any way. If someone does need to give feedback and their institution doesn't allow peers to see the page content, they can share the page without the role restriction in place.

This work here only fixes that there is no error message any more.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/12381
Committed: https://git.mahara.org/mahara/mahara/commit/f051d53b2a55ed08f33701f864bdd0704f885e06
Submitter: Robert Lyon (<email address hidden>)
Branch: main

commit f051d53b2a55ed08f33701f864bdd0704f885e06
Author: Dianne Tennent <email address hidden>
Date: Tue Feb 1 11:20:18 2022 +1300

Bug 1959613: Problem with viewing annotation feedback

Ensure artefact types match when trying to view feedback
on annotations that has been requested to be made public.

Change-Id: Ica3183d96c18c7ec84d85d4658de45efedde867a

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Gold (gold.catalyst)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.