Hello,

I use a print html link on a custom page wich is not a node. I get often (not always) the error.

Notice : Undefined property: stdClass::$content dans _print_generate_path() (ligne 678 ... in print.pages.inc

But the module seems to work fine anyways.

Seems that the node object don't have the property content ligne 678
$node->content = preg_replace('!\s*<div class="contextual-links-wrapper">.*?</div>!sim', '', $node->content);

I added a condition in order to stop the error message

if (isset($node->content)){
  $node->content = preg_replace('!\s*<div class="contextual-links-wrapper">.*?</div>!sim', '', $node->content);
  }

Any other idea ?

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Johnny vd Laar’s picture

Issue summary: View changes

Looking at the code I think this is a quite strange line. On line 651 the node object is created and as I can see... the content variable is never added to the node object. So I wonder why this line is there at all...

donpwinston’s picture

I get the same error. Why is the "content" property being used? It does not even appear to have been added to the object yet. (I'm using v1.3)

Do not know why 2.0 is "recommended". It does not work.

Elin Yordanov’s picture

Status: Active » Needs review
FileSize
662 bytes

I think it was intended to clear $node->body from contextual links, but mistakenly used $node->content. Following patch fixes this issue. Please review.

pietrocap’s picture

Hi,
patch in #3 works for me.

Johnny vd Laar’s picture

Status: Needs review » Reviewed & tested by the community

Works for me as well!

hwasem’s picture

Patch #3 also worked for me. Thank you very much!

Heidi

laevensv@gmail.com’s picture

Hi

Thanks !

laevensv@gmail.com’s picture

Hi

Thanks !

hawkbreeze’s picture

Patch #3 work for me too.

fenstrat’s picture

Confirming #3 is RTBC.

DanChadwick’s picture

Again/also confirming RTBC. Thanks.

This bug is unfortunate for me because the URL that is affected is being attacked by spambots, so I get a ton of PHP notices in the error log.

webadpro’s picture

This is RTBC

upunkt’s picture

Yes, absolutely time to commit it. #3 still works.

natts’s picture

Please commit #3!

cpierce42’s picture

Priority: Normal » Major

It's been a year I am also voting for this patch. Subscribing.

jcnventura’s picture

Status: Reviewed & tested by the community » Fixed

This is what happens when you apply the 7.x-2.x patch to the 7.x-1.x branch.. I've committed this fix, but 7.x-1.x will not receive any other improvements (like support for the newer PDF libs).

Status: Fixed » Closed (fixed)

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