summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Zhgenti2012-04-21 12:36:41 (GMT)
committerDmitry Zhgenti2012-04-21 12:36:41 (GMT)
commit66a98bd02499ce0d7236d947011886677d8d4928 (patch)
treea9e36eb8dc1beec956330f0c9bbc3f7c63165c2b
parentf7aa897ea644fd8c9f920ec74a003f0df71b5e29 (diff)
Fix of taxonomy term restore with autoload feature
-rw-r--r--node_autosave.module3
1 files changed, 2 insertions, 1 deletions
diff --git a/node_autosave.module b/node_autosave.module
index 9c823c7..05b5fd6 100644
--- a/node_autosave.module
+++ b/node_autosave.module
@@ -250,8 +250,9 @@ 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.
+ $restore = &drupal_static('node_autosave_form_node_form_alter');
if (isset($form_state['clicked_button']) && $form_state['clicked_button']['#name'] == 'node_autosave_restore_button' ||
- (variable_get('node_autosave_autoload', 0) && !empty($items))) {
+ (variable_get('node_autosave_autoload', 0) && $restore && !empty($items))) {
$tags = array();
foreach ($items as $item) {
$tags[] = isset($item['taxonomy_term']) ? $item['taxonomy_term'] : $item['name'];