any time i try to add a weburl field to a custom CCK type, i see this when trying to save:

warning: Invalid argument supplied for foreach() in /Users/wright/drupal/cvs/head/contributions/modules/cck/content.module on line 825.
warning: Invalid argument supplied for foreach() in /Users/wright/drupal/cvs/head/contributions/modules/cck/content.module on line 829.

this is a fresh 4.7 test site with core and CCK updated from CVS as of the time of this posting.

unfortunately, there's no "weburl.module" component in the cck project, so i'm putting this under "content.module" (since that's what's generating the actual error). i've tried creating every other kind of field and weburl is the only one where i see these errors.

the problem is that weburl.module is not implementing either:

weburl_field_settings()
weburl_widget_settings()

the errors are coming from these two foreach loops:

function _content_admin_field_submit($form_id, $form_values) {
  // ...
  $widget_settings = array();
  foreach (module_invoke($widget_type['module'], 'widget_settings', 'save', $field) as $setting) {
    $widget_settings[$setting] = $form_values[$setting];
  }
  $field_settings = array();
  foreach (module_invoke($field_type['module'], 'field_settings', 'save', $field) as $setting) {
    $field_settings[$setting] = $form_values[$setting];
  }
  // ...
}

this is the first hour i've been looking at CCK source, so i haven't had a chance to grok what these functions are supposed to do. as soon as i get the chance, i'll roll a patch to add weburl-specific versions (unless someone more CCK-clueful beats me to it).

thanks,
-derek

Comments

JonBob’s picture

Status: Active » Fixed

These hooks are no longer required.

Anonymous’s picture

Status: Fixed » Closed (fixed)