summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Zhgenti2012-04-21 11:07:36 (GMT)
committerDmitry Zhgenti2012-04-21 11:07:36 (GMT)
commitf7aa897ea644fd8c9f920ec74a003f0df71b5e29 (patch)
treeb2c8f9cd2550a57bd2f186cc4731938c80557b3f
parent8b2547126e5b9ec51dfd3aecb9a25053deae31b0 (diff)
Fix of restoring new terms in the autocomplete field when autoload is turned on.
-rw-r--r--node_autosave.module3
1 files changed, 2 insertions, 1 deletions
diff --git a/node_autosave.module b/node_autosave.module
index 4f451b1..9c823c7 100644
--- a/node_autosave.module
+++ b/node_autosave.module
@@ -250,7 +250,8 @@ function node_autosave_taxonomy_field_widget_form(&$form, &$form_state, $field,
// if the autosave is configured for node type we currently build form for and restore button was clicked,
// then we need to populate #default_value with terms from the autosaved node. In other cases we just use standard
// function.
- if (isset($form_state['clicked_button']) && $form_state['clicked_button']['#name'] == 'node_autosave_restore_button') {
+ if (isset($form_state['clicked_button']) && $form_state['clicked_button']['#name'] == 'node_autosave_restore_button' ||
+ (variable_get('node_autosave_autoload', 0) && !empty($items))) {
$tags = array();
foreach ($items as $item) {
$tags[] = isset($item['taxonomy_term']) ? $item['taxonomy_term'] : $item['name'];