When trying to edit a created recurring entity using the edit link on the recurring entity list page I'm pointed to the following URL:
admin/commerce/recurring-entities/1/edit
The page callback for this is entity_ui_get_form. This tries to load the form at commerce_recurring_edit_form which is constructed from the following line (entity.module:1258) $form_id = (!isset($bundle) || $bundle == $entity_type) ? $entity_type . '_form' : $entity_type . '_edit_' . $bundle . '_form';
There is a bundle for the entity which is 'product' so the commerce_recurring_edit_product_form is used. However, the implemented form callback is commerce_recurring_form. This issue is fixed by renaming the form function but I'm not sure what other things might break or why this behaviour is here. It seems that the bundle's of the commerce_recurring entity predate the form function and that the way the Entity API module does this predates the entire implementation.
I haven't been able to figure out exactly why it's now trying to load the specified form while for others it seems to be working fine.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | commerce_recurring_ui-fix_error_edit-form.patch | 1.96 KB | qtarant |
Comments
Comment #2
deggertsen commentedHere's a patch changing the form function as previously explained. This allows the edit form to load correctly. I have the same questions as Kingdutch though and after applying this patch I still get the following error. Not exactly sure how to fix it.
Error: Call to a member function entityFormSubmitBuildEntity() on boolean in entity_ui_form_submit_build_entity() (line 740 of /sites/all/modules/entity/includes/entity.ui.inc).Comment #3
johnnieg commentedExperiencing the same issue. Applied the patch and now on saving I'm stuck with Error: Call to a member function entityFormSubmitBuildEntity() on boolean in entity_ui_form_submit_build_entity() (line 740 of /sites/all/modules/entity/includes/entity.ui.inc).
Comment #4
83steps commentedHas anybody discovered anything further on this? I'm just testing Commerce Recurring for the first time on a dev site, hoping to use on a production site soon, but I'm encountering this error out of the box. It's a show-stopper because the way I need to test recurring orders is to place the initial order, then go in and edit the recurring entity and move its due date back to the past and then run cron. But 1) without the patch I can't even load the recurring entity edit form, and 2) with the patch the form loads beautifully but I can't save any changes.
Or is there another way I could test without being able to load the form? I guess I could try manually editing the timestamp for due date in the database. But really hope it doesn't come to that.
Comment #5
deggertsen commented@83steps. Yeah, unfortunately I'm not going to have time any time soon to look into this further and write a patch. I would be happy to review any patches though that can fix this bug, so if you can hire someone or something to help you find a solution and post a patch here that would be awesome. Otherwise the database method you mentioned will probably be what you're stuck with for now.
Comment #6
83steps commented@deggertsen OK, thanks for the reply. Manually changing the timestamp in the database seems to work fine for testing.
Comment #7
qtarant commentedI have the same problem as #1. After applying changes from #2, I have the error:
Error: Call to a member function entityFormSubmitBuildEntity() on boolean in entity_ui_form_submit_build_entity() (line 740 of /sites/all/modules/entity/includes/entity.ui.inc).
After investigating some time, I have solved the error by applying the patch attached to the 7.x-2.x-dev branch.
In the patch are included the changes referred in file "undefined_commerce_recurring_edit_product_form-2819145-2.patch"
Comment #8
deggertsen commentedAwesome! Thanks for the patch @qtarant. I will try to get this reviewed as soon as I can. In the meantime can anyone else check to see if this fixes the problem for you?
Comment #9
deggertsen commentedComment #10
akshitggrwl commentedPatch in #7 applies cleanly and resolves both issues mentioned in #1 and #2 for me.
Comment #11
83steps commentedAppears to work for me too! Note that after applying the patch I had to clear caches before saving the form to edit a recurring entity would work.
Comment #13
deggertsen commentedThanks everyone for the good work and reviews. Patch applied to dev!