I'm not sure whether all the configuration options on admin/config/content/revisioning are working correctly, but under Display options, "Where applicable add Tags and Terms columns to the content revisions summary (Revisions tab)" & "In feeds and Views, e.g. /content-summary, show Tags and Terms associated with unpublished content, subject to permissions" options do not get updated when you save.

Both of these options are checked by default when the module is installed, when you try to uncheck them the values are not saved.

CommentFileSizeAuthor
#2 revisionings_form_submit.patch1.11 KBPawelR

Comments

rdeboer’s picture

Hi intrafusion,
That's odd and would be a bug. Will investigate as soon as I can.
Rik

PawelR’s picture

Status: Active » Needs review
StatusFileSize
new1.11 KB

Form 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.

rdeboer’s picture

Thanks Pawel !
Should apply this soon.
Rik

damienmckenna’s picture

This is something that could use some tests...

grahamu’s picture

Status: Needs review » Reviewed & tested by the community

This fix looks fine to me. It makes use of code from system_settings_form_submit, which is obviously well tested and reliable.

matt.rad’s picture

This patch works fine for me too.