Fields cannot be added to a survey because the 'add field' link is missing. Without these, it is not possible for non-technical savvy users to add fields.

Easy fix:
In the survey.module file change the survey_fields function to look as follows:

/**
 * Show the fields for a survey
 */
function survey_fields() {
  $nid = arg(1);
  $node = node_load(array('nid' => $nid));

  foreach ($node->form->fields as $field) {
    $rows[] = array(array('data' => $field->title),
                    array('data' => $field->type),
                    array('data' => l(t('edit'), 'node/'.$nid.'/form/edit/'.$field->ffid)),
                    array('data' => l(t('delete'), 'node/'.$nid.'/form/delete/'.$field->ffid)));
  }
  if ($rows) {
    $output = theme('table', array(t('field'), t('type'), ' ', ' '), $rows);
  }
  else {
    $output = t('No fields defined');
                
  }
  $output .=  '<br />' . l(t('add field'), 'node/'.$nid.'/form/edit'); // added only this line
  return $output;
}

Comments

quicksketch’s picture

Status: Active » Closed (fixed)

Survey module is no longer being maintained, use Webform module instead.

---Closing down issue queue of survey module---