After updating 7.x-2.1 up to 7.x-2.1+25-dev I'm started to get following error:

Fatal error: Call to undefined function countries_field_info_property_callback() in /sites/all/modules/contrib/entity/modules/field.info.inc on line 30

How to reproduce:

  $field_type = field_info_field_types('country');
  var_dump($field_type['property_callbacks']); // countries_field_info_property_callback doesn't exist.

If truncate all cache* tables manually - it will solve the problem. However normal flushing cache (or drush cc all) gives fatal error.
I think on hook_update_N you should somehow flush cache.

CommentFileSizeAuthor
#6 countries-2293209-6.patch1.36 KBmrded
#3 countries-2293209-3.patch734 bytesmrded
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mrded’s picture

Issue summary: View changes
mrded’s picture

Issue summary: View changes
mrded’s picture

Status: Active » Needs review
FileSize
734 bytes

drupal_flush_all_caches() solves the problem. Please take a look my patch

mrded’s picture

Title: Call to undefined function countries_field_info_property_callback() after update » Call to undefined function countries_field_info_property_callback() during update
mrded’s picture

Status: Needs review » Needs work

#3 patch doesn't solve the problem.
Why do we need to flush cache during updating? After updating Drupal will flush everything automatically!

mrded’s picture

Title: Call to undefined function countries_field_info_property_callback() during update » Fatal error during update
Status: Needs work » Needs review
FileSize
1.36 KB

I've added old countries_field_info_property_callback() function back which calls new countries_entity_metadata_field_property_callback() to keep compatibility with 7.x-2.1 version.

I've also deleted flushing cache during update, because update.php flushes it anyway.

Alan D.’s picture

mrded’s picture

We use Entity 7.x-1.5.

i18n module doesn't related with issue at all. We don't use i18n module, and still have the problem.
As you can see by patch, problem is because 'property_callbacks' has been renamed.

kenorb’s picture

roball’s picture

Title: Fatal error during update » Fatal error during update from 7.x-2.1 to 7.x-2.2
Priority: Major » Critical

Also encountered the same problem while updating the Countries module from 7.x-2.1 to 7.x-2.2.

The site then became completely inaccessible. TRUNCATE TABLE `cache_field` solved the problem.

Alan D.’s picture

Re-added the function and re-rolled a new release.

https://www.drupal.org/node/2330401

Let me know if this helps! (5 min to publish on drupal.org from now)

"The caching should flush itself"... does not always seem too, so I have left this in.

roball’s picture

Updating from 7.x-2.2 to 7.x-2.3 worked fine for me of course, since I have already managed to solve the problem during the update to 7.x-2.2 manually. So, the new release should fix update issues when updating from 7.x-2.1 to 7.x-2.3.

Thanks for the quick release!

kenorb’s picture

Priority: Critical » Minor
Alan D.’s picture

Priority: Minor » Normal
Status: Needs review » Fixed

workaround to fix the Entity API bug should have solved this with countries 7.x-2.3

https://cgit.drupalcode.org/countries/commit/?id=fff90b6

Status: Fixed » Closed (fixed)

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