The first time I try to execute fieldtool_get() on a nodereference or userreference field, it works fine. Afterwards I invariably get:

Fatal error: Uncaught exception 'Exception' with message 'CCK extraction function could not be found.' in /var/www/drupal-6.14/sites/my.site.com/modules/fieldtool/plugins/fieldtool/node_cck.inc:93 Stack trace: #0 /var/www/drupal-6.14/sites/my.site.com/modules/fieldtool/fieldtool.module(256): fieldtool_node_cck_field_get(Object(stdClass), 'field_administr...', Array) #1 /var/www/drupal-6.14/sites/all/modules/devel/devel.module(1058) : eval()'d code(4): fieldtool_get(Array, Object(stdClass)) #2 /var/www/drupal-6.14/sites/all/modules/devel/devel.module(1058): eval() #3 /var/www/drupal-6.14/includes/form.inc(769): devel_execute_form_submit(Array, Array) #4 /var/www/drupal-6.14/includes/form.inc(409): form_execute_handlers('submit', Array, Array) #5 /var/www/drupal-6.14/includes/form.inc(119): drupal_process_form('devel_execute_f...', Array, Array) #6 [internal function]: drupal_get_form('devel_execute_f...') #7 /var/www/drupal-6.14/includes/menu.inc(348): call_user_func_arra in /var/www/drupal-6.14/sites/my.site.com/modules/fieldtool/plugins/fieldtool/node_cck.inc on line 93

... until I flush the fieldtool:fields cache.

Examining the cached field info with dsm() reports that before caching, 'cck extraction callback' looks like this

cck extraction callback (String, 41 characters ) fieldtool_cck_userreference_value_extract | (Callback) fieldtool_cck_userreference_value_extract();

... but when cached looks like this:

cck extraction callback (String, 41 characters ) fieldtool_cck_userreference_value_extract

Same story with 'cck itemization callback', 'transformations slot property callback', 'getter callback', 'first value getter callback', 'setter callback', and 'single value setter callback'.

Comments

jpetso’s picture

That sounds to me like the respective functions are not included before Field Tool tries to invoke them. Would need to have a look why this is the case.

Matthew Davidson’s picture

Status: Active » Fixed
StatusFileSize
new638 bytes

Looks like you just need to ctools_get_plugins() before the cached plugin data is retrieved. Committed.

Status: Fixed » Closed (fixed)

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