There was an error in the drupal 7, issued a module Table Field
Warning: Invalid argument supplied for foreach () in the tablefield_field_formatter_view () function (line 455 in the file X: \ home \ tt.du \ www \ sites \ all \ modules \ tablefield \ tablefield.module).
/** * Implements hook_field_formatter_view(). */ function tablefield_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) { $element = array(); $settings = $display['settings']; $formatter = $display['type']; foreach ($items as $delta => $table) { // Check for table caption. $raw = unserialize($table['value']); $caption = isset($raw['caption'])? check_plain($raw['caption']): ''; // Rationalize the stored data. if (!empty($table['tabledata'])) { $tabledata = $table['tabledata']; } elseif (!empty($table['value'])) { $tabledata = tablefield_rationalize_table(unserialize($table['value'])); } // Run the table through input filters. if (isset($tabledata)) { if (!empty($tabledata)) { if (!empty($settings['trim_trailing_rows'])) { $tabledata = tablefield_rtrim_rows($tabledata); } if (!empty($settings['trim_trailing_cols'])) { $tabledata = tablefield_rtrim_cols($tabledata); } foreach ($tabledata as $row_key => $row) { foreach ($row as $col_key => $cell) { if (!empty($table['format'])) { $tabledata[$row_key][$col_key] = array( 'data' => check_markup($cell, $table['format']), 'class' => array('row_' . $row_key, 'col_' . $col_key), ); } else { $tabledata[$row_key][$col_key] = array( 'data' => check_plain($cell), 'class' => array('row_' . $row_key, 'col_' . $col_key), ); } } } } // Check for an empty header, if so we don't want to theme it. $noheader = TRUE; if (empty($field['settings']['hide_headers'])) { $header_data = array_shift($tabledata); foreach ($header_data as $cell) { if (strlen($cell['data']) > 0) { $noheader = FALSE; break; } } } $header = $noheader ? NULL : $header_data; $entity_info = entity_get_info($entity_type); $entity_id = !empty($entity_info['entity keys']['id']) ? $entity->{$entity_info['entity keys']['id']} : NULL; // Theme the table for display. $element[$delta] = array( '#theme' => 'tablefield_view', '#attributes' => array( 'id' => 'tablefield-' . $delta, 'class' => array('tablefield'), ), '#caption' => $caption, '#header' => $header, '#rows' => $tabledata, '#delta' => $delta, '#export' => isset($field['settings']['export']) ? $field['settings']['export'] : NULL, '#entity_type' => $entity_type, '#entity_id' => $entity_id, '#field_name' => $field['field_name'], '#langcode' => $langcode, '#formatter' => $formatter, ); } } return $element; } Error occurs on
foreach ($header_data as $cell) { Who can tell where to dig
Drupal module 7 Table Field