When creating a node of a webform enabled type,
and deleting it, you get this error.

Undefined index: nid in webform_localization_delete_translate_strings

Easy fix, change:

/**
 * Implements hook_node_delete().
 */
function webform_localization_node_delete($node) {
  if (!in_array($node->type, webform_variable_get('webform_node_types'))) {
    return;
  }

  module_load_include('inc', 'webform_localization', 'includes/webform_localization.i18n');
  // Deletion of webform and emails translatable properties.
  webform_localization_delete_translate_strings($node);
  // Delete webform localization configuration record.
  db_delete('webform_localization')->condition('nid', $node->nid)->execute();
}
/**
 * Implements hook_node_delete().
 */
function webform_localization_node_delete($node) {
  if (!in_array($node->type, webform_variable_get('webform_node_types'))
    || empty($node->webform['components'])) {
    return;
  }

  module_load_include('inc', 'webform_localization', 'includes/webform_localization.i18n');
  // Deletion of webform and emails translatable properties.
  webform_localization_delete_translate_strings($node);
  // Delete webform localization configuration record.
  db_delete('webform_localization')->condition('nid', $node->nid)->execute();
}

(added empty($node->webform['components']) )

Comments

GDrupal’s picture

Thanks @rv0 ! I will review this ASAP.

GDrupal’s picture

Status: Needs review » Fixed

Fixed!

Status: Fixed » Closed (fixed)

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

nicrodgers’s picture

Version: » 7.x-4.x-dev
Status: Closed (fixed) » Needs review
StatusFileSize
new666 bytes

I experience this error too, running the latest dev version. I don't think this fix ever got committed, as the solution from rv0 doesn't appear to be in webform_localization.module.

Please find attached patch.

  • nicrodgers authored 607f32e on 7.x-4.x
    Issue #1494210 by nicrodgers: Undefined index: nid in...
joel_osc’s picture

Status: Needs review » Closed (fixed)

Committed to latest dev, thanks for the patch!