From 9b73c4de633ea0359c27255ffbe78d97908f684e Mon Sep 17 00:00:00 2001 From: Jorrit Schippers Date: Wed, 26 Apr 2017 13:54:50 +0200 Subject: [PATCH] Fix cloning after changing the form with ajax --- includes/message.admin.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/message.admin.inc b/includes/message.admin.inc index c7ae1d0..d654af2 100644 --- a/includes/message.admin.inc +++ b/includes/message.admin.inc @@ -199,7 +199,9 @@ function message_admin_text_copy_validate($form, $form_state) { * Generates the message type editing form. */ function message_type_form($form, &$form_state, $message_type, $op = 'edit') { - if ($op == 'clone') { + // Use isset($form_state['original_message_type']) because this function is called + // again by AJAX callbacks. + if ($op == 'clone' && !isset($form_state['original_message_type'])) { $message_type->description .= ' (cloned)'; // Save the original message type into form state so that the submit // handler can clone its field instances.