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 :)

CommentFileSizeAuthor
#3 view.txt14.5 KBNightwalker3000

Comments

Nightwalker3000’s picture

Is it normal that i can't see my own issue?

ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

I only see the issue title of the first post.
Did you have text in the original issue post?

Nightwalker3000’s picture

Issue summary: View changes

truncated

Nightwalker3000’s picture

StatusFileSize
new14.5 KB

I've trunc my post. My View was too long for a issue. My View is attached to this post.

Nightwalker3000’s picture

Status: Postponed (maintainer needs more info) » Active

Hello, what kind of information do you need in addition?

ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

Sorry 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.

Nightwalker3000’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks 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

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

cleanedup