"Make a copy" in Text Box block no longer works

Bug #1220093 reported by Aaron Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon

Bug Description

While testing https://bugs.launchpad.net/mahara/+bug/1194255 I noticed that the "Make a copy" link no longer works. And you no longer get the "Make a copy" link while first editing the Text Box.

To reproduce:

1. Install Mahara 1.8
2. Create a page
3. Put a Text Box on the page. Give it some content so you can tell it apart from others.
4. Put a second Text Box on the page. Use the "Use content from another text box" link to make it use the same Note as the first Text Box.

Expected Results: When you select the first text box, in addition to seeing its content in the config form, you should also see a link that says "If you edit the text of this block, it will also be changed in 1 other block(s) where it appears. Make a copy?"

Actual Result: You do not see that link.

Carrying on...

5. Save the second text box.
6. Click the edit icon for the second text box to edit it further
7. You will now see the link that asks where you would like to "Make a copy".
8. Click on that link.
9. Change the contents of the block.
10. Save the block.

Expected Result: The content of the second block will change, and there will now be two Notes in your Content->Notes page

Actual Result: The content of both blocks will change, and there will only be one Note in Content->Notes (because it did not actually make a copy).

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Using my favorite tool git-bisect, it looks like the commit to be blame is our old favorite, 8b34dc82d4f25e8fec7f97658e5a53789dce8058, i.e. https://reviews.mahara.org/#/c/2387/ , the Flexible layouts mega-commit.

Changed in mahara:
assignee: nobody → Aaron Wells (u-aaronw)
assignee: Aaron Wells (u-aaronw) → Robert Lyon (robertl-9)
Revision history for this message
Robert Lyon (robertl-9) wrote :

Yep that mega commit is the problem and it is due to the jQuery and Mochikit not playing nice. They both want to use $() to access DOM elements.

I've altered the code so that it uses jQuery, and we know this because I've gone with jQuery() instead of $() so it is easier to understand which js library is doing what.

https://reviews.mahara.org/#/c/2471

Changed in mahara:
status: Confirmed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/2471
Committed: http://gitorious.org/mahara/mahara/commit/c684dbfcc8fb9b6ceef6bbb018597434e2d94947
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit c684dbfcc8fb9b6ceef6bbb018597434e2d94947
Author: Robert Lyon <email address hidden>
Date: Wed Sep 4 09:04:43 2013 +1200

Make a copy text box working again (Bug #1220093)

- It is another problem with Mochikit and jquery not playing well
as the $('id_of_element') was being executed by jquery rather than
mochikit and the syntax is wrong for jquery.

- I've updated the code for the bits where they were clashing and
explicitly indicated that we are using jQuery for those bits by
using jQuery() to fetch the dom elements.

- some time in the future this should be rewritten to be all jquery
(or whatever is the 'standard' js library is)

Change-Id: I51bf4ecd30c4005d7852682ea1fd087c63351e6f
Signed-off-by: Robert Lyon <email address hidden>

Aaron Wells (u-aaronw)
Changed in mahara:
status: In Progress → Fix Committed
Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 1.8rc1 → 1.8.0
Aaron Wells (u-aaronw)
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.