Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
patched locale so it plays nice with field_permissions (drupal)
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index e0981b2..6877d8f 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -406,7 +406,7 @@ function locale_field_node_form_submit($form, &$form_state) {
// Handle a possible language change: new language values are inserted,
// previous ones are deleted.
- if ($field['translatable'] && $previous_language != $node->language) {
+ if ($field['translatable'] && $previous_language != $node->language && isset($form_state['values'][$field_name])) {
$form_state['values'][$field_name][$node->language] = $node->{$field_name}[$previous_language];
$form_state['values'][$field_name][$previous_language] = array();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment