I've just updated to the most recent dev version as I was having a problem with uploading files/images - i was receiving the following error:

Notice: Undefined index: #suffix in file_ajax_upload() (line 288 of /modules/file/file.module).

and

EntityMalformedException: Missing bundle property on entity of type registration. in entity_extract_ids() (line 7707 of includes/common.inc).

Figuring it's always best to update if there's an issue I update the module and can now not enter any registration information as it skips the registration pane. I'm now receiving the following errors in the log:

Warning: Invalid argument supplied for foreach() in commerce_registration_commerce_checkout_router() (line 1109 of sites/all/modules/commerce_registration/commerce_registration.module).

When I roll back the second error disappears and the first one comes back. (although if I don't put a field for uploading a file then registration works just fine)

Thanks

Comments

gc11 created an issue. See original summary.

gc11’s picture

Update:

I've worked out this only happens on events that were already set up - if you use a new event/product the error goes away and the registration pane is not skipped. I guess a work around is to clone the event and add it again.

The code below is the line which seems to be throwing the error.
foreach ($line_item->data['context']['product_ids'] as $product_id) {

gc11’s picture

Priority: Critical » Normal
blacklabel_tom’s picture

Hi,

Thanks for the report, can you clarify your point in comment #2 please?

Am I right in thinking you setup some registrations THEN upgraded the module and those registrations were skipped and ones you setup AFTER upgrade were OK?

Cheers

Tom

gc11’s picture

Hi Tom,

Yes that's exactly right. The registrations that were setup before the upgrade, the registration pane is skipped. Any setup after the upgrade work fine. Also, if it helps at all, I tried using the same product display but making a new variation and attaching it to the old display. The pane still skipped.

Basically I could only get it to not skip if I set up a new variation within a new product display.

Cheers,

pineray’s picture

Status: Active » Needs review
StatusFileSize
new1.31 KB

I have same issue.

Why use entity_metadata_wrapper() function to get the product_id that corresponds to the line item?
I changed the code to get the product_id in another approach.
Please review my patch.

Thanks.

Adam Wood’s picture

Title: On update to recent dev version skips registration pane » Registration checkout page is skipped if a line item's 'data' property is empty
Priority: Normal » Major
StatusFileSize
new962 bytes

We've ran into this problem recently as well. It's caused by the fact that a line item's 'data' property isn't always populated, hence the product ID not being found there. One example is if a product is added to the cart via commerce_cart_product_add_by_id().

The attached patch is a simpler version of @pineray's from #6, which still uses entity_metadata_wrapper() to fetch the order.

Raised priority level as this realistically renders the system unusable for sites that add line items to a cart in a certain way.

acrazyanimal’s picture

Assigned: Unassigned » acrazyanimal
jollysolutions’s picture

Status: Needs review » Reviewed & tested by the community

fully tested and works please push

john.oltman’s picture

Status: Reviewed & tested by the community » Closed (outdated)