I have a content type which is configured not to use dice_roller (neither in the node, nor in the comment), yet, the dice_roller form is displayed for comments on nodes of that content type.

The issue is in the dice_roller.module file: replace (in both comment and node)

$enabled = variable_get('dice_roller_' . $type, FALSE);
if ($enabled !== FALSE && ($placement == 'both' || $placement == 'node') ) {

by

$enabled = variable_get('dice_roller_' . $type, FALSE);
if (($enabled == True) && ($placement == 'both' || $placement == 'node')) {



The problem comes from the fact that checkboxes do not store their status as boolean, but as integer. So the variable 'dice_roller_'.$type is an integer (0 or 1) and not a boolean. You can't test using !== because it will check the type of the test items and it will always return true (because they don't have the same type). So it is better to let php do some conversion (to int) and test for the value to be 1 (True converted in int).

S.

Comments

Bastlynn’s picture

Thanks! I'll get that pulled into dev and tested here - my apologies for the delay in getting back to you.

Bastlynn’s picture

Added on dev,

Bastlynn’s picture

Status: Active » Closed (fixed)
Bastlynn’s picture

Issue summary: View changes

spelling error