Fresh installation of Drupal 7.9 (December 2nd 2011) with all the latest dependencies for Bean from the project git repos. When I try to uninstall Bean I get the following error:

Call to undefined function bean_get_types() in /
/12022011/sites/all/modules/contrib/bean/bean.install on line 82

Comments

indytechcook’s picture

Priority: Normal » Critical
Issue tags: +Release blocker

Why would you ever want to uninstall bean? :)

Jk. I'll take a look.

Anonymous’s picture

That's a good question. I'm evaluating Blocks, Bean, Boxes, Bricks and Fieldable panels panes. And one task for each contender is to check if they uninstall and clean up behind them. And yes I had/have the same problem with the "Bean::loadUp()". So I had to uninstall.

Thank you!

indytechcook’s picture

Status: Active » Needs review
StatusFileSize
new983 bytes

Try this patch.

For the other error there was issues with the including of classes with ctools. The lastest code in the repo tells ctools to not use it's including but use drupal's autoload.

I'm looking forward to your evaluation. I know these modules solve different issues. Please be sure to share if you do a write up.

Cheers.

Anonymous’s picture

The patch works for me. Thank you.

indytechcook’s picture

Status: Fixed » Closed (fixed)

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

juampynr’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new912 bytes

Uninstalling a module in hook_update_N() crashes since bean.module is still available and the patch at #3 causes the following error:

$ drush updatedb
 somemodule  7010  Uninstalls bean module.
Do you wish to run all pending updates? (y/n): y
PHP Fatal error:  Cannot redeclare bean_entity_info() (previously declared in /.../bean.module:11) in /.../bean.module on line 89

Here is a patch so we first check before loading the file again.

juampynr’s picture

Just realized that require_once() may be even simpler. Anyway, the result is the same.

Status: Needs review » Needs work

The last submitted patch, bean_uninstall-1359472-7.patch, failed testing.

arithmetric’s picture

Version: 7.x-1.0-beta8 » 7.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new686 bytes

I tested the patch from comment 7, but saw the following warning when trying to uninstall the bean module:
ctools: Invalid plugin module/type combination requested: module bean and type types

After disabling the bean module, the bean_get_types() function can't be used even after loading the bean.module file, because the plugin support for beans will not be available.

Instead of using bean_get_types() to determine the potential bundle names, I think the approach should be to use Field API to identify any bundles registered with the bean entity.

See attached patch.

juampynr’s picture

Status: Needs review » Reviewed & tested by the community

Makes total sense to me.

mducharme’s picture

I know this is already rtbc but I wanted to add that a drush uninstall of bean provides some context as well:

drush pm-uninstall bean
WD ctools: Invalid plugin module/type combination requested: module bean and type types 
bean was successfully uninstalled.
jbloomfield’s picture

Priority: Critical » Normal
Status: Reviewed & tested by the community » Needs review

I got an error on the removal of shortcut links as I didn't have the shortcut module enabled, so the function shortcut_default_set() failed.

There needs to be a check as to whether that function exists first.

indytechcook’s picture

Issue tags: -Release blocker

I got an error on the removal of shortcut links as I didn't have the shortcut module enabled, so the function shortcut_default_set() failed.

That was fixed in #1982468: Cleanup menulink/shortcut after uninstall

I committed the other patch. Thanks

https://drupal.org/commitlog/commit/22232/da12b9515f41e751e22835135fc6c5...

indytechcook’s picture

Status: Needs review » Fixed

Sorry, wrong status.

Status: Fixed » Closed (fixed)

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