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
Comment #1
GDrupal commentedThanks @rv0 ! I will review this ASAP.
Comment #2
GDrupal commentedFixed!
Comment #4
nicrodgersI 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.
Comment #6
joel_osc commentedCommitted to latest dev, thanks for the patch!