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.
When using hook_nodeapi() to call rsvp_api_create_invitation() the $node object lacks a title, which causes an error when you try to include the title in drupal_set_message() and watchdog().
I ran into this coding a module to automatically create invitations for newly inserted nodes.
I've attached a patch that assumes silent invitation creation when the $node object isn't populated yet, avoiding setting messages when there's no node object yet.
Comment | File | Size | Author |
---|---|---|---|
rsvp.api-messages_bug.patch | 990 bytes | dreamdust |
Comments
Comment #1
dreamdust CreditAttribution: dreamdust commentedOops I selected wrong version. This is 6.x-2.0
Comment #2
DamienMcKennaWhy are you checking against $node->title, the watchdog() and drupal_set_message() lines don't use it? It would make more sense to do this: