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 importing using feeds importer (not using node edit form), getting the following php errors/notices
Notice: Undefined property: stdClass::$nid in print_link_allowed() (line 845 of /path/to/drupal/sites/all/modules/contrib/print/print.module).
Notice: Undefined property: stdClass::$nid in print_mail_link_allowed() (line 598 of /path/to/drupal/sites/all/modules/contrib/print/print_mail/print_mail.module).
Notice: Undefined property: stdClass::$nid in print_mail_node_view() (line 189 of /path/to/drupal/sites/all/modules/contrib/print/print_mail/print_mail.module).
Notice: Undefined property: stdClass::$nid in sharethis_node_view() (line 310 of /path/to/drupal/sites/all/modules/contrib/sharethis/sharethis.module).
Notice: Undefined property: stdClass::$nid in template_preprocess_node() (line 1510 of /path/to/drupal/modules/node/node.module).
Notice: Undefined property: stdClass::$nid in node_uri() (line 250 of /path/to/drupal/modules/node/node.module).
Notice: Undefined property: stdClass::$nid in include() (line 83 of /path/to/drupal/modules/node/node.tpl.php).
Notice: Undefined property: stdClass::$nid in node_build_content() (line 1366 of /path/to/drupal/modules/node/node.module).
The problem happens in the opencalais.module in opencalais_get_suggestions(&$node, $opencalais_type = NULL) {}
$elements = node_view($node);
//$body = strip_tags(drupal_render($elements));
$body = drupal_render($elements);
$date = format_date($node->created, 'custom', 'r');
Specifically using node_view() in this case when called in hook_node_presave() which node id does not exist yet.
Attached is a rough patch that would fix this
Comment | File | Size | Author |
---|---|---|---|
#1 | opencalais-1976754.patch | 1.09 KB | xcf33 |
Comments
Comment #1
xcf33 CreditAttribution: xcf33 commentedComment #2
xcf33 CreditAttribution: xcf33 commentedCommitted http://drupalcode.org/project/opencalais.git/commit/ba7069f