On line 195

  $allowed_nodes = variable_get('block_edit_content_types', array_keys(node_get_types('names')));

returns following array:

array(
  0 (String, 4 characters ) news
  1 (String, 4 characters ) page
);

The check after that with $allowed_nodes[$node->type] !== $node->type will always fail.
Saving the configuration screen makes it work since the array_keys will return 'node_type_key' => 'node_type_key' .

This is pretty minor of course, however. Maybe it might be better to return with an empty array as the default value - or another solution.

Comments

psynaptic’s picture

Status: Active » Needs review

Ahh, I see.

How about this?

$allowed_nodes = variable_get('block_edit_content_types', array_combine(array_keys(node_get_types('names')), array_keys(node_get_types('names'))));
psynaptic’s picture

I have committed this to dev if you'd like to try it out. Can always revert it if you think there is a problem with it.

Thanks so much for the bug report.

psynaptic’s picture

Status: Needs review » Fixed

I think it's fixed. Without anyone to confirm I'm marking as fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.