In all three modules (print, print_pdf and print_mail), the hook_node_insert expects three "fields" to exists on the node

  • {module}_display
  • {module}_display_comment
  • {module}_display_urllist

But if a node isn't create from the node edit form, these fields wont exists when hook_node_insert is executed.

I also changed if statements to follow http://drupal.org/coding-standards.

CommentFileSizeAuthor
#1 hook_node_insert-1258536-1.patch4.82 KBlogaritmisk

Comments

logaritmisk’s picture

StatusFileSize
new4.82 KB
jcnventura’s picture

Status: Needs review » Fixed

Thanks for the patch.. I've committed it to git.

Status: Fixed » Closed (fixed)

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

korzh-nick’s picture

Hi.
Еrror
Undefined property: stdClass::$print_display in print_link_allowed() (line 868 of sites/all/modules/print/print.module).
occurs when a user (not admin) creates a material and clicks the "Preview"

malc_b’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta1

Hi,

I see the same error as #4, beta1 code which post date #2. Is the fix in beta1 or not? I tried suppressing the links by using if php returns true and then checking $_GET['q'] for .../edit. That turns off the icons in preview. That seems to reduce the errors but wasn't a 100% fix.