How do I list all blocks with PHP enabled inside? I added a custom block that uses PHP, and now I get the following notice message:


  Trying to get property of non-object in eval() (line 5 of /public_html/modules/php/php.module(80) : eval()'d code).


I am trying to find which one is causing that notice, and since I have many blocks, I would rather do it without using the user interface.

Is there a way to get a list of blocks using PHP? I would be happy also with a solution using the Views module, as long as I don't need to look at the settings of each block, one by one.
If you want to find all custom blocks that have PHP code as their input format, you can query the block_custom table. The format column will contain the key php_code.

$blocks = db_select('block_custom')
  -&gt;fields('block_custom')
  -&gt;condition('format', 'php_code')
  -&gt;execute();
foreach($blocks as $block) {
  // @TODO: Add your own actionable code
}