Pieforms can't tell which "button" element submitted a form
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Aaron Wells | ||
15.10 |
Fix Released
|
High
|
Aaron Wells |
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[
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_
no longer affects: | mahara/16.04 |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
To get a complete sense of the scope of this bug, we'd need to check and see how many forms there are that have two different submit buttons, and use the pressed button to determine which action to take.
Doing a quick grep, I see the following files that contain "usebuttontag" more than once. These are the places where we're likeliest to find forms like that, although it's possible these could be multiple form definitions in the same file. For instance, taking a quick look at view/urls.php, I see that's the case there.
./collection/ views.php: 2 comment/ lib.php: 2 annotation/ lib.php: 2 blog/lib. php:3 apptokens. php:2 admin/index. php:6 admin/oauthv1sr egister. php:2 users/bulk. php:3 users/instituti ons.php: 3 site/networking .php:2
./view/urls.php:2
./artefact/
./artefact/
./artefact/
./lib/user.php:2
./lib/group.php:7
./lib/view.php:4
./webservice/
./webservice/
./webservice/
./admin/
./admin/
./admin/
./user/view.php:2