We just upgraded from 7.x-4.0-beta2 to beta3, and we're receiving a fatal error:

Call to undefined function commerce_reports_reportable_order_states() in /sites/all/modules/commerce_reports/modules/tax/includes/views/commerce_reports_tax.views_default.inc on line 69

I just spent some more time looking at it, I think it happened because we had Tax Reports enabled, but didn't have the Reports module enabled. Partially our fault, but I think Tax Reports needs a dependency on Reports?

Thanks,

Comments

cydharttha created an issue. See original summary.

mglaman’s picture

Version: 7.x-4.0-beta3 » 7.x-4.x-dev
Priority: Normal » Major
Issue tags: +sprint

Marking to major. The tax module never required main module as dependency, and I kind of liked that (I think more people use that than main reports.) Thanks for identifying this.

xurizaemon’s picture

Status: Active » Needs review
StatusFileSize
new701 bytes

Ran into this, here's a patch since I'm waiting for a deploy to complete.

This can bite you if you drush dis commerce_reports and Commerce Tax Reports starts to have baby fatals a lot.

Status: Needs review » Needs work

The last submitted patch, 3: commerce_reports-2582039-3-tax_depends_on_reports.patch, failed testing.

webadpro’s picture

Patch #3, worked for me also.

dsuess’s picture

this update just took down my store. please address!

dylf’s picture

StatusFileSize
new2.28 KB

Not sure if this is the right approach but instead of adding a dependency I added a function that does the same thing in the commerce_reports_tax module.

dylf’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 7: undefined_function_in-2582039-7.patch, failed testing.

dylf’s picture

Status: Needs work » Needs review

Not sure that the failing test is related to this issue.

mglaman’s picture

Retested 5.5

splendidles’s picture

I can report that #3 works, I was able to replicate this one by disabling reports, flushing caches and then viewing the tax report. Provided that the reporter can ensure they did not have commerce_reports at the time, then that looks to be the issue. Patch #3 resolves this. Once commerce_reports is enabled again, the report works and I'm seeing no errors in the logs.

  • mglaman committed c9fa7eb on 7.x-4.x authored by dylanf
    Issue #2582039 by dylanf, xurizaemon, splendidles: Undefined function in...
mglaman’s picture

Status: Needs review » Fixed

Works good enough for me. No idea how to work around it otherwise. People often seem to use the tax submodule more than the normal module anyways.

Status: Fixed » Closed (fixed)

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