Notice: Undefined index: order in CommerceReturnEntityController->create() (line 53 of /module_path/commerce_rma/modules/return/includes/commerce_return.controller.inc).
Notice: Trying to get property of non-object in CommerceReturnEntityController->create() (line 53 of /module_path/commerce_rma/modules/return/includes/commerce_return.controller.inc).
Recoverable fatal error: Argument 1 passed to commerce_return_get_order_returns() must be an instance of stdClass, null given, called in /module_path/commerce_rma/modules/return/commerce_return.module on line 453 and defined in commerce_return_get_order_returns() (line 511 of /module_path/commerce_rma/modules/return/commerce_return.module).

It seems the create method of the Controller class won't allow creation of the new Return entities using "basic" entity API.
I think the order data (value) shouldn't be mandatory in the code.
With Rules the order reference it could be easily added with "Set a data value" action.

Comments

vasike’s picture

Status: Active » Needs review
StatusFileSize
new4.64 KB

There is patch that re-works the create method of CommerceReturnEntityController controller class.
Make the value order optional.

Also make the profile relationship optional for the Return views : it should allow to display also the returns without profiles set.

jkuma’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new5.33 KB

Hello vasike!

Thanks for the catch, indeed the order object has to be optional. I've updated the method documentation accordingly and attached a new patch. Pushing it to dev branch.

  • goldorak committed 76dbbf2 on 7.x-2.x authored by vasike
    Issue #2492715 by vasike, goldorak: Create entity fails using rules -...
jkuma’s picture

Status: Reviewed & tested by the community » Fixed

committed.

Status: Fixed » Closed (fixed)

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