Always end up with WSOD and the following error meassage in log when trying to install the module.
PHP Fatal error: Call to undefined method stdClass::save() in .../sites/all/modules/commerce_email/commerce_email.install on line 12

Version 1 seems to install ok.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

checker’s picture

This happen if commerce checkout module is not ready during installation of commerce email.
I get the same error if i try to install this module as a dependency of another module.

If i install only this module and commerce checkout is already installed i have no problems.

ippy’s picture

Same issue when combined with other modules (dependencies) to be enabled:

The following extensions will be enabled: commerce_invoice_email, htmlmail, variable_email, commerce_email
Do you really want to continue? (y/n): y
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to undefined method stdClass::save() in
/var/www/vhosts/******************/httpdocs_**/sites/all/modules/commerce_email/commerce_email.install,line 12

Line 12 is the last line of this function:
function commerce_email_enable() {

 // Make sure the rules created by commerce have been taken into account
  drupal_flush_all_caches();
  // Deactivate default commerce rules to send order email
  $rules_config = rules_config_load('commerce_checkout_order_email');
  $rules_config->active = FALSE;
  <strong>$rules_config->save();</strong>

However, visiting the module page, enabling and saving and then there is no error. Sounds suspiciously similar to this historic issue: https://drupal.org/node/1651034 ?

No time to dig just now (entity/empty or rule naming issue?), but may have a chance to investigate further at some point - and certainly happy to test any patches etc. I can see that this module is not being heavily maintained (and looking for co-maintainer), so expect to DIY :)

generalconsensus’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
2.03 KB

I've created a basic patch which validates the rules before it tries to set it inactive on enable or disable. Please review

seemas’s picture

Previous patch failed to apply so providing new one for 2.x-dev version.

tijsdeboeck’s picture

Patch #4 works perfectly!

nicjasno’s picture

Patch #4 also worked for me. Thanks a lot!

bluecobalt’s picture

Patch #4 works. Thanks!

vood002’s picture

#4 worked for me as well, thank you!

rszrama’s picture

Priority: Major » Normal

Reviewing now.

rszrama’s picture

Status: Needs review » Fixed

Had to use patch but got it to apply. Normally would use a !empty() check on a string, but oh well ... committing as is.

  • rszrama committed a49538d on 7.x-2.x authored by seemas
    Issue #2019773 by generalconsensus, seemas, rszrama: Unable to install
    

Status: Fixed » Closed (fixed)

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