Deleting blocks from page fails in some cases in 15.10

Bug #1511536 reported by Robert Lyon
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon
15.10
Fix Released
High
Robert Lyon

Bug Description

The is an odd bug where the block being deleted doesn't remove itself from the edit screen. so when you try to delete it again you get an error message that the block doesn't exist any more.

To replicate:

Make a page and add some blocks to the page - preferably 3 or more (any type)

Go to display page

Go back to edit page and delete the blocks
- the first will delete fine but then next ones will not disappear

However if each block is edited and then deleted they are removed fine.

So this sounds like there is a problem with initial setup of the js relating to the delete buttons but not when the buttons are rewritten after config changes

Robert Lyon (robertl-9)
Changed in mahara:
status: Confirmed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

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

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

Reviewed: https://reviews.mahara.org/5646
Committed: https://git.mahara.org/mahara/mahara/commit/52770f8baf2297d9cbf5506e2696b346fae8f419
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit 52770f8baf2297d9cbf5506e2696b346fae8f419
Author: Robert Lyon <email address hidden>
Date: Fri Oct 30 12:26:48 2015 +1300

Bug 1511536: problem with deleting blocks when edit page first loads

The problem is due to the scope of the blockinstanceId variable being
outside of the click handler function, which inadvertently makes it
into a sort of static variable shared by all of the delete buttons.

So the solution is to use a locally-scoped blockinstanceId button
inside the click handler method.

Change-Id: I3e8ffac31cc869c545e85c5f53c3e710e2e71243
Signed-off-by: Robert Lyon <email address hidden>
Signed-off-by: Aaron Wells <email address hidden>

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

Patch for "15.10_STABLE" branch: https://reviews.mahara.org/5686

Aaron Wells (u-aaronw)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5686
Committed: https://git.mahara.org/mahara/mahara/commit/acb253747481e2dc6db7b7ca3adb554b822f1930
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.10_STABLE

commit acb253747481e2dc6db7b7ca3adb554b822f1930
Author: Robert Lyon <email address hidden>
Date: Fri Oct 30 12:26:48 2015 +1300

Bug 1511536: problem with deleting blocks when edit page first loads

The problem is due to the scope of the blockinstanceId variable being
outside of the click handler function, which inadvertently makes it
into a sort of static variable shared by all of the delete buttons.

So the solution is to use a locally-scoped blockinstanceId button
inside the click handler method.

Change-Id: I3e8ffac31cc869c545e85c5f53c3e710e2e71243
Signed-off-by: Robert Lyon <email address hidden>
Signed-off-by: Aaron Wells <email address hidden>
(cherry picked from commit 52770f8baf2297d9cbf5506e2696b346fae8f419)

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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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