Do not use variable_get when validating the settings form
By using variable_get while validating the settings form, you are using the old value and not the value that the user entered to (for example) reference what the "max timeout" should be. If I get an error saying that "role x timeout must be an integer greater than 60, and less then 1800" and so I change the max to 10000 I still get the identical error when I resubmit the form even though I have acceptable values.
Do not validate role based timeouts if the user has unchecked "use role timeout"
These values should only be validated when they matter. Why make the user put in a timeout value for administrators that is less than "max" if the user is not using that type of timeout?
..oh, and I snuck in some more coding standards cleanup. Shhhhhhhhh
Comment | File | Size | Author |
---|---|---|---|
#5 | autologout-form_validation_fixes-1706540-1706540.patch | 6.28 KB | johnennew |
#3 | autologout-form_validation_fixes-1706540.patch | 7.43 KB | johnennew |
autologout_validation.patch | 5.69 KB | bleen | |
Comments
Comment #1
dandrews CreditAttribution: dandrews commentedTried patching and ran into some issues, will work on it and post back.
Comment #2
rooby CreditAttribution: rooby commentedI just had a quick look and there are no calls to variable_get() in the settings validate function.
I think this issue is no longer relevant with the latest version of the module.
Comment #3
johnennew CreditAttribution: johnennew commentedHi all,
The default timeout is respecting the new form submitted value of max_timeout but the role time outs still do not. Attached patch fixes this as well as adding the removal of form validation of role timeouts which are disabled. Tests included describing the issue and proving working functionality.
Comment #4
johnennew CreditAttribution: johnennew commentedPretty sure this is good with the tests - committing to the 7.x-4.x and setting to 6.x-4.x for backport
Comment #5
johnennew CreditAttribution: johnennew commented6.x-4.x backport ready for committing.
Comment #6
johnennew CreditAttribution: johnennew commentedPatch committed to 6.x-4.x