Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
DolfAndringa CreditAttribution: DolfAndringa commentedComment #3
kruhak CreditAttribution: kruhak at ADCI Solutions commentedComment #5
reswild CreditAttribution: reswild as a volunteer commentedThis 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.
Comment #6
usdv CreditAttribution: usdv at ADCI Solutions commentedFixed in the latest stable release.
Comment #7
usdv CreditAttribution: usdv as a volunteer and at ADCI Solutions commentedClosing
Comment #8
usdv CreditAttribution: usdv as a volunteer and at ADCI Solutions commented