(Note: This is related to #1978258: Stops inserting until Class Registry cache cleared. This post is a request for further information to help me figure out the cause of that problem.)

On a site with Nodeblock installed, I'm trying to use Insert Block to insert a Quicktab block. This works fine for a period of time; eventually the block stops including and the following errors are displayed:

Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 537 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 542 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 547 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 557 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 537 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 542 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 547 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 557 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 537 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 542 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 547 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 557 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 537 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 542 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 547 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).
Notice: Undefined property: stdClass::$nodeblock in nodeblock_block_view() (line 557 of /home/coolbean/public_html/_dev/sites/all/modules/nodeblock/nodeblock.module).

Can someone help me understand what would cause those errors to be displayed?

Salient facts:

  • The page does include 3 nodeblocks, but they are displayed successfully. (QuickTabs is doesn't have any interplay with nodeblock that I'm aware of.)
  • Errors and failure behavior are observed while logged-in.
  • The errors go away and Insert Block functions properly when the Class Registry cache is cleared.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

escoles’s picture

Title: Sporadically seeing errors » Nodeblock content disappearing periodically until class registry cache cleared
Category: support » bug

Changing the issue from 'support' to 'bug' because this represents a deeper and more extensive problem than I originally thought; also, I'm now pretty sure this is a nodeblock issue, not a node_insert issue, and that if it's a configuration problem it's associated specifically with nodeblock 7.x-1.3.

What's happening now is that the content, and only the content, of all nodeblocks is disappearing from regions where they're included. (The containers for the nodeblocks are still being written to the regions, just with no content.)

This happens after a few hours, and the temporary fix is to clear the class registry cache. The behavior of the issue changed from just blocks included via filter to blocks in regions after I created a new nodeblock and included it in a region. (The block was a simple text block displaying a simple IMG tag.) (Note: the behavior change was NOT driven by disabling insert_block, but it does persist now that insert_block has been disabled.)

Right now I'm running this system in parallel with a production system which has a nearly identical configuration. Production is NOT experiencing this issue.

The only relevant difference as far as I can see is in the version of Nodeblock installed: The production version is running Nodeblock 7.x-1.2; dev is running Nodeblock 7.x-1.3.

escoles’s picture

Rolling back to nodeblock-7.x-1.2 has eliminated the behavior. So this seems to be an issue with nodeblock-7.x-1.2.

Johnny vd Laar’s picture

Status: Active » Postponed (maintainer needs more info)

Nodeblock 7.x-1.3 included a new nodeblock table which is added with this update hook: nodeblock_update_7102

did you run update.php after updating? can you verify whether the nodeblock table exists and that your nodes are added there?

escoles’s picture

The nodeblock table definitely existed. Here's the SQL for it:

-- phpMyAdmin SQL Dump
-- version 3.5.8
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 10, 2013 at 10:13 AM
-- Server version: 5.0.96-community
-- PHP Version: 5.3.17

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

--
-- Database: `coolbean_2013dev`
--

-- --------------------------------------------------------

--
-- Table structure for table `nodeblock`
--

CREATE TABLE `nodeblock` (
  `nid` int(10) unsigned NOT NULL COMMENT 'The primary identifier for a node.',
  `enabled` tinyint(4) NOT NULL default '1' COMMENT 'A flag indicating whether a block should be created.',
  `machine_name` varchar(32) NOT NULL COMMENT 'The machine name for a block.',
  `block_title` varchar(255) NOT NULL default '' COMMENT 'The block title for a block.',
  `view_mode` varchar(255) NOT NULL COMMENT 'The view mode used to render the node.',
  `node_link` varchar(255) NOT NULL default '0' COMMENT 'Whether the node links should be shown.',
  `comment_link` varchar(255) NOT NULL default '0' COMMENT 'Whether the comment links should be shown.',
  `translation_fallback` tinyint(4) NOT NULL default '0' COMMENT 'A flag indicating whether the translation fallback is enabled.',
  PRIMARY KEY  (`nid`),
  UNIQUE KEY `machine_name` (`machine_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='The base table for nodeblock.module.';
claudiu.cristea’s picture

Title: Nodeblock content disappearing periodically until class registry cache cleared » Error when loading linked node
Assigned: Unassigned » claudiu.cristea
Status: Postponed (maintainer needs more info) » Needs review
FileSize
785 bytes

->fetchCol() returns an array of items from the first column. Even it's a single row will return array($nid) instead of $nid. ->fetchField() is the correct answer here. See https://drupal.org/node/1251174.

claudiu.cristea’s picture

FileSize
1.97 KB

Fixing all occurrences.

Johnny vd Laar’s picture

Fetch column returns only one column of the next row in the result set. So I don't think it ever returns an array. I also don't think that this patch solves this issue as all changes are on node update and this seems to be a node display problem.

escoles can you check if the nodeblock config of these nodes are written into the table?

I've added a little change here:
http://drupalcode.org/project/nodeblock.git/blobdiff/6c286f2a403afa82652...

which should prevent the notices from showing up but I assume that the nodeblocks are not displaying after this fix.

Johnny vd Laar’s picture

Status: Needs review » Needs work
Johnny vd Laar’s picture

Status: Needs work » Closed (cannot reproduce)