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.
Just installed the rc7, and have an exposed filter which should allow multiple choices for the filter. So, in the hierarchical settings for the filter, I have:
Dropbox settings
[checked on] Enable the dropbox
Title: [no title specified... this is blank]
Limit the number of selections: [default value of zero]
Reset selection of hierarchical select:
Disabled
[set] Enabled
Nonetheless, there is no "Add" button as there was in previous incarnations to add multiple items to the filter. What am I doing wrong?
Comment | File | Size | Author |
---|---|---|---|
#24 | hierarchical_select_fix_plus_gmix_tweak.patch | 3.75 KB | mlncn |
Comments
Comment #1
Wim LeersCould you please save the HS config again? Then the view's config will be updated as well. The way this works has been changed: it's much more reliable in RC7 than in previous releases, because it directly alters the DB instead of asking the user to submit the views form.
If that doesn't work, you've probably found a bug in the direct DB manipulation process.
EDIT: I just tested this on my test site and here it does work. So if this doesn't work for you, you should also give me FTP + Drupal admin access. I sincerely hope it does work for you.
Comment #2
sdsheridanJust so I'm clear, which HS config am i saving again? There's the one for the taxonomy, the once for the CCK Content Taxonomy field in the node-type itself, and the one in the view. Or am I doing all three? If so, does the order matter?
shawn
Comment #3
Wim LeersOnly the one or ones (you could have multiple HS-powered exposed filters) for the view matter. And no, the order doesn't matter.
Comment #4
sdsheridanOK, tried re-saving, and no joy. No add button. I'll send you a log-in and URL info via your contact form.
Comment #5
Wim LeersUgh :(
Ok.
Comment #6
sdsheridanAny progress, Wim?
Comment #7
Wim LeersI've been studying for my macroeconomics exam of tomorrow, so I haven't had the time. I will look at your site tomorrow or the day after that.
Comment #8
sdsheridanGreat! and good luck with the exam. :-)
shawn
Comment #9
sdsheridanDid a little investigating, and found something interesting:
content-taxonomy-views-userNodeInfo-field_profiledetails_location
, which corresponds to the row with namehs_config_content-taxonomy-views-userNodeInfo-field_profiledetails_location
in the variables table. The row is there, and the values correspond to the form. So the configuration form seems to be working as it should.content-taxonomy-views-userNodeInfo-4
. No row in the variables table starting with "hs_config_" matches this value.content-taxonomy-views-userlist-4
. "userlist" is the name of the main view.Hope this helps...
@wim: my debug "drupal_set_message" calls are still in the hs.module file on my site. That's how I investigated this.
shawn
Comment #10
Wim LeersInteresting. This probably means that the cause is Views Fusion, which would make sense, since you're the only one with this problem.
I'll see if I can make the code that builds the config_id more robust so that it can still work in a Views Fusion environment.
Thanks sdsheridan. This really saves me a lot of time :) I know exactly where to look now. Will be solved tomorrow night.
Comment #11
sdsheridanNo worries. Note that in point #2 above, that particular view is the non-fused one. It's just the view of #1 but in view-mode, not edit/config-HS mode. It still has the wrong value for the config_id, with a '4' instead of 'field_profiledetails_location'.
shawn
Comment #12
sdsheridanOK, found (and think have the fix) for one defect. In
function hs_content_taxonomy_views_form_alter
within the hs_content_taxonomy_views.module file, line 84 reads:and should read (i think)
with
$field_name
instead of$vid
.That gets rid of the problem in point 2 in #9 above, and also the correct field name is showing up for point 3 with this change, even though the view-name part within the $config_id variable is still not matching. So, for the point 2 view, the add button now shows up, as it should.
Point 3 is I believe, and as you suspect, Wim, because of Views Fusion.
Just thought I'd post this further bit of my investigation.
shawn
Comment #13
sdsheridanOK, so for problem 3 of #9 above, what about leveraging a function like:
and then using this when determining the view name? for example, for line 84 in
function hs_content_taxonomy_views_form_alter
within the hs_content_taxonomy_views.module:Comment #14
sdsheridanOK, slightly revised function that is a bit more efficient, and only returns the view name, instead of an entire view object, as that is all that is needed.
which would make the call then look like:
Question: I had to prepend the field name with "content_", double-up the field name, and append "_value" for this to work; will this construction always be the case?
This makes the add button appear as it should now in both the underlying view and the fused view.
Hope this helps. How do we make it "standard" in HS?
shawn
Comment #15
sdsheridan...and now that I got this far, with the "Add" button appearing so i can choose multiple options, it seems as if the filter is "ANDing" all the values, which of course means I get no results, as a node has only one content_taxonomy lineage in the taxonomy, and thus wouldn't have the two or three showing in the filter. In other words, seems the filter is looking for "is all of" as opposed to "is one of".
Also getting double "Remove" labels... one an actual link, the other a checkbox, after the submit of the view comes back.
shawn
Comment #16
sdsheridanOK, ignore the "ANDing" problem... that was my own fault in how I set up the view. It's fine.
However, the double "Remove" labels are still there.
Comment #17
sdsheridanHad to make a couple more changes to get this to work.
First, the construction "content_$field_name.$field_name".'_value' for the call to get_defining_view_for_filter( $view, "content_$field_name.$field_name".'_value' ) will not always work. It doesn't work when the field is stored in the content_type table. This happens when full lineage is not being stored, and multiple values for the taxonomy are not allowed for the node. However,
$filterViewName = get_defining_view_for_filter( $view, $filter['field'] );
will work for both situations.Secondly, again for the same circumstance where the field is actually stored in the content_type table, the function _hs_content_taxonomy_views_parse_fieldname_from_id needed a second test to pick up the case where $id was of the form "content_type_contenttypename.field_fieldname_value".
With these changes, I now have HS Content Taxonomy working with the Content Taxonomy field on my nodes for location, and in the views filters permitting searches, in both the cases where (a) the full lineage is stored in a table specific to that field, and (b) when only the deepest term is stored in the content_type table, for both a regular view and a views_fusion view.
@Wim: Does this all look "correct" from your perspective? Also, do you feel it should be folded into HS?
shawn
Comment #18
plan9 CreditAttribution: plan9 commentedHi Shawn
Which files should your changes be added to?
Comment #19
sdsheridanI think I indicated in the various posts which modules / files I was changing, did I not?
shawn
Comment #20
plan9 CreditAttribution: plan9 commentedThanks for all your help Shawn
Comment #21
sdsheridanNo problem. Was a fair bit of detective work to figure this much out.
On a slightly different note, is it just me, or is Wim missing in action?
Comment #22
Wim LeersYes, I've been very, very absent since September. The reason? University. Sorry about that, but there's only so much time one person has…
I've committed your change for #2. Your proposed changes for #3 look reasonable and logical, but could you please roll them in a single patch so that I've got a better overview. These things are quite hairy :P
http://drupal.org/cvs?commit=180082
Comment #23
Wim LeersCleaning up the issue queue. Due to lack of response, I'm closing this issue. Feel free to reopen though! :)
Comment #24
mlncn CreditAttribution: mlncn commentedAs there has been no stable release yet, here is the fixes for list item 2 issues (non-fusion) in patch form. It also disables the non-javascript fallback, which wasn't working for me and displayed briefly on the page, and changes the "Submit" button to "Go"
This isn't to be committed, but i have it, if some other poor fellow is using Drupal 5 this may help them.
benjamin, agaric