On a fairly clean 7.8 installation, when trying to disable this module I get a fatal error:

Fatal error: Class 'ModelTypeUIController' not found in .../sites/all/modules/entity/entity.module on line 893

After receiving this error, I tried disabling the entity api contrib module via drush, which worked. However when I then tried to uninstall the Model module, I get the following:

Fatal error: Call to undefined function entity_exportable_schema_fields() in .../sites/all/modules/model/model.install on line 107

Comments

webankit’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha2
Status: Active » Needs review

http://drupal.org/node/1158084#comment-5155612
Apply this patch, when using Model+entity-dev

bkildow’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev
Status: Needs review » Needs work

This doesn't seem to fix the issue. It looks it is making a call to load the entity_ui_controller and for some reason trying to pass in the model_type, even though it is in the process of being disabled. I wonder if it is somehow stuck in cache (it looks like the code uses the drupal static cache, which I'm not too familiar with yet). The test I did was install a clean drupal 7 site, install Model and all dependencies, then uncheck the module. Here is part of the backtrace when I uncheck:

9	1.0513	29671852	drupal_flush_all_caches( )	../system.admin.inc:1187
10	1.2680	29496192	menu_rebuild( )	../common.inc:7141
11	1.2693	29496732	menu_router_build( )	../menu.inc:2590
12	1.2823	29766624	call_user_func ( 'entity_menu' )	../menu.inc:2621
13	1.2823	29766624	entity_menu( )	../menu.inc:2621
14	1.2823	29766740	entity_ui_controller( $type = ??? )	../entity.module:959
15	1.2824	29768216	entity_ui_controller( $type = 'model_type' )	../entity.module:943

Fatal error: Class 'ModelTypeUIController' not found in .../sites/all/modules/entity/entity.module on line 937

bkildow’s picture

Sorry, the patch did help with the:

Fatal error: Call to undefined function entity_exportable_schema_fields() in .../sites/all/modules/model/model.install on line 107

However, I'm still getting the other error. There seems to be a similar error with the Profile2 module: http://drupal.org/node/1314780. Perhaps an issue with the entity_api?

webankit’s picture

http://drupal.org/node/1122812 (Read this issue)
The entity api has been updated and these modules have not updated.

nerdacus’s picture

I get the same 'UIController class not found' issue when *disabling* my modules. Afterwards, I can re-enable/uninstall/re-install without any noticeable hiccups.

It seems to be a little 'random' at times and that clearing the cache before disabling appears to guarantee that the error will not show.

Also, it happens on random modules (that I have built), not the same one over and over again.

I am using:
Drupal 7.8 (will be updating to 7.9 soon)
Entity API 7.x-1.0-beta11
and few other 'small projects': IMCE, WYSIWYG, etc.

I am not using this project (yet), just stumbled upon this issue via Google, so I believe it is more of an Entity API issue.

Edit: Also the entities are very basic, not exportable, not fieldable. I'm just using them as robust, glorified classes.

Hope this helps,
-Marcus

fago’s picture

dreed47’s picture

I don't believe this issue should be closed. This module needs to have an uninstall hook to clear the static entity cache.

function model_uninstall() {
	entity_info_cache_clear();
}
DrMiaow’s picture

This could be a fluke, and I'm completely new to Entities, but I found that the following resolved my issues

  • Move all the UIController classes out of the .inc and into the .module
  • Add an uninstall hook to .install and make it call menu_rebuild(); (to deal with the content/models option being left behind).

Updated - just adding the call to menu_rebuild() on hook_uninstall() seems to to the trick.