Im getting this error 5 times the same after one save.

Notice: Trying to get property of non-object v node_level_blocks_block_list_alter() (riadok 144 z .../sites/all/modules/node_level_blocks/node_level_blocks.module).

I use Node-level Blocks with Nodeblock in d7.22. I created a content type Blok. When I added node Block everytning ok. But when I again edit created node and choose to created block move to region I got error.
I test dev version but olso tested 7.x-1.0.beta1 and got the same error.
Thanks.

CommentFileSizeAuthor
#6 creating-new.jpg129.34 KBvoloda86
#6 after-save.jpg151.77 KBvoloda86

Comments

voloda86’s picture

I tested it better and find, that how many blocks are showing in Node-level blocks, while Im creating content type blok, I get the same number of errors. No change in front-end for block region position.

The error shows even I set actual region.

I think module cannot owerwrite drupal block region arrange.

Johnny vd Laar’s picture

Status: Active » Postponed (maintainer needs more info)

Ok I hope you can provide me some more details. At line 144 is this function:

/**
 * Implements hook_block_list_alter().
 */
function node_level_blocks_block_list_alter(&$block_list) {
  if (($node = menu_get_object()) && isset($node->node_level_blocks)) {
    $settings = isset($node->node_level_blocks['settings']) ? $node->node_level_blocks['settings'] : node_level_blocks_node_type_settings($node->type);
    $blocks = $node->node_level_blocks['blocks'];

    if (isset($settings->nodeblock) && $settings->nodeblock) {
      foreach ($blocks as $block) {
        if ($block->module == 'nodeblock') {
          $nodeblock = nodeblock_load_nodeblock($block->delta);
          if ($nodeblock && $nodeblock->node_level_blocks['blocks']) {
            $blocks = array_merge($blocks, $nodeblock->node_level_blocks['blocks']);
          }
        }
      }
    }

    _node_level_blocks_set_blocks($block_list, $blocks, $settings);
  }
}

Just to make sure we have the same version.

Can you tell me (var_dump) what is inside the $blocks variable?

voloda86’s picture

Please, can you give me a direction how to get this.

Here is node-level-block info file:
name = "Node-level Blocks"
description = "Allows node editors to assign blocks to regions on a node base."
dependencies[] = block
dependencies[] = node
core = 7.x

; Information added by drupal.org packaging script on 2013-04-05
version = "7.x-1.0-beta1+9-dev"
core = "7.x"
project = "node_level_blocks"
datestamp = "1365168156"

I install devel and theme developer and click on block made by nodeblock in frontend. Than looking for block in drupal themer and find this:
block (Object) stdClass
∞ (Recursion)

I dont know if it is what you want.

I found another thing. Node level block under edit content (with nodeblock) not showing exact position of displayed blocks. All are disabled. When I move som to another position it shoves error above.

lmeurs’s picture

I ran into the same problem while testing this module through http://simplytest.me/project/node_level_blocks (7.x-1.0-beta1).

I enabled the module for the Basic page content type and selected a region and some modules. Then I created a new node without selecting blocks or anything. All still fine, but after editing and saving the node, still without setting blocks, the following errors appear:

Notice: Undefined index: settings in node_level_blocks_block_list_alter() (line 140 of /home/s43268410d0955b2/www/sites/default/modules/node_level_blocks/node_level_blocks.module).
Notice: Trying to get property of non-object in overlay_block_list_alter() (line 440 of /home/s43268410d0955b2/www/modules/overlay/overlay.module).
Notice: Trying to get property of non-object in overlay_block_list_alter() (line 440 of /home/s43268410d0955b2/www/modules/overlay/overlay.module).
Notice: Trying to get property of non-object in overlay_block_list_alter() (line 440 of /home/s43268410d0955b2/www/modules/overlay/overlay.module).
Notice: Trying to get property of non-object in overlay_block_list_alter() (line 440 of /home/s43268410d0955b2/www/modules/overlay/overlay.module).
Notice: Trying to get property of non-object in overlay_block_list_alter() (line 440 of /home/s43268410d0955b2/www/modules/overlay/overlay.module).
Notice: Trying to get property of non-object in overlay_block_list_alter() (line 440 of /home/s43268410d0955b2/www/modules/overlay/overlay.module).
Notice: Trying to get property of non-object in overlay_block_list_alter() (line 440 of /home/s43268410d0955b2/www/modules/overlay/overlay.module).

When you edit the content type and select only modules that do not have any blocks defined, the errors never appear.

Also turning off the core Overlay module helps.

lmeurs’s picture

Problem seems solved in the 7.x-1.x-dev version.

voloda86’s picture

StatusFileSize
new151.77 KB
new129.34 KB

I dont have error in overlay module. My error direct to node_level_blocks.module line 144.

I update node level blocks to 7.x-1.0-beta1+10-dev, and still getting error: Notice: Trying to get property of non-object v node_level_blocks_block_list_alter() (riadok 144 z /.../sites/all/modules/node_level_blocks/node_level_blocks.module).

Please see JPGs

Johnny vd Laar’s picture

You seem to be having the same table twice in the first jpg. This is a very odd problem. Can you completely remove and uninstall the module and then install the latest dev version?

voloda86’s picture

I looked into the dbx and no table was twice. I also disable, uninstall and install the latest dev module node level blocks. The error still appear.

I found path level blocks. Before I didnt setup it. And Im confused how and why to use it.

I write you what I want to do with node level block. I created demonstration site and I want to demonstrate user how to manage drupal site. Only problem I have is with block management access. I try Block Access, but It dont work. So Im looking another sollution, and try to manage node level blocks, but I dont know if it is the right modul for this.

Johnny vd Laar’s picture

Perhaps you can mail me your database + drupal website structure such that I can see what is happening. Because currently I have no clue what is causing this.

I have sent you a mail via the contact form so you get my mailaddress.

Johnny vd Laar’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)