Hello at first thanks for this great Module :) I'm trying to get it run for now 2 Days
there is always this failure on my Site, also if there is no ddblock Block set to shown. I've followed this guide: http://ddblock.myalbums.biz/node/1972
Notice: Undefined index: 2 in ddblock_get_block_title() (line 2646 of /mounted-storage/www/v2/sites/all/modules/ddblock/ddblock.module).
Notice: Undefined index: 2 in ddblock_get_blocks() (line 253 of /mounted-storage/www/v2/sites/all/modules/ddblock/ddblock.module).
Notice: Trying to get property of non-object in ddblock_content() (line 1762 of /mounted-storage/www/v2/sites/all/modules/ddblock/ddblock.module).
Notice: Trying to get property of non-object in ddblock_content() (line 1764 of /mounted-storage/www/v2/sites/all/modules/ddblock/ddblock.module).
Notice: Trying to get property of non-object in ddblock_content() (line 1765 of /mounted-storage/www/v2/sites/all/modules/ddblock/ddblock.module).
I've try to detect the failure:
function ddblock_get_block_title($module, $delta) {
$blocks = module_invoke($module, 'block_info');
$title = $blocks[$delta]['info'];
print("delta= ".$delta);
print_r($blocks);
return $title;
}
Output:
delta= 2
$blocks=
Array
(
[5] => Array
(
[info] => jkdsbfjksdbf
[cache] => -1
)
)
next one:
function ddblock_get_blocks($delta = NULL, $reset = FALSE) {
static $blocks;
if (!isset($blocks) || $reset) {
$blocks = array();
$sql = "SELECT * " .
"FROM {ddblock_block}";
$results = db_query($sql);
while ($block = $results->fetchObject()) {
$blocks[$block->delta] = $block;
}
<strong> print("delta= ".$delta);
print_r($blocks);</strong>
}
return is_numeric($delta) ? $blocks[$delta] : $blocks;
}
return:
delta=
Array
(
[5] => stdClass Object
(
[delta] => 5
[title] => jkdsbfjksdbf
[module] => views
[delta_original] => featured_startpage-block_1
[enabled] => 1
)
)
Next one:
function ddblock_content($origin, $delta, $content = NULL, $teaser = NULL) {
...
// get original block settings.
$ddblock = ddblock_get_blocks($delta);
print("delta= ".$delta);
var_dump($ddblock);
$delta_original = $ddblock->delta_original;
Output:
delta= 2
var_dump($ddblock) = NULL
My View is attached to the post below
i think $delta is sometimes calculated wrong. In my case it should be 5 and not 2. But i don't know what is wrong. Hope for Help :)
Comments
Comment #1
Nightwalker3000 commentedIs it normal that i can't see my own issue?
Comment #2
ppblaauw commentedI only see the issue title of the first post.
Did you have text in the original issue post?
Comment #2.0
Nightwalker3000 commentedtruncated
Comment #3
Nightwalker3000 commentedI've trunc my post. My View was too long for a issue. My View is attached to this post.
Comment #4
Nightwalker3000 commentedHello, what kind of information do you need in addition?
Comment #5
ppblaauw commentedSorry for the late reply.
It looks like there is somehow an old block in the block database table with delta 2.
Can you have a look at the block table in the database.
Comment #6
Nightwalker3000 commentedThanks i've found the error. It was stupid, i've tried to user ddblock with Content panels and the delta=2 was the delta of my Panel and not for the ddblock which was integrated in this panel. If i run ddblock in a single Block, it works well :)
Maybe a feature Request for the future: Panel integration for ddblock
Comment #7.0
(not verified) commentedcleanedup