mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #32044
[Bug 1526624] [NEW] Pieforms can't tell which "button" element submitted a form
Public bug reported:
With Mahara 15.10, we replaced a lot of the old <input type="submit">
tags with <button type="submit"> to provide for more flexible styling.
However, no one realized that deep inside Pieform's creaky old
internals, it expected your submit element to be flagged with
"$element['submitelement'] = true". Without this, if there are multiple
buttons in a pieform, all of their values show up in the submit method,
instead of just the one that was pressed.
This is the underlying cause of Bug 1526614 ("reject" button causes you
to join a group). The accept & reject buttons were previously input
tags, and had been changed to buttons. The submit handler function,
thinking only one or the other could be pressed, only checked for the
presence of the "accept" button. Without "submitelement" on it, the
accept button's value (and the decline button's value) came through
every time.
In the old "submit" element, this flag is added automatically by the
pieform_element_*_set_attributes() hook. I've added a similar hook to
the button element that only adds it if it's a submit button (since we
can also have non-submitting buttons, for Javascript).
** Affects: mahara
Importance: High
Assignee: Aaron Wells (u-aaronw)
Status: In Progress
** Affects: mahara/15.10
Importance: High
Assignee: Aaron Wells (u-aaronw)
Status: In Progress
** Affects: mahara/16.04
Importance: High
Assignee: Aaron Wells (u-aaronw)
Status: In Progress
** Tags: pieforms regression
** Also affects: mahara/15.10
Importance: Undecided
Status: New
** Also affects: mahara/16.04
Importance: High
Assignee: Aaron Wells (u-aaronw)
Status: In Progress
** Changed in: mahara/15.10
Importance: Undecided => High
** Changed in: mahara/15.10
Status: New => In Progress
** Changed in: mahara/15.10
Assignee: (unassigned) => Aaron Wells (u-aaronw)
--
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/1526624
Title:
Pieforms can't tell which "button" element submitted a form
Status in Mahara:
In Progress
Status in Mahara 15.10 series:
In Progress
Status in Mahara 16.04 series:
In Progress
Bug description:
With Mahara 15.10, we replaced a lot of the old <input type="submit">
tags with <button type="submit"> to provide for more flexible styling.
However, no one realized that deep inside Pieform's creaky old
internals, it expected your submit element to be flagged with
"$element['submitelement'] = true". Without this, if there are
multiple buttons in a pieform, all of their values show up in the
submit method, instead of just the one that was pressed.
This is the underlying cause of Bug 1526614 ("reject" button causes
you to join a group). The accept & reject buttons were previously
input tags, and had been changed to buttons. The submit handler
function, thinking only one or the other could be pressed, only
checked for the presence of the "accept" button. Without
"submitelement" on it, the accept button's value (and the decline
button's value) came through every time.
In the old "submit" element, this flag is added automatically by the
pieform_element_*_set_attributes() hook. I've added a similar hook to
the button element that only adds it if it's a submit button (since we
can also have non-submitting buttons, for Javascript).
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1526624/+subscriptions
Follow ups
-
[Bug 1526624] Re: Pieforms can't tell which "button" element submitted a form
From: Kristina Hoeppner, 2016-04-29
-
[Bug 1526624] Re: Pieforms can't tell which "button" element submitted a form
From: Aaron Wells, 2016-03-23
-
[Bug 1526624] Re: Pieforms can't tell which "button" element submitted a form
From: Robert Lyon, 2016-03-02
-
[Bug 1526624] A change has been merged
From: Mahara Bot, 2016-03-02
-
[Bug 1526624] A patch has been submitted for review
From: Mahara Bot, 2016-03-02
-
[Bug 1526624] A change has been merged
From: Mahara Bot, 2016-03-02
-
[Bug 1526624] Re: Pieforms can't tell which "button" element submitted a form
From: Robert Lyon, 2016-03-02
-
[Bug 1526624] Re: Pieforms can't tell which "button" element submitted a form
From: Kristina Hoeppner, 2015-12-29
-
[Bug 1526624] A patch has been submitted for review
From: Mahara Bot, 2015-12-16
-
[Bug 1526624] Re: Pieforms can't tell which "button" element submitted a form
From: Aaron Wells, 2015-12-16