Reviewed & tested by the community
Project:
Revisioning
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Oct 2014 at 14:34 UTC
Updated:
22 Jun 2016 at 20:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rdeboerHi intrafusion,
That's odd and would be a bug. Will investigate as soon as I can.
Rik
Comment #2
PawelR commentedForm submit handler revisioning_admin_configure_form_submit() is buggy.
It does this:
$old_value = variable_get($key);
so when a variable hasn't been yet written to the database then it sets $old_value to NULL, then compares $new_value which often is 0 (unchecked checkbox) to NULL.
The problem is that in form constructor there are default TRUE values e.g variable_get('revisioning_show_taxonomy_terms', TRUE) so if somebody unchecks a checkbox this isn't recognised by this submit handler.
In this case if form hasn't been submitted before and variables are not inserted in to database and if somebody unchecks 'revisioning_show_taxonomy_terms' checkbox this is what get's evaluated:
$old_value = variable_get($key); // NULL - doesn't exist in the database but the form suggests that it's currently TRUE by providing default value in variable_get()
$new_value = 0 // unchecked checkbox
In above case NULL != 0 returns FALSE and new value of the variable isn't inserted in to database.
Attached patch fixes this issue by saving all variables on form submission.
Comment #3
rdeboerThanks Pawel !
Should apply this soon.
Rik
Comment #4
damienmckennaThis is something that could use some tests...
Comment #5
grahamu commentedThis fix looks fine to me. It makes use of code from system_settings_form_submit, which is obviously well tested and reliable.
Comment #6
matt.rad commentedThis patch works fine for me too.