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

preddy’s picture

Should upgrade Drupal core. @https://drupal.org/node/2115293

hasecbinusr’s picture

Is it possible to fix without updating the core? Getting the sysadmins and security folks to bless off on new versions takes forever...

preddy’s picture

I 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;
}

johnv’s picture

Issue summary: View changes

  • Commit 41f0a6b on 7.x-2.x by johnv:
    Issue #2231903 by johnv: Fixed usage of field_info_field_map() under D7....
johnv’s picture

Title: Undefined function field_info_field_map() » Undefined function field_info_field_map() with Drupal < D7.22
Status: Active » Fixed

Above commit contains a pretty big fix to make field_info_field_map() conditionally available for installations >= D7.22.
Please report back your findings. Thanks

hasecbinusr’s picture

@johnv, this solved my problem. Thanks!

johnv’s picture

☺

Status: Fixed » Closed (fixed)

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