jsform field defaults to no when field is disabled

Bug #1853387 reported by Lisa Seeto
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Lisa Seeto
19.10
Fix Released
High
Unassigned

Bug Description

An issue was picked up on Administration Menu->Configure site->Site options->Security Settings which could be a bigger issue with the way JSForms processes.

Preconditions:
In the config.php file have "recaptchaonregisterform" set to true, i.e $cfg->recaptchaonregisterform = true;
Test:
1. Log in as site admin and go to Administration Menu->Configure site->Site options->Security Settings.
2. Scroll to "reCAPTCHA on user registration / contact us forms" and it should be set to "yes" as it reads from the config.php file. It should also be disabled.
3. Submit the page then view the Security Settings again.
Expected result:
The disabled "reCAPTCHA on user registration / contact us forms" button still shows "yes".
Actual result:
The disabled ""reCAPTCHA on user registration / contact us forms" button now shows "no"

This issue was also seen in admin/site/networking.php during work on https://reviews.mahara.org/#/c/10616/2. Removing the jsform => true in the pieform stopped the disabled form fields defaulting to their 'false' values, i.e when the page is submitted.

Mahara: 19.10_STABLE
Browsers: Firefox and Chrome
DB: Postgres

Lisa Seeto (lisaseeto)
Changed in mahara:
status: New → In Progress
assignee: nobody → Lisa Seeto (lisaseeto)
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/10625

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

Reviewed: https://reviews.mahara.org/10625
Committed: https://git.mahara.org/mahara/mahara/commit/e99cb70275ce00ccb0c313ada4f3faacf50c31c7
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit e99cb70275ce00ccb0c313ada4f3faacf50c31c7
Author: Lisa Seeto <email address hidden>
Date: Mon Nov 25 14:47:22 2019 +1300

Bug 1853387: jsform field defaults to no when field is disabled

- alter the way checkbox disabled fields are processed if they have
default values supplied
- add get_element_option(name, option) to Pieform

behatnotneeded

Change-Id: I0b48cf148716acb70b865e3339a6b9fadfd762bb
Signed-off-by: Lisa Seeto <email address hidden>

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

Patch for "19.10_STABLE" branch: https://reviews.mahara.org/10696

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

Reviewed: https://reviews.mahara.org/10696
Committed: https://git.mahara.org/mahara/mahara/commit/96a36e92d451de0bd50936cf433b648ed89172eb
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 19.10_STABLE

commit 96a36e92d451de0bd50936cf433b648ed89172eb
Author: Lisa Seeto <email address hidden>
Date: Mon Nov 25 14:47:22 2019 +1300

Bug 1853387: jsform field defaults to no when field is disabled

- alter the way checkbox disabled fields are processed if they have
default values supplied
- add get_element_option(name, option) to Pieform

behatnotneeded

Change-Id: I0b48cf148716acb70b865e3339a6b9fadfd762bb
Signed-off-by: Lisa Seeto <email address hidden>
(cherry picked from commit e99cb70275ce00ccb0c313ada4f3faacf50c31c7)

Changed in mahara:
status: Fix Committed → Fix Released
no longer affects: mahara/20.04
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.