The similar by term views integration filters has some options. E.g. you can limit the vocabularies with which matches are made.

Currently, if you select a vocabulary in the filter and save the filter, the option is not saved. This is due to some errors in the way the options form is created.

This is the fix. A patch file is attached to this ticket also.

diff --git a/views/similarterms_handler_argument_node_nid.inc b/views/similarterms_handler_argument_node_nid.inc
index 2c1da8f..d525369 100755
--- a/views/similarterms_handler_argument_node_nid.inc
+++ b/views/similarterms_handler_argument_node_nid.inc
@@ -51,19 +51,21 @@ class similarterms_handler_argument_node_nid extends views_handler_argument_nume
       '#title' => t('Similarity by Terms'),
       '#collapsible' => FALSE,
     );
-    $form['similarterms']['vocabularies'] = array(
+    $form['vocabularies'] = array(
       '#type' => 'checkboxes',
       '#title' => t('Limit similarity to terms within these vocabularies'),
       '#description' => t('Choosing any vocabularies here will limit the terms used to calculate similarity. It is usually best NOT to limit the terms, but in some cases this is necessary. Leave all checkboxes unselected to not limit terms.'),
       '#options' => $vocabularies,
       '#default_value' => empty($this->options['vocabularies']) ? array() : $this->options['vocabularies'],
+      '#fieldset' => 'similarterms'
     );
 
-    $form['similarterms']['include_args'] = array(
+    $form['include_args'] = array(
       '#type' => 'checkbox',
       '#title' => t('Include argument node(s) in results'),
       '#description' => t('If selected, the node(s) passed as the argument will be included in the view results.'),
       '#default_value' => !empty($this->options['include_args']),
+      '#fieldset' => 'similarterms'
     );
 
   }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mErilainen’s picture

Status: Active » Reviewed & tested by the community

The patch works well

attheshow’s picture

Patch works for me too.

hvalentim’s picture

It does seem to work. Thanks a lot.

KHofmeyer’s picture

Works for me as well.

asb’s picture

Priority: Normal » Major

Four reports that the patch works as advertised. This is ready to commit, so, maintainers, please…

rli’s picture

Thanks, this patch works for me. I think this is a critical issue. Please commit

rli’s picture

Priority: Major » Critical
thomas.feichter’s picture

Works also for me.

philippejadin’s picture

Works for me as well.

Would be really great to commit the patch to latest release. Because when you have a lot of taxonomies, if you cannot choose (save) which one is used for the comparison, the quality of the similarity often end up being very low.

criznach’s picture

RTBC++

philippejadin’s picture

rtbc +++ :-)

tested on production with a lot of nodes, perfect outcome.

nevergone’s picture

rtbc++

thijsvdanker’s picture

Another RTBC!

exog3n’s picture

thank you for the patch!

MO-2’s picture

Patch in original post works great!

doublejosh’s picture

Works for me. +1

13rac1’s picture

RTBC! Please commit.

VasyOK’s picture

Patch work fine in 7.x-2.x-dev version, but it is not work in 7.x-2.3

Plazik’s picture

Works for me in 7.x-2.3.

mpa3b’s picture

Thanks!

asb’s picture

Patch applies cleanly:

patch -p1 < 0001-similarterm-options-were-not-being-saved-due-to-wron.patch 
patching file views/similarterms_handler_argument_node_nid.inc

Also, patch works as advertised. Please commit!

david_garcia’s picture

Works +1

Lukas von Blarer’s picture

This patch is marked RTBC since almost two years. Can we get this committed?

rodrigoaguilera’s picture

The module is unmantained, someone must take over mantainance

HansKuiters’s picture

Patch works fine.

lazly’s picture

It's working fine, thanks! :)

takim’s picture

Status: Reviewed & tested by the community » Fixed

Patch has been added in branch.

takim’s picture

Status: Fixed » Closed (fixed)