Product UI: Fatal error: Call to undefined function commerce_product_types()
Order UI: Fatal error: Call to undefined function commerce_order_new()
Customer UI: Fatal error: Call to undefined function commerce_customer_profile_types()

Comments

PieterDC’s picture

I can confirm those errors.

rszrama’s picture

Status: Active » Postponed (maintainer needs more info)

This isn't enough to know what's going on... are you trying to uninstall the Product module before uninstalling the Product UI module? We already know uninstallation is broken, but I can uninstall Customer UI without generating any errors (for example). I don't even have the option to uninstall Customer prior to Customer UI, and it's the API modules that define those functions you're missing.

aidanlis’s picture

This is easily replicated - fresh install, install all commerce packages, uninstall commerce packages one by one until all you have left is greyed out packages and the three UI packages. These packages can then no longer be removed due to the above errors.

rszrama’s picture

What do you mean one by one? Can you provide a list of modules in order that you're uninstalling? I can't uninstall Product before Product UI, for example, and thus the undefined function would never be missing.

aidanlis’s picture

Status: Postponed (maintainer needs more info) » Active

It sounds like you're assuming that product would be loaded in memory when product_ui is being uninstalled, this isn't the case. Imagine this sequence:

drush pm-disable commerce
drush pm-uninstall commerce_product_ui

This can be done with drush or through the UI, it still happens. Installing commerce_product allows drush pm-uninstall commerce_product_ui to work.

I've confirmed this bug for the latest code in github.

gorillaz.f’s picture

I got a white screen when I tried to uninstall any XX UI sub-module of commerce ( product UI etc)
I'm using alpha5 of commerce and 7.0 core

rszrama’s picture

Status: Active » Postponed (maintainer needs more info)

I still don't understand this issue. I hardly thing it's our job to support users breaking the uninstall order using drush... if the UI prevents a module from being uninstalled (i.e. Product before Product UI), that's good enough for me. If this is purely a drush user issue, I'm happy to close it and trust them not to screw things up on their own sites.

There's also a related (though not exactly duplicate) issue here that is more important: #858722: Cannot reinstall Commerce modules after uninstall due to field deletion failure

aidanlis’s picture

Status: Postponed (maintainer needs more info) » Active

- drush does respect the uninstall order
- I'm only uninstalling a single module here so the uninstall order is not relevant

rszrama’s picture

Ok, it's been confirmed in the other uninstall issue and it appears it might be a core bug. Refer to comment #24 in #858722: Cannot reinstall Commerce modules after uninstall due to field deletion failure. Not sure what we should do about it.

aidanlis’s picture

Re: #603798: When a module is being uninstalled, it's hook_menu() is called, agree it's something that should be resolved in core, however having module dependent code in hook_menu is relatively rare. For the meantime, perhaps in hook_menu (or anywhere that code is run unconditionally) we should do a drupal_load('module') ... there's little to no overhead.

Glad we got there after 3 postponed's :)

aidanlis’s picture

rszrama’s picture

Does that patch fix the issue for you by any chance? A review on that issue would be great.

aidanlis’s picture

The patch indeed fixes the issue as hook_menu is not called. I guess we'll just have to wait for that patch to be committed before we close this issue.

rfay’s picture

Title: Unable to uninstall » Unable to uninstall due to PHP fatals because hook_menu() is called by core when uninstalling
Tor Arne Thune’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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