Problem/Motivation
I just installed Workflow 7.x-2.2 on a Drupal 7.12 build. Activated the core API and UI with no problems. Activated the Workflow Field module and instead of displaying a success, the page returned blank. Refreshed (resubmitted) and it took me back to the modules page with the module enabled. Attempted to run update.php and received this error:
Fatal error: Call to undefined function field_info_field_map() in ...../workflow/workflow.module on line 89
Suggestions?
Proposed resolution
The easy way is to add a dependency on D7.22.
But a lot of installations will have an update backlog, so perhaps it is better to call this function conditionally.
API changes
Thisis the change record from D7.22: The Field API's memory usage has been optimized
Comments
Comment #1
preddy commentedShould upgrade Drupal core. @https://drupal.org/node/2115293
Comment #2
hasecbinusr commentedIs it possible to fix without updating the core? Getting the sysadmins and security folks to bless off on new versions takes forever...
Comment #3
preddy commentedI tried with below code and works for me...But this will bypass all drupal cache...
Try this based on your application needs...
function field_info_field_map(){
$query = db_query('SELECT fc.type, fci.field_name, fci.entity_type, fci.bundle FROM {field_config_instance} fci INNER JOIN {field_config} fc ON fc.id = fci.field_id WHERE fc.active = 1 AND fc.storage_active = 1 AND fc.deleted = 0 AND fci.deleted = 0');
foreach ($query as $row) {
$map[$row->field_name]['bundles'][$row->entity_type][] = $row->bundle;
$map[$row->field_name]['type'] = $row->type;
}
return $map;
}
Comment #4
johnvComment #6
johnvAbove commit contains a pretty big fix to make field_info_field_map() conditionally available for installations >= D7.22.
Please report back your findings. Thanks
Comment #7
hasecbinusr commented@johnv, this solved my problem. Thanks!
Comment #8
johnv☺