Fatal error: Unsupported operand types in /var/aegir/acquia-drupal-6.14/sites/all/modules/ubercart/uc_store/includes/uc_price.inc on line 91
So far, I can't trace this to a specific module. Because it's a php fatal error, devel can't backtrace it either (or if it can, I can't figure out how at 230am).
Line 91 is using += array() which I'm guessing is the issue but again, I can't seem to pin this on a specific module yet. It's a slow process to find the culprit, if there is one (other than Ubercart itself).
BTW: Had to turn on E_ALL just to find this error, was previously a white-screen of death.
Comments
Comment #1
cridenour commentedUpdate: I can view all the products themselves no problem.
Comment #2
splash112 commentedWhat do you do when you get this problem? Try to view a product, open one, or what?
It tries to change? some variable to an array but it can't.
Comment #3
Island Usurper commentedYou can add ddebug_backtrace() right before the += line to get the backtrace printed out right before the error happens. Somehow I managed to configure PHP itself to show a backtrace on errors, but I'm afraid I don't remember how I did that. It might be a particular version I got from WAMP. Edit: I went and looked, and it might be
display_startup_errorsand/orhtml_errorsin my php.ini file.Comment #4
cridenour commentedIt is when I go to a sub-category page (it is nested under another category).
And ddebug_backtrace() doesn't work on a PHP fatal error :(
Comment #5
zcferres commentedsame error here only when going to a product that is in a subcategory. does UC support nested product categories?
Comment #6
zcferres commentedI just noticed that when I add the product to a top level category that contains no children it works. When I add it to a subcategory it doesn't work. When I add it to a top level category that contains children it doesn't work (even if it is not inside the children). This seems to be a problem with taxonomy and catalog.
Comment #7
cridenour commentedGlad to know I'm not crazy.
I think this definitely stands as critical. Would love to get some feedback from others who attempt to recreate this error.
Thanks.
Comment #8
Island Usurper commentedI still can't duplicate this. I wonder if it might be because of a difference in PHP version. I haven't had any problems with 5.2.8, but I think 5.3 will work as well.
Comment #9
zcferres commentedPHP version 5.2.10 here. I get the error.
Comment #10
splash112 commentedI'm not really sure if I am pointing in the right direction, but this seems interesting:
http://bugs.php.net/bug.php?id=49000
It's about 5.2.9 nad up in CLI interactive mode (php -a). Functions in an include that define a function which includes another file...
Found it here:
http://framework.zend.com/issues/browse/ZF-7107%3Bjsessionid=37BAF367BB2...
Same error and php versions seem to match the problem. Might try to downgrade PHP to 5.2.8 or upgrade 5.2.11 and see how it behaves then.
Problem might be variable_get which is in includes/bootstrap.inc.
Good luck!
Comment #11
Island Usurper commentedI've tried it with PHP 5.2.9-1 and I still can't get any errors to show up. I'm starting to think there must be some kind of custom code or something that's using uc_price() the wrong way. I think the thing to do is to try ddebug_backtrace() again, but comment out the lines with the += in them. Stuff will probably break, but not as badly as a fatal error, so you should be able to see the output.
Reduced the priority down to normal since I don't think this is a problem specifically with Ubercart itself. If we can find out what part is interacting badly, we can go from there.
Comment #12
cridenour commentedPlease see the backtrace.
http://sales.heliport.chrisridenour.com/catalog/lighting/perimeter-lights
Comment #13
splash112 commented@Island
That would be quite surprising, seeing the code in question below.
Can't really see any possibility why $options should not be an array. My best bet would be PHP bug and solved in the latest release of PHP.
Comment #14
cridenour commentedI upgraded to 5.11 and am still seeing this issue. Perhaps it is a Aegir issue? Acquia Drupal issue?
If I can't get Ubercart running on Ubuntu 8.10 with Aegir and Acquia running, that's a problem. Of course, we need to find out _why_ this is happening.
Thank you so much for your help so far.
Comment #15
Island Usurper commentedtheme_uc_quotes_products()
That's from a contrib module (uc_quotes, not the uc_quote that is in Ubercart), so I don't know how it works. I bet it needs to be fixed to work with the price API somehow. That's kind of strange, because I thought we had changed uc_currency_format() to be a wrapper for uc_price(). Its function signature wasn't changed, though, so other modules should still be able to use it the same way.
Comment #16
cridenour commentedThanks for looking into this. I didn't recognize the contrib module :)
Disabling the module fixed the issue and will look forward to its maintainer making the update.
Comment #17
alexmartin commentedI'm also getting this issue. Any word on a patch for this? Let me know if any more info is required. Thanks.
Comment #18
arpieb commentedI'm running D6.14 + UC 6.x-2.2 on PHP 5.2.9 under CentOS, also getting this error on anything hierachical in the product catalog. I've got a client who has to give on-demand quotes for his customers for some products due to limited run/supply costs, so really need to know if a fix is on the way or I have to find a workaround for this feature...
Due to the fact that it flat breaks the site with a WSOD for anything using a hierarchical product catalog, upping it to a "critical" bug...
Comment #19
jazzitup commentedConfirmed! I've just tried to uncheck "Display products in the catalog in a grid." from
and when I clicked on "Save configuration" button - this fatal error appeared. Now I can't see my catalog content as stated in #6.
Comment #20
arpieb commentedConfirmed this going the other way - I enabled product grid display, and the grid showed up fine. Disabled it again, and get a WSOD when the product listing is being displayed. That narrows it down to something related to the product list vs. grid...
Comment #21
arpieb commentedActually, if $options is passed in and is not an array, this would definitely break, which is the case. I managed to get a backtrace dumped to file before the page crashed, and found that a value of '1' was being passed in list mode, whereas an empty array was passed in grid mode. Appending an array to a number using the += operator will not work...
Also, interestingly enough, the args passed to uc_price() are totally different when the uc_quotes module is enabled vs disabled. I'm attaching all four dumps (grid and list with uc_quotes enabled, and without) - might help someone who is more familiar with the workings of uc_quotes than I am... All were generated from the same catalog page, which was from a hierarchical product catalog.
Also, as a side note - I know that UC2 made some significant API changes that have broken some other modules - any chance this might also be a victim...? After all, uc_quotes hasn't been updated since Feb 2009, and UC2 came out in Oct 2009.
-R
Comment #22
derp commentedsubscribe.
Comment #23
cridenour commentedOh, I'm sure this is a UC2 cause - but here at Drupal, we like to ignore legacy and just force the contributed modules to catch up :)
We may need to have someone take over this module given this issue. I've lived without this module, but it sure would be nice to have. I'll see about patching this if I get the chance over the next couple of weeks.
Comment #24
TwistedLincoln commentedApplying the patch listed here: http://drupal.org/node/492718 fixed it for me, using Ubercart 2.2
Comment #25
deensdale commentedI have "fixed" this issue by changing the line 91 (uc_price.inc)
to
This is a quick fix only. My bespoke code is passing an array to uc_price but I still had the similar problem as the posts above. I will need to revisit my own module to find the reason later, I just thought I'll share my "hack."
Comment #26
TallDavid commentedPatch mentioned in #24 above did not work for me. Subscribe.
Note to self: e3e
Comment #27
alfthecat commentedsubscribing
Comment #28
paskainos commented@TwistedLincoln: same here. Applying this patch fixed this error for me too.
Comment #29
rodmarasi commentedpatch at #24 did solve the problem for me, too. this issue has been around for more than a year. hopefully the will be an upgrade for this module soon.
Comment #30
brisath commentedSubscribe
Comment #31
brisath commentedI'm still getting these errors on any catalog taxonomy items clicked. I really like the module, but is it going to be maintained?
Comment #32
brisath commentedPerhaps mine is a different issue? My error reads
Fatal error: Unsupported operand types in /home/mysite/public_html/sites/all/modules/ubercart/uc_store/includes/uc_price.inc on line 85
Line 85 is the last one listed below