Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
PieterDCI can confirm those errors.
Comment #2
rszrama CreditAttribution: rszrama commentedThis 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.
Comment #3
aidanlis CreditAttribution: aidanlis commentedThis 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.
Comment #4
rszrama CreditAttribution: rszrama commentedWhat 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.
Comment #5
aidanlis CreditAttribution: aidanlis commentedIt 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.
Comment #6
gorillaz.f CreditAttribution: gorillaz.f commentedI 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
Comment #7
rszrama CreditAttribution: rszrama commentedI 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
Comment #8
aidanlis CreditAttribution: aidanlis commented- drush does respect the uninstall order
- I'm only uninstalling a single module here so the uninstall order is not relevant
Comment #9
rszrama CreditAttribution: rszrama commentedOk, 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.
Comment #10
aidanlis CreditAttribution: aidanlis commentedRe: #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 :)
Comment #11
aidanlis CreditAttribution: aidanlis commentedFound a more in-depth discussion of 603798 at #1029606: Regression: Not loading the .module file causes a fatal error when uninstalling some modules (as does loading it)
Comment #12
rszrama CreditAttribution: rszrama commentedDoes that patch fix the issue for you by any chance? A review on that issue would be great.
Comment #13
aidanlis CreditAttribution: aidanlis commentedThe 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.
Comment #14
rfayComment #15
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedSeeing as #1029606: Regression: Not loading the .module file causes a fatal error when uninstalling some modules (as does loading it) is in Drupal core 7.2, I believe this issue can be marked as fixed.