It seems like there is not default word or index or something. Any ideas on what this is saying and how to fix these errors? Thanks!

• Notice: Undefined index: opencalais_anniversary_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_calaisdocumentc_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_city_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_company_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_continent_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_country_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_currency_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_emailaddress_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_entertainmentaw_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_eventsfacts_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_facility_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_faxnumber_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_holiday_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_industryterm_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_marketindex_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_medicalconditio_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_medicaltreatmen_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_movie_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_musicalbum_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_musicgroup_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_naturalfeature_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_operatingsystem_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_organization_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_person_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_phonenumber_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_position_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_product_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_programminglang_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_provinceorstate_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_publishedmedium_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_radioprogram_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_radiostation_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_region_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_socialtags_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_sportsevent_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_sportsgame_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_sportsleague_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_tvshow_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_tvstation_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_technology_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).
• Notice: Undefined index: opencalais_url_tags in locale_field_entity_form_submit() (line 438 of /REPLACED/REPLACED/REPLACED/modules/locale/locale.module).

CommentFileSizeAuthor
#5 opencalais-1986910-5.patch435 bytesxcf33
#2 opencalais-1986910-2.patch448 bytesxcf33
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xcf33’s picture

Assigned: Unassigned » xcf33
Priority: Major » Normal

This is confirmed when locale module is enabled.

xcf33’s picture

Status: Active » Needs review
FileSize
448 bytes

Attached is a simple fix I looked at.

The problem occurs because in locale.module

function locale_field_entity_form_submit($entity_type, $form, &$form_state ) {
  if (field_has_translation_handler($entity_type, 'locale')) {
    $entity = (object) $form_state['values'];
    $current_language = entity_language($entity_type, $entity);
    list(, , $bundle) = entity_extract_ids($entity_type, $entity);
    foreach (field_info_instances($entity_type, $bundle) as $instance) {
      $field_name = $instance['field_name'];
      $field = field_info_field($field_name);
      $previous_language = $form[$field_name]['#language'];

      // Handle a possible language change: new language values are inserted,
      // previous ones are deleted.
      if ($field['translatable'] && $previous_language != $current_language) {
        $form_state['values'][$field_name][$current_language] = $entity->{$field_name}[$previous_language];
        $form_state['values'][$field_name][$previous_language] = array();
      }
    }
  }
}

The submission function looks for $form[$field_name]['#language'] but all the opencalais field has been placed in a vertical tab under $form['opencalais'];

Fabianx’s picture

The right patch is to use an #after_build function to move things to the field set like how it is done in field_group.

xcf33’s picture

after_build is a valid approach except that moving this block to an afterbuild function results in the fieldset detached from the vertical tab, I believe it is because the #group attribute is not taken into consideration in after bulid function because vertical tab rendering has already taken place.

  // Should we collect them in vertical tabs?
  if (variable_get('opencalais_tags_in_verticaltab', TRUE)) {
    $form['opencalais']  = array(
      '#type' => 'fieldset',
      '#title' => t('OpenCalais tags'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE, 
      '#group' => 'additional_settings',
      '#weight' => -2,
    );
    $form['opencalais']['suggest_tags'] = $form['actions']['suggest_tags'];
    unset($form['actions']['suggest_tags']);
        
    foreach ($fields as $field_name) {
      $form['opencalais'][$field_name] = $form[$field_name];
      unset($form[$field_name]);
    }
  }

The culprit is still the unset($form[$field_name]), I propose we simply use hide($form[$field_name]);

xcf33’s picture

FileSize
435 bytes
cweagans’s picture

Status: Needs review » Reviewed & tested by the community

This looks good.

xcf33’s picture

Status: Reviewed & tested by the community » Closed (fixed)
SocialNicheGuru’s picture

has this been committed? isn't that when you select "close (fixed)"?