mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #33503
[Bug 1559796] Re: If you close a form config via the "X" button on the modal, the form change checker doesn't get cleared
This bug is present at least as far back as 1.10, so it's probably a bug
in our initial implementation of the form change checker, rather than
being a Bootstrap regression.
The problem is best explained by looking at why it works correctly for
the "Cancel"/"Delete" link at the bottom of the block config. When a new
form is displayed, the formchangechecker's init() method looks for all
form elements in the new form, and binds itself to each one as a click
handler. In the case of a "cancel" button, the action it takes is to
reset the form change checker. The "Cancel"/"Delete" link at the bottom
of a block config modal, is actually an "input" tag styled to look like
a link, so it gets assigned this click handler and works correctly.
The "X" button, however, lives outside the block config form, so the
form change checker has no way of knowing it exists, unless we hook it
in manually. We can do this inside of addConfigureBlock() in views.js,
where the delete button is referred to as the "deletebutton" object.
One thing to note, is that the method "rewriteDeleteButton()" in
views.js also removes any other click handlers, so we'll need to
integrate it with that.
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1559796
Title:
If you close a form config via the "X" button on the modal, the form
change checker doesn't get cleared
Status in Mahara:
Confirmed
Status in Mahara 16.04 series:
Confirmed
Bug description:
The "form change checker" is the Javascript system that we use to
detect unsaved changes in a form. If you make changes in a Mahara form
and then navigate away from the page without submitting or cancelling
the form, it shows a popup that says something like "This page is
asking you to confirm that you want to leave - data you have entered
may not be saved."
The bug here, is that on the page builder screen, you can either close
a block configuration modal window by hitting "Cancel" (or "Delete")
on the bottom of the form, or by clicking an "X" button in the upper-
left hand corner of the modal. If you make changes to the form and
then hit the "X" button, the form change checker doesn't get cleared,
which means that subsequently when you try to navigate away from the
screen, you'll see the warning message about unsaved changes.
To replicate:
1. Open a page for editing
2. Put a Text block into the page (or edit an existing text block)
3. Change the block's "Retractable" setting.
4. Click the "X" button in the upper-left of the modal
5. Press F5 to reload the page (or click a link to navigate to another page)
Expected result: You should not see a warning message, because you don't have any unsaved changes.
Actual result: You see the form change checker's warning message.
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1559796/+subscriptions
References