Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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'
);
}
Comment | File | Size | Author |
---|---|---|---|
0001-similarterm-options-were-not-being-saved-due-to-wron.patch | 1.84 KB | sidharth_k |
Comments
Comment #1
mErilainen CreditAttribution: mErilainen commentedThe patch works well
Comment #2
attheshow CreditAttribution: attheshow commentedPatch works for me too.
Comment #3
hvalentim CreditAttribution: hvalentim commentedIt does seem to work. Thanks a lot.
Comment #4
KHofmeyer CreditAttribution: KHofmeyer commentedWorks for me as well.
Comment #5
asb CreditAttribution: asb commentedFour reports that the patch works as advertised. This is ready to commit, so, maintainers, please…
Comment #6
rliThanks, this patch works for me. I think this is a critical issue. Please commit
Comment #7
rliComment #8
thomas.feichter CreditAttribution: thomas.feichter commentedWorks also for me.
Comment #9
philippejadin CreditAttribution: philippejadin commentedWorks 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.
Comment #10
criznach CreditAttribution: criznach commentedRTBC++
Comment #11
philippejadin CreditAttribution: philippejadin commentedrtbc +++ :-)
tested on production with a lot of nodes, perfect outcome.
Comment #12
nevergone CreditAttribution: nevergone commentedrtbc++
Comment #13
thijsvdanker CreditAttribution: thijsvdanker commentedAnother RTBC!
Comment #14
exog3n CreditAttribution: exog3n commentedthank you for the patch!
Comment #15
MO-2 CreditAttribution: MO-2 commentedPatch in original post works great!
Comment #16
doublejosh CreditAttribution: doublejosh commentedWorks for me. +1
Comment #17
13rac1 CreditAttribution: 13rac1 commentedRTBC! Please commit.
Comment #18
VasyOK CreditAttribution: VasyOK commentedPatch work fine in 7.x-2.x-dev version, but it is not work in 7.x-2.3
Comment #19
Plazik CreditAttribution: Plazik commentedWorks for me in 7.x-2.3.
Comment #20
mpa3b CreditAttribution: mpa3b commentedThanks!
Comment #21
asb CreditAttribution: asb commentedPatch applies cleanly:
Also, patch works as advertised. Please commit!
Comment #22
david_garcia CreditAttribution: david_garcia commentedWorks +1
Comment #23
Lukas von BlarerThis patch is marked RTBC since almost two years. Can we get this committed?
Comment #24
rodrigoaguileraThe module is unmantained, someone must take over mantainance
Comment #25
HansKuiters CreditAttribution: HansKuiters commentedPatch works fine.
Comment #26
lazly CreditAttribution: lazly commentedIt's working fine, thanks! :)
Comment #27
takim CreditAttribution: takim commentedPatch has been added in branch.
Comment #28
takim CreditAttribution: takim commented