Drupal logs several php notices:
Notice: Trying to get property of non-object at ideal_comments_form_comment_form_alter() (at line 46 of /.../sites/all/modules/ideal_comments/ideal_comments.module).
Seldom for registered users and quite often for cron.
It seems that $node arrives as non-object to line 46:
'#access' => (variable_get('comment_preview_' . $node->type, DRUPAL_OPTIONAL) != DRUPAL_DISABLED),

Running on drupal v7.20

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drupov’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Assigned: Unassigned » drupov
Issue summary: View changes
Status: Active » Needs review
FileSize
684 bytes

I have the same error when I am searching nodes which are panelized. For some reason hook_form_FORM_ID_alter() gets called but no $node-object can be loaded because menu_get_object failes to provide the information.

I've attached a patch to load the node through the information about its nid in the $form-array.

Iztok’s picture

Yep, menu_get_object() looks like a wrong approach, patch fixes that.