After running drush up I get fatal error:

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

Comments

trotsak created an issue. See original summary.

m42’s picture

+1, even though it seems to be just "cosmetic" (the module works well after the drush up, no fatal error or whatever).

trotsak’s picture

@hbemtec, in my situation it is not "cosmetic" - site does not work until i replaced module by old version one's.

m42’s picture

Have you tried drush rr ?

trotsak’s picture

no, i dont want make experiments at live site.

m42’s picture

Do it on your local copy.

johnv’s picture

Did you run the page update.php. that's best practise.

trotsak’s picture

I run drush up, drush cc all but the error is remain.

Alan D.’s picture

zhinio’s picture

+1, It completely broke the site. I used drush dl languagefield-7.x-1.4 -y to revert to old version. drush updb -d also creates the same error.

Alan D.’s picture

The cause is this line from http://cgit.drupalcode.org/languagefield/commit/?id=092e5ee

-      'property_callbacks' => array('languagefield_property_info_callback'),

For the countries module I created a wrapper function to use the stale cached function to call the new function.

/**
 * @TODO: Function to keep compatibility with 7.x-2.1 version.
 * @see: #2293209 issue.
 */
function countries_field_info_property_callback(&$info, $entity_type, $field, $instance, $field_type) {
  countries_entity_metadata_field_property_callback($info, $entity_type, $field, $instance, $field_type);
}

In this case, maybe returning an empty array will bypass the fatal error as types switch over from TEXT to TOKEN.

/**
 * Prevents a fatal error in the upgrade from XXXXX to YYYYY.
 *
 * @see https://www.drupal.org/node/1312374
 */
function languagefield_property_info_callback(&$info, $entity_type, $field, $instance, $field_type) {
  return array();
}
Alan D.’s picture

Reason for the need. (other than that the maintainers of Entity API don't care to fix)

Early in the boot, the system goes what whats the props of x?
Entity API gets the cached info, and tries to run languagefield_property_info_callback()

IF it get past this point, the languagefield_field_info() would be called and the reference to languagefield_property_info_callback would be removed and all is happy.

  • johnv committed 2a6ef62 on 7.x-1.x
    Issue #2821791: Fatal error: Call to undefined function...
johnv’s picture

Please test the new dev - version.
Thanks Alan.

zhinio’s picture

Thank you johnv. #13 solved the problem.

roball’s picture

I think releasing the current Language Field dev as 7.x-1.6 would be reasonable now.

Sites still running the 7.x-1.5 version could solve the WSOD by running this SQL query:

TRUNCATE TABLE `cache_field`

johnv’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

BramDriesen’s picture

After half a year still no updated version of the module with this fix...

attiks’s picture

#19 Responding in a closed issues is probably not going to solve it either, best to create a new issue to ask for a new release. Or use the dev version.