Download & Extend

Fatal error: Cannot access empty property

Project:UC Upsell
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hi there,

it seems that the modules gives an update when using uc_upsell.

When I combine a free product with an "upsell" product ("related products for upsell"), I get the following error message when adding the product to the cart:

Fatal error: Cannot access empty property in /sites/all/modules/uc_upsell/uc_upsell.module on line 200

The issue is easy to reproduce, once I remove the upselling product the issue is gone.

Comments

#1

Project:UC Free Order Payment Method» UC Upsell
Version:6.x-1.0-beta3» 6.x-1.x-dev

Not sure what the problem is, but I've moved this to the Upsell queue.

#2

Can you verify you're using the latest Upsell version?

#3

Status:active» postponed (maintainer needs more info)

Could use some more info here. Are you sure you're using the latest Upsell code? Try the dev version first.

#4

ok, i am getting the same error (just slightly different line number):

Fatal error: Cannot access empty property in /home/xxx/xxx.com/sites/all/modules/uc_upsell/uc_upsell.module on line 220

i am using the 6.x-1.x-dev version, from Feb 25, 2011

and the product i am viewing is not even a free product!

cheers
Peter "Fish" Fisera
Earth Angel Consulting

#5

stupido errors at sql do you know standard sql or not? Postgresql return lot of basic errors

#6

Huh?

#7

yeah, not sure what #5 is about, that's for sure! :-)

re: #4, the error i reported is because no image field (or imagecache preset) was set up yet for a product image. but i have created one, and it's still giving the error. i'll see if i can figure out why, and get back to you if i can figure out what's going on there.

you may want to consider tweaking this module so that it doesn't give nasty errors if there's no product image field. i admit that it's rare to use Ubercart without product images, but it's not unheard of.

cheers
Fish

#8

Any update on a fix for this problem? I can only get the module to work when I comment out the following line:

$imagefield = $node->{$imagefield[0]}[0]['filepath'];

Obviously this disables the images and I'd like to use images with this module so would appreciate any help.

Cheers

**EDIT**

It's all of a sudden decided to work and I'm not sure why, I was doing a bit of configurations here and there but can't point out just what triggered it to work.

Would still like some info on the problem though.

#9

That definitely doesn't help much. Are you using imagecache? Did you configure an image preset to use for your Upsell images?

#10

Status:postponed (maintainer needs more info)» active

All you need to know is that $imagefield = $node->{$imagefield[0]}[0]['filepath']; will produce a fatal error on some drupal setups. $imagefield[0] is NULL, $node->NULL is a fatal error.

This can happen under a variety of circumstances, the easiest way to replicate it is creating a new product class and not creating an associated image field with it.

#11

Title:Problems when using uc_upsell» Fatal error: Cannot access empty property

Updating the useless title.

#12

Patch attached.

AttachmentSize
uc_upsell_568686.patch 604 bytes
nobody click here