Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I tried debugging a bit and found the problem on this line of uc_cart_get_contents():
// Allow other modules a chance to alter the fully loaded cart object.
drupal_alter('uc_cart', $items[$cid]);
right before that script executes succesfully (tried it with a die(var_dump(1));)
but after that there is nothing.
browser's response: (chrome)
No data received
Unable to load the webpage because the server sent no data.
My guess:
Maybe because $items[$cid] is NULL?
Comment | File | Size | Author |
---|---|---|---|
#10 | 1410452-alter-empty-cart.patch | 453 bytes | wodenx |
Comments
Comment #1
longwaveCan't reproduce this with a quick test, and the entire checkout process is covered by a SimpleTest, which also works. The line you have identified has been in uc_cart_get_contents() for some time.
What payment method are you using to test with? Do you have any contrib modules installed, specifically ones that might implement hook_uc_cart_alter()? (perhaps it is failing during the alter for some other reason) Do you have any errors in your server error log? (it's also strange that you get no output at all)
Comment #2
ParisLiakos CreditAttribution: ParisLiakos commentedYes,thanks for the info,i guess that some other module implements the hook and breaks everything..i have no idea why i have no output on browser.the weird thing is that there is no php notice or warning in the reports and everything was fine with rc3.
i will check each
hook_uc_cart_alter
implementation and get back to if i some of my custom code didnt break it.thanks longwave
Comment #3
ParisLiakos CreditAttribution: ParisLiakos commentedoops sorry for status change
Comment #4
ParisLiakos CreditAttribution: ParisLiakos commentedok i kept debugging in drupal_alter.the only module that implements it is uc_quote with
uc_quote_uc_cart_alter
which callsuc_coupon_session_validate
which in turn callsuc_cart_get_contents
again..maybe its looping endlessly?if i set
$items[$cid]
asarray()
beforedrupal_alter()
everything works just fine.Comment #5
ParisLiakos CreditAttribution: ParisLiakos commentedHmm yes it is.i added watchdog('alter', REQUEST_TIME) right before drupal_alter and i got about 100 entries in dblog..
so,i am reopening this
Comment #6
wodenx CreditAttribution: wodenx commentedDoes everything work if you disable uc_coupon? If so, this should be moved to the uc_coupon queue - I haven't yet had a chance to fully test uc_coupon with the latest ubercart -dev.
Comment #7
ParisLiakos CreditAttribution: ParisLiakos commentedYes,disabling uc_coupons solve the problem..moving the issue there
Comment #8
wodenx CreditAttribution: wodenx commentedI can't reproduce on my end. uc_coupon_session_validate() only calls uc_cart_get_contents() when no products are supplied. Do any of your custom modules implement any of the following uc_coupon hooks:
hook_uc_coupon_revalidate
hook_uc_coupon_validate
hook_uc_coupon_apply
hook_uc_coupon_remove
or do you have uc_coupon_workflow enabled, and active rules which respond to any of the following events:
'check for automatic discounts'
'a valid discount coupon is applied'
'a valid discount coupon is removed'
Comment #9
ParisLiakos CreditAttribution: ParisLiakos commentednope,i dont use coupons at all..it was enabled because i forgot i had it enabled just to check it out..did you try it with latest ubercart dev version?
it was working fine with rc3.I used bank transfer as payment method.(if that helps)
Comment #10
wodenx CreditAttribution: wodenx commentedHang on - this may be an ubercart issue after all. Can you apply this patch (to ubercart) and see if the problem persists?
Comment #11
ParisLiakos CreditAttribution: ParisLiakos commentedyes it works with this patch..i should transfer the issue back to ubercart then?
Comment #12
wodenx CreditAttribution: wodenx commentedThis is definitely an Ubercart bug - the new 'empty' op to uc_cart_get_contents() - designed to avoid rebuilding the cart when it was known to be empty - sometimes causes hook_uc_cart_alter() to be invoked with a NULL argument. Patch at #10 fixes it.
Comment #13
longwaveCommitted
Comment #14.0
(not verified) CreditAttribution: commentedadded guess
Comment #15
solarDog CreditAttribution: solarDog commentedI am not sure if my issue applies here but, when updating Ubercart 7.x - 3.6 I get this in Chrome: "No Data received" (Unable to load the webpage because the server sent no data.
Error code: ERR_EMPTY_RESPONSE)
I have not been able to find a similar issue relating to this latest Ubercart release. ( 7.x - 3.6)
Reading the above comments suggests that this may be an Ubercart issue though it seems that it could also be another module conflict.
Any help would be much appreciated.
Comment #16
solarDog CreditAttribution: solarDog commentedScratch my last post... Updating the database fixed it and feeling rather sheepish.