Empty annotation in peer review mode is not working right

Bug #1867999 reported by Robert Lyon on 2020-03-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Status tracked in 20.04
19.10
Medium
Unassigned
20.04
Medium
Cecilia Vela Gurovic

Bug Description

To test:

1) Create a page with both the annotation and peer assessments on it - have content for both

2) Share it with another user with 'peer' role

3) Login as other user and view page

You should see the word 'null' where the title should be

This is because the block tries to hide the title when content is empty, which it is in this case as a peer can't see the blocks content

Robert Lyon (robertl-9) on 2020-03-18
Changed in mahara:
milestone: none → 20.04.0
importance: Undecided → High
status: New → In Progress
importance: High → Medium
Robert Lyon (robertl-9) wrote :

My initial patch was a blunt instrument and doesn't fix the underlying problem

The problem seems to only exist for gridstack pages

And the bits of code that seem to be bad are:

        var blockContent = $('<div id="block_' + block.id + '"><div class="grid-stack-item-content">'
            + block.content +
            '<div/><div/>');

this bit above puts 'null' on the page because the content is set to null

and the following bit

            $(element).find('.grid-stack-item-content .gridstackblock')[0].scrollHeight +

Throws this console error

TypeError: $(...).find(...)[0] is undefined

because there is no content to find the scrollHeight of

Changed in mahara:
assignee: nobody → Cecilia Vela Gurovic (ceciliavg)
Mahara Bot (dev-mahara) wrote :

Patch for "master" branch: https://reviews.mahara.org/10831

Reviewed: https://reviews.mahara.org/10831
Committed: https://git.mahara.org/mahara/mahara/commit/5d9ccc3eed5ef522a15ceaf21f4f8aab1a3c9cc0
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 5d9ccc3eed5ef522a15ceaf21f4f8aab1a3c9cc0
Author: Cecilia Vela Gurovic <email address hidden>
Date: Fri Mar 20 15:11:34 2020 +1300

Bug 1867999: the annotation block should be empty if no title and no content

behatnotneeded

Change-Id: Ida169d4f569b9406ca350e84ecd867a9002af945

Robert Lyon (robertl-9) on 2020-03-20
Changed in mahara:
status: In Progress → Fix Committed

Reviewed: https://reviews.mahara.org/10832
Committed: https://git.mahara.org/mahara/mahara/commit/217d1749aa77a7843c12aa6e574d1b495bb95912
Submitter: Robert Lyon (<email address hidden>)
Branch: 19.10_STABLE

commit 217d1749aa77a7843c12aa6e574d1b495bb95912
Author: Cecilia Vela Gurovic <email address hidden>
Date: Fri Mar 20 15:11:34 2020 +1300

Bug 1867999: the annotation block should be empty if no title and no content

behatnotneeded

Change-Id: Ida169d4f569b9406ca350e84ecd867a9002af945
(cherry picked from commit 5d9ccc3eed5ef522a15ceaf21f4f8aab1a3c9cc0)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers