Random errors on product page - undefined property stdclass

getting these errors after i finish editing one of my products, but if i refresh it goes away.

screenshot
http://prntscr.com/1s0l8

CommentFileSizeAuthor
#1 1135876-revision-property.patch4.12 KBlongwave

Comments

longwave’s picture

Status: Active » Needs review
StatusFileSize
new4.12 KB

Please test the attached patch.

patoshi’s picture

You are awesome longwave =).. thanks for the patch. would you be able to enlighten me on why this error was happening?

longwave’s picture

Drupal 7 is more strict about errors than Drupal 6 was, but not all of Ubercart's code has been updated to match. In this case, it appears that the $node->revision property is not guaranteed to exist - this wasn't a problem in D6 but we need a more correct test in D7 to avoid causing errors.

longwave’s picture

Title: Random errors on product page - undefined property stdclass » Random errors on product page - undefined property $node->street1
Status: Needs review » Active

Committed #1, but this doesn't fix the $node->street1 warning, which I think is more complicated and needs further investigation.

Island Usurper’s picture

Hopefully the street1 error will be automatically fixed once #1071332: State/Province select boxes need converting to Ajax gets in. I haven't seen that error yet, so I'm not sure if it would or not.

tr’s picture

Status: Active » Closed (duplicate)

I'm pretty sure the $node->street1 issue is the same as in #1187414: uc_quote uses both $node->street1 and $node->shipping_address->street1. I think it's better to handle it in that issue, since there's already a patch being worked on there.