Notice: Undefined index: blocks in node_level_blocks_node_save_blocks() (regel 102 van ../sites/sitename/modules/contrib/node_level_blocks/node_level_blocks.module).
Warning: Invalid argument supplied for foreach() in node_level_blocks_node_save_blocks() (regel 109 van ../sites/sitename/modules/contrib/node_level_blocks/node_level_blocks.module).The function node_level_blocks_node_save_blocks does not check whether NLB is enabled or not.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | node_level_blocks-2503825-7-excl-2495761.patch | 1.11 KB | rudiedirkx |
| #7 | node_level_blocks-2503825-7-incl-2495761.patch | 1.66 KB | rudiedirkx |
| #6 | node_level_blocks-2503825-5.patch | 492 bytes | rudiedirkx |
Comments
Comment #1
spadxiii commentedComment #3
Johnny vd Laar commentedCommited your patch:
http://cgit.drupalcode.org/node_level_blocks/commit/?id=dc3b28c
Thanks for the help!
Comment #4
mrharolda commentedThe settings->enabled check in node_level_blocks_node_save_blocks() requires that the settings are available in $node->node_level_blocks, which they aren't.
Adding this snippet in node_level_blocks_node_form() fixes that:
Comment #5
rudiedirkx commentedDamnit, Johnny, sometimes you have to try it out before committing!
Settings are irrelevant. If
$node->node_level_blocks['blocks']exist, it's fine. It's the same check that happens a few lines later to check in$node->original.Patch is against dev.
Comment #6
rudiedirkx commentedPatch is against dev.
Comment #7
rudiedirkx commentedThese patches are against
2.0-alpha1, including and excluding fix from #2495761: Blocks from LANGUAGE_NONE are always shown. Busy month.Comment #9
Johnny vd Laar commentedYour fix wasn't sufficient because when NLB is disabled for a CT it will still submit node_level_blocks['blocks']. The form should also submit the settings to make the $node->node_level_blocks array the same as after a node_load. Therefore I've added a value element in the form.
http://cgit.drupalcode.org/node_level_blocks/commit/?id=97c1c6d
I also fixed the node preview button.
Comment #11
rudiedirkx commentedThat was intentional. A node_save() does the same. Enabledness is irrelevant. If a node has NLB blocks, they will be saved, period. I think that's the correct way, but you're the boss.