After updating from 1.3 to 1.5 of entity module (and possibly some new feature exports), we started getting these errors during drush commands:

PHP Fatal error: Call to undefined function entity_crud_get_info() in #########\docroot\sites
\all\modules\contrib\entity\entity.features.inc on line 140

The entity_crud_get_info() function is defined in entity.module, which you'd think would be in scope. Attached is a quick fix to the problem, but I think perhaps there is a better way to fix this, perhaps in the features module. A similar issue exists for entityreference but that occurs in the entityreference.install: #1836106: Fatal error: Call to undefined function entityreference_get_behavior_handlers() in entityreference_schema().

CommentFileSizeAuthor
entity-features-quickfix.patch664 bytesalexkb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RKopacz’s picture

I'm seeing this as well. Any news on a commit to dev for this patch? It seemed as though my features were working fine then I pushed to staging and boom, got the same error.

millaraj’s picture

Seeing a similar issue but it relates to Rules rather than features.

PHP Fatal error: Call to undefined function entity_crud_get_info() in ../entity.rules.inc on line 96

Error happened when upgrading rules from 2.6 to 2.7.

Reverting back to 2.6 fixed the issue.

JulienF’s picture

I also have the same issue.

The error display as follows: Fatal error: Call to undefined function entity_crud_get_info() in xxx/modules/entity/entity.rules.inc on line 96

and it appears only when I install/uninstall modules. Yet refreshing the page displays another error:
Fatal error: Call to undefined function addressfield_token_info_alter() in xxx/includes/module.inc on line 1101

Though flushing cache using drush displays it (the entity_crud_get_info) back again then another refresh makes it disappear.

Any idea on where is this coming from ?

jantoine’s picture

I had a similar issue and it ended up being a problem with file permissions on the server, specifically with a symlinked sites folder.

cYu’s picture

Trying to give the latest dev of https://www.drupal.org/project/configuration a whirl, but end up with this error whenever I try to load up the admin/config/system/configuration page.

jiaxin’s picture

i got the error too when i try to enable my custom module which implements hook entity_info. after tearing my hairs out for several hours, i tracked the culprit to incorrect file permissions . if you copy any custom modules from windows to Linux, the file permissions probably will be set to 700, which means web process won't be able to access any files under that directory. this may cause error of undefined functions.so you have the same issue, it'd be a good idea to check file permissions of new module first

Also, in such case, you won't be able to enable a module from the web interface but you can enable the module using drush, as for most of time the user running drush command is the same user as that do the file copying. this was what exactly happend to me, and hope it can help

SocialNicheGuru’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, entity-features-quickfix.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, entity-features-quickfix.patch, failed testing.

SocialNicheGuru’s picture

I ended up doing this. Will create a patch later but wanted to document it for others

function entity_rules_event_info() {
  $items = array();
//sng
module_load_include('module', 'entity');
marcelovani’s picture

Anonymous’s picture

For me, this was a permissions issue on my server. Not sure how the permissions got changed, but once I set them properly and recursed into subdirectories, the issue resolved. I needed to do this to both my themes and modules folders.

pwaterz’s picture

Status: Needs work » Closed (won't fix)

Upgrading to the latest rules module version fixes this issue.