Hi!
I get this warning after send an order:

warning: Invalid argument supplied for foreach() in .../sites/all/modules/uc_hotel/hotel_booking/hotel_booking.module on line 1214.

Before that, at the Order complete screen it displays this message:
Unable to send e-mail. Please contact the site administrator if the problem persists.

I don't know if this message is related to the previous warning... but I receive the client email with my order data, but I don't receive the store admin mail.

I'm on Drupal 6.14.

Thanks for this module...

CommentFileSizeAuthor
#2 610230.patch1.61 KBwillvincent
#3 610230-1.patch3.84 KBwillvincent
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

When I reviewed the order, in the store admin, the same warning displays:
warning: Invalid argument supplied for foreach() in .../sites/all/modules/uc_hotel/hotel_booking/hotel_booking.module on line 1214.

willvincent’s picture

FileSize
1.61 KB

This warning is appearing because it's trying to check values of an array related to upgrade/addon products. That array doesn't exist in the order object unless addon products are added. This patch should solve that problem by adding an empty array even if there are no addon items added to the order.

The attached patch should take care of the invalid foreach argument warning. I don't believe the unable to send email message is related to the module.

Apply this patch from the uc_hotel directory.

Edit: Use the patch in comment #3, rather than this one.

willvincent’s picture

Assigned: Unassigned » willvincent
Status: Active » Needs review
FileSize
3.84 KB

Scratch that.. use this patch instead... the previous patch wasn't made properly, and didn't include both files that need altering to fix this issue; this one should.

larowlan’s picture

To get the admin email you need to set the store email address at admin->store->settings->contact settings

Anonymous’s picture

Can't apply the patch to hotel_booking.module file:

Hunk #1 FAILED at 1210.
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 73:  

I tryed to correct the patch, but I am not very good with patches system...

Anonymous’s picture

Oops! [#4] Thank you for help @larowlan. I installed this module on a clean drupal and I forget to fill the store settings.

willvincent’s picture

place the patch file into your /modules/uc_hotel directory (or wherever your installed to)...

at the command prompt, type:
patch -p0 < 610230-1.patch

should apply just fine...

Anonymous’s picture

After applying the patch everything it's ok. Thanks

willvincent’s picture

Status: Needs review » Fixed

Committed to CVS.

Continue to use patch from post #3 until next release if not installing from cvs.

PepeMty’s picture

Thanks, Will!
Somehow I don't have SSH access :-(

Pepe

willvincent’s picture

I've added a devel snapshot for those who can't access cvs for various reasons. As of now (Oct. 30, 2009 10:25am CST) the only changes between the official release and devel snapshot are this patch and the patch to fix occupancy modifier updates from issue 618248.

PepeMty’s picture

Will, as always, much obliged! :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.