I was trying out commerce_invoice today and when enabling the modules, I got a PHP fatal error:
Fatal error: Call to undefined method stdClass::save() in /Users/username/Sites/commerce/sites/all/modules/commerce_invoice/modules/email/commerce_invoice_email.module on line 14

Comments

c-logemann’s picture

Does the commerce_invoice.module works without the submodule commerce_invoice_email.module?

stewart.adam’s picture

I'm still testing it to see how/if it works, but commerce_invoice did enable successfully, yes.

stewart.adam’s picture

I have enabled commerce_invoice a few times since but I enabled commerce_email first and then it works OK.

quiptime’s picture

Same error I checked the modules Invoice, Invoice Email and Invoice UI and hit the Save configuration button.

I'm going back and resave the module enable action without error.

c-logemann’s picture

Assigned: Unassigned » c-logemann
Status: Active » Fixed

I try to reproduce this error. On one test system I got a similar error with the commerce_email module.
In both cases there is a hook_enable() involved and this should be in install file: See also #1596122: commerce_email_enable() and commerce_email_disable() have to be moved to commerce_email.install
This should be fixed this with this commit: http://drupalcode.org/project/commerce_invoice.git/commit/d7c9064

Status: Fixed » Closed (fixed)

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

UrmasZ’s picture

I tried latest dev and enabling Invoice Email module gave me mentioned error. I used back-button and showed me that this module is enabled. I have not tested is it working or not.
But now can't disable it. Gives me this error:
Warning: Creating default object from empty value in commerce_invoice_email_disable() (line 20 of somePath.eu/demo/sites/all/modules/commerce_invoice/modules/email/commerce_invoice_email.install).
Then I downloaded latest version from git and still same error.

I use latest rules dev too.

Edit:
Deleted database and installed Commerce Kickstart again and first thing I enabled wast Invoice. No problem. Then enabled Invoice UI, no problem. And then Invoice Email and no problem.
Before I enabled bunch of other modules first and finally Invoice, Invoice Email and Invoice UI together and got this error.