Hello,

If I enable Signup restrictions, I get an error when I try to edit the Signup at Content types:

Fatal error: Call to undefined function _content_type_info() at
sites/all/modules/cck_signup/cck_signup_restrictions/cck_signup_restrictions.admin.inc on line 32

The error is not there when I disable the Signup restrictions.

So, I can't add restrictions now :(

Comments

hopewise’s picture

Status: Active » Needs review

Hello,

I think have fixed this bug, but, I am not sure, as I am very new to Drupal

I have changed the function _cck_signup_restrictions_text_fields at
cck_signup_restrictions.admin.inc to work with D7 like this:

function _cck_signup_restrictions_text_fields($type) {
$options = array();

foreach (field_info_instances('node', $type) as $instance) {
$field = field_info_field_by_id($instance['field_id']);
if (in_array($field['type'], array('text'))) {
$options[$field['field_name']] = $field['widget']['label'];
}
}
return $options;
}

The previous bugged version:

/**
* Get text fields associated with node $type.
*/
function _cck_signup_restrictions_text_fields($type) {
$options = array();
$info = _content_type_info();
$fields = $info['content types'][$type]['fields'];

foreach ($fields as $field) {
if (in_array($field['type'], array('text'))) {
$options[$field['field_name']] = $field['widget']['label'];
}
}
return $options;
}

But, I still can't use the restrictions at Signup module, can some one please point me to a documentation for the restrictions ? I couldn't find it ..

Thanks

jhedstrom’s picture

The signup restriction module hadn't been updated to 7.x when the current release was bundled. It will be part of the next release (or you can grab the version out of CVS).

jhedstrom’s picture

Status: Needs review » Fixed

Alpha3 contains this fix.

Status: Fixed » Closed (fixed)

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

zabelc’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.0-alpha5
Status: Closed (fixed) » Needs work

FYI I also discovered _content_type_info in cck_signup_group_confirmation_form_node_type_form_submit in 7.x-1.0-alpha5.

R_H-L’s picture

Issue summary: View changes

There is a simple fix for this issue. Granted it appears that this project is abandoned, but the following code should work:

function cck_signup_group_confirmation_form_node_type_form_submit($form, &$form_state) {
  if ($form_state['values']['cck_signup_group_confirmation_field']) {
    $type_info = field_info_bundles("node");
    foreach ($type_info as $type_name => $type) {
      if (in_array($form_state['values']['cck_signup_group_confirmation_field'], array_keys($type))) {
        variable_set('cck_signup_group_confirmation_type_' . $type_name, $form_state['values']['cck_signup_group_confirmation_field']);
      }
    }
  }
}