Users can unset 'Multiple journals' option even having more than one

Bug #1237095 reported by Son Nguyen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Son Nguyen

Bug Description

Version: master
Platform: all

If an user have more than one journals, the option 'Multiple journals' in the account setting page is 'read-only'.
When I unset it and save.
Actual result: the option have been updated, and only one journal was shown
Expected result: The option should not be changed

Revision history for this message
Son Nguyen (ngson2000) wrote :
Changed in mahara:
assignee: nobody → Son Nguyen (ngson2000)
milestone: none → 1.8.0
importance: Undecided → High
status: New → In Progress
Revision history for this message
Son Nguyen (ngson2000) wrote :

This bug also affects 1.5-1.7

Revision history for this message
Son Nguyen (ngson2000) wrote :

This is the regression of the Bug #1166879

Revision history for this message
Robert Lyon (robertl-9) wrote :

how are you un-setting a 'read only' field?

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

To replicate:

1. Log in as a user
2. Go to the Account Settings page and tick the "Multiple journals" checkbox.
3. Create a second journal
4. Go back to the Account Settings page.

Expected result: The "Multiple journals" checkbox should not be editable.
Actual result: The "Multiple journals" checkbox can be unticked.

I'm able to replicate this in Chromium and Firefox. The checkbox is marked readonly, but it's still checkable.

<input type="checkbox" class="checkbox" id="accountprefs_multipleblogs" name="multipleblogs" tabindex="1" readonly="readonly" checked="checked"/>

In Firefox, the checkbox looks grayed-out, but it can still be ticked and unticked. In Chromium it looks perfectly normal.

Apparently, "readonly" does NOT prevent you from ticking or unticking a checkbox, as that is considered "state" rather than "value". The suggested solution is to mark it "disabled". This will prevent the checkbox from sending ANY value through when the form is submitted, however, so it should be combined with further logic in the form submissions code to handle that. Or a hidden input field to pretend the checkbox is actually sending something through. (Although of course we should still do a server-side check of whether the user is allowed to change this setting before processing any hidden input field's value.)

Revision history for this message
Aaron Wells (u-aaronw) wrote :
Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 1.8.0 → 1.8.1
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

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

commit ee2be8da8dcb71a3841b3e465e6b2ee2e4514148
Author: Son Nguyen <email address hidden>
Date: Wed Oct 9 10:40:46 2013 +1300

Mark a readonly pieform element as "disabled" (Bug #1237095)

- make sure the value of readonly pieform unchanged

Change-Id: I917b7c8fa4d84234001fdd0cabec141b68a42c77
Signed-off-by: Son Nguyen <email address hidden>

Son Nguyen (ngson2000)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Aaron Wells (u-aaronw) wrote :

This one was release as part of 1.8.0

no longer affects: mahara/1.8
no longer affects: mahara/1.9
Changed in mahara:
status: Fix Committed → Fix Released
Aaron Wells (u-aaronw)
Changed in mahara:
status: Fix Released → Fix Committed
Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 1.9.0 → 1.8.2
no longer affects: mahara/1.8
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.