Closed (fixed)
Project:
Nodeblock
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Mar 2013 at 22:19 UTC
Updated:
20 Mar 2013 at 15:00 UTC
Hi,
I get an error when I'm editing a block in the block admin. The problem is the missing "comment_link" index in the "edit" array.
/**
* Implements hook_block_save().
*/
function nodeblock_block_save($delta = '', $edit = array()) {
db_update('nodeblock')
->condition('machine_name', $delta)
->fields(array('view_mode' => $edit['view_mode'], 'node_link' => $edit['node_link'], 'comment_link' => $edit['comment_link']))
->execute();
}
Should be:
/**
* Implements hook_block_save().
*/
function nodeblock_block_save($delta = '', $edit = array()) {
$values = array(
'view_mode' => $edit['view_mode'],
'node_link' => $edit['node_link']
);
if (isset($edit['comment_link'])) {
$values['comment_link'] = $edit['comment_link'];
}
db_update('nodeblock')
->condition('machine_name', $delta)
->fields($values)
->execute();
}
Comments
Comment #1
Johnny vd Laar commentedCommitted a fix here:
http://drupalcode.org/project/nodeblock.git/blobdiff/85ffd9e32bce508f36d...
Thanks for spotting this.