Fatal error: Call to undefined function: _content_fields() in /home/ber/Documents/FLX_flexinode/63240/modules/cck/content_admin.inc on line 704

bumps in when editing/saving a field

Using HEAD. I am not sure if its just me, because I am developing new features for CCK. Though I cannot find anything odd in the CVS diffs that might be the case.

I will either send in a patch later, or else close the issue if it really is just me :)

Comments

Bèr Kessels’s picture

Status: Active » Fixed

seems a cvs up fixed it.

robert.redl@easytouch.cc’s picture

someone threw it out from CCK 4.7up to CVS.
I also use somepatches that need _content_fields.

In the meantime, add the following function to the end of
modules/cck/content.module

/**
* Return a list of all fields.
*
* @param $reset
*  If TRUE, clear the cache and fetch the information from the database again.
*/
function _content_fields($reset = FALSE) {
  static $fields;

  if ($reset || !isset($fields)) {
    $fields = array();
    $field_result = db_query('SELECT * FROM {node_field} nf');
    while ($field = db_fetch_array($field_result)) {
      $global_settings = $field['global_settings'] ? unserialize($field['global_settings']) : array();
      unset($field['global_settings']);
      $field = array_merge($field, $global_settings);
      $instance_info = db_fetch_array(db_query("SELECT type_name, label FROM {node_field_instance} WHERE field_name = '%s'", $field['field_name']));
      $field['widget']['label'] = $instance_info['label'];
      $field['type_name'] = $instance_info['type_name'];
      $fields[$field['field_name']] = $field;
    }
  }

  return $fields;
}
karens’s picture

The function _content_fields was renamed content_fields in cvs, so 4.7 version of the content module uses _content_fields and the cvs version uses content_fields. Most of the patches flying around are still using _content_fields. The better patch would be to change cvs modules and patches to use the new function name.

Anonymous’s picture

Status: Fixed » Closed (fixed)