Closed (fixed)
Project:
Ubercart Views
Version:
6.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
25 Oct 2009 at 14:22 UTC
Updated:
2 Apr 2011 at 00:41 UTC
Hi, when I upgrade Ubercart to the last version 2.0, I note that all my views with "Ubercart order: Order total" field with Ubercart price format is blank. In live preview this views I get "An error occurred at /admin/build/views/ajax/preview/orders". Any suggestion?
Comments
Comment #1
madsph commentedI can't reproduce this error - have you tried to clear the views cache?
Comment #2
jasonabc commentedYep - confirmed. Am using UberCart 2.0 (after upgrading from RC7) and any View with "Ubercart order: Order total" set to "UberCart Price" throws the above error. According to Lyle - the UberCart price field definitions were tweaked for the new 2.0 release of UberCart so he advised me to clear my Views cache:
http://www.ubercart.org/forum/support/13625/fatal_error_when_upgrading_r...
This*half* worked for me - some of my UberCart views loaded whereas before I just got a blank screen and this error in the logs:
PHP Fatal error: Cannot access empty property in \sites\all\modules\ubercart\uc_product\views\uc_product_handler_field_price.inc on line 63
Unfortunately clearing my Views cache did *not* work for my Views that use the "Ubercart order: Order total" field. That still displays an error on live preview and surfing to the Views page just gives me a blank screen and the above PHP fatal error. If I remove that field from the View then it works fine. If I put it back in - it breaks - so PaulM has definitely isolated the problem.
Any ideas? This has hosed all my order bulk operations stuff so have got my fingers crossed!
Comment #3
madsph commentedThis sounds serious, so I will try to see if I can reproduce it again and figure out what goes wrong. It seems however that the error is occurring as a result of the date module unintentionally implementing an ubercart hook.
I found these issues that relates to the problem.
#611060: Fatal Error when upgrading from RC7 to UC2.0
#611044: Fatal error: Unsupported operand types in .../uc_order.module on line 1459
Please let me know if they solve your issues.
Comment #4
madsph commentedUpdate. I am now able to reproduce the error, and applying the patch from #611044: Fatal error: Unsupported operand types in .../uc_order.module on line 1459 does not solve the problem, I will look further into this, but may have to raise the problem in the Ubercart project. I will however keep this issue updated to let you know of a solution.
Comment #5
madsph commentedUpdate 2.
I have now narrowed the problem down to the following.
For some reason I don't understand yet, the price field handler now does a node_load with the product nid. Since orders are not nodes, this fails for order total.
This means that I will have to make my own order total view handler that does the same as the price field handler but without loading a node.
The good news about this is that I regain the control of the error, so I can make sure it gets solved, the bad news is that I will be replicating Ubercart functionality rather than reuse, which means that this project just got a new maintainability issue.
I will get back when a patch is ready.
Comment #6
madsph commentedI have created a patch the simply adds a new field handler which is a copy of the old price field handler - this is not an ideal way of doing it but should solve the problem for now.
The patch is committed to the dev branch.
Comment #7
theunraveler commentedI can confirm that this error message is still being thrown for any view that contains the Order product: Price field, even after updating to the latest dev.
Comment #8
jasonabc commentedThe latest dev fixed the issue for me - thanks! My views are using "Ubercart order: Order total" which (until I installed the latest Dev) was causing the problem. Lyle did say that the UberCart price field definitions were tweaked for the new 2.0 release.
Comment #9
madsph commented@theunraveler
Have you remembered to clear views cahce after installing the new dev version?
Comment #10
theunraveler commented@madsph: Yes, I did. And the other Drupal caches just for good measure.
To be clear, the field that is causing the error is the "Order product: Price" field, not the "Ubercart order: Order total" field that others seem to be having problems with. But the error message is the same.
Comment #11
madsph commentedYou are right of course.
I thought that order product would get away with using the new handler since they are nodes - but they don't :-(, even if I add the nid as an additional field it still breaks (displaying prices of zero)
So I have committed a patch where the order product price fields also use the 'new' field handler.
Comment #12
theunraveler commentedExcellent. I updated to the newest dev and it takes care of the problem. Thanks so much, @madsph.
Comment #13
orangevinz commentedWhere I can find the patch please ?
I got the same issue : Fatal error: Cannot access empty property in sites/all/modules/ubercart/uc_product/views/uc_product_handler_field_price.inc on line 63
Thanks
Comment #14
madsph commentedyou need to download the latest 6.x-3.x-dev version
Comment #15
Seba commentedI'm getting the same error but I am not using the uc_views module.
I'm using ubercart 6.x-2.x-dev (<= the latest dev version fixed the #611044: Fatal error: Unsupported operand types in .../uc_order.module on line 1459 issue)
Also using views 6.x-2.7
Comment #16
madsph commented@seba
If you are not using uc_views I think you have posted in the wrong forum?
Comment #17
Seba commentedMaybe, but the fatal error message I get is exactly the same one.
Comment #18
madsph commentedThe fundamental problem here is that the view handler is now loading the associated node, which it didn't do before - and with out an nid this is the error you get.
But since you are not using uc_views it is hardly a problem that I can do any thing about - try in the Ubercart forum.
Comment #20
jugney commentedThe problem I'm having is that in my Order Management view, the order total shows on every order as "$0.00" EXCEPT when I sort the view by Order Total. Then the total shows up, but only then.
I was running ubercart RC6, and the order total column was blank. After recently upgrading to UC 2.0, now I get the above behavior. And I'm running the dev version of uc_views and have cleared all my caches.
Any ideas?
Comment #21
madsph commentedJust to be clear. are you running the 6.x-2.2 (official release) or the 6.x-2.x-dev (development release) of Ubercart?
If you are running 6.x-2.2 there is a know issue see #666038: handler 'uc_views_handler_field_money_amount' fails.
Comment #22
jugney commentedI was running the 6.x-2.2 official release. Just upgraded to the dev version, cleared all caches, and totals are working! Thank you.
Comment #23
jasonabc commentedAm running the latest dev, cleared caches and I still have this problem. The "Total" column (field "Ubercart order: Total") displays $0.00 all the way down... I switched to "Ubercart order: Balance" and that works fine - but I need the order total displayed - not the outstanding balance. Any ideas??