I get this error on some occasions, amongst others when editing content types.

  • Notice: Undefined index: #node in fb_post_form_alter() (line 135 of /mnt/web9/a1/63/53769763/htdocs/Drupal_03/sites/all/modules/fb_post/fb_post.module).
  • Notice: Trying to get property of non-object in fb_post_form_alter() (line 135 of /mnt/web9/a1/63/53769763/htdocs/Drupal_03/sites/all/modules/fb_post/fb_post.module).

I also found the solution on http://drupal.stackexchange.com/questions/42386/how-to-acess-node-object...

It seems on line 90 in fb_post.module the hook used instead of hook_form_alter is hook_form_node_form_alter, since $form['#node'] doesn't exist in hook_form_alter, if it is not a node edit form.

Comments

DolfAndringa’s picture

Issue summary: View changes

  • kruhak committed c1a69e0 on 7.x-2.x
    Issue #2384133 by DolfAndringa: undefined index #node in...
kruhak’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

reswild’s picture

Version: 7.x-2.1 » 7.x-2.2
Status: Closed (fixed) » Needs work

This solution doesn't work, as you are now restricting the module to work only on nodes of the content type 'page'. See comment #12 in issue #2482701.

The latest patch therefore needs to be reverted, and a different solution found.

usdv’s picture

Fixed in the latest stable release.

usdv’s picture

Status: Needs work » Fixed

Closing

usdv’s picture

Status: Fixed » Closed (fixed)