When I try to add or edit a block reaction, I get this error:

PHP Fatal error: Using $this when not in object context in context/plugins/context_reaction_block.inc on line 408

This is in a PHP 5.1 environment (I know, I know), so js_decode() is calling $this->_json_decode($json). But js_decode is defined as a static function, so I think that means it doesn't know what $this is (I'm not an expert on OOP in PHP, but I think that's true).

I've attached a patch that redefines js_decode as public. It's either that, or having to call return context_reaction_block::_json_decode($json), which seems hideous. I do know that I stop getting fatal errors when I define this function.

Unfortunately, the block order is not preserved when I save the page, but I'm still trying to figure out if that's a context bug or a PHP 5.1 bug.

CommentFileSizeAuthor
context_reaction_block.inc_.patch548 byteschellman
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yhahn’s picture

Status: Needs review » Fixed

Thanks. Committed http://drupal.org/cvs?commit=399514. I made it a protected function as the block reaction is the only one that calls this function.

Status: Fixed » Closed (fixed)

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