Title says it all. Can inherit most of its implementation from Taxonomy, which is already ported. (Much like HS for Taxonomy Views for D5 inherits most of its implementation.)

Any volunteers?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

internets’s picture

FileSize
6.18 KB

I don't know if this will be useful or not. I really want to get this module working with drupal 6 views 2.

I updated the module with deadwood and checked the code with the coder module, there are no errors.
I can enable the module (though it still obviously won't work). There are errors on the HS configuration pages. (admin/settings/hierarchical_select/configs)

The first error was about views_load_cache(); I've been trying to find out if this code is deprecated or what. I tried views_load_view(); in place of views_load_cache(); but still got the error.
I commented out views_load_cache(); Then the config page loaded and I was getting errors about

warning: Invalid argument supplied for foreach() in /home/example/public_html/sites/all/modules/hierarchical_select/modules/hs_taxonomy_views.module on line 478.

I'm trying to find out what changes need to be made so the module works with views 2.

Is there any resources related to updating a views1 module to work with views2?

This not yet working so maybe it's not the right approach.

These files should be unzipped into

hierarchical_select/modules

mikey_p’s picture

This will probably require a good bit of change to adapt to the Views 2 API. I'm wondering if this would work better as a views filter handler. I'll try to ask merlinofchaos about it, and post back here.

Mark Theunissen’s picture

Subscribing! ;)

mikey_p’s picture

I've talked to merlinofchaos about this, and he suggested that this would probably work best as a filter handler of some sort.

merlinofchaos: You may be best off creating a new filter
mikey_p: extending views_handler_filter_term_node_tid ?
merlinofchaos: That'd give you more control.
merlinofchaos: I'm not sure if you'd extend or just make your own; whichever works best.

I'm gonna try to look more at how this was handled in D5 before I figure out when filter type to extend or whether or not to write one from scratch. (I'd prefer to extend for obvious reasons).

CKIDOW’s picture

hi... how is the actual status? :) Can't wait for this great port.

netbear’s picture

subscribe

mikey_p’s picture

Wim, I would love to work on this but I haven't the time at the moment (surely you know how that feels). I did talk to merlinofchaos about this briefly, and his thought was that instead of form_altering the existing taxonomy filter handler, that it would probably be easier and cleaner code wise to write a new filter handler in the style of the existing taxonomy filter, (maybe even extending the taxonomy filter (go views OOP!)).

In some ways this isn't as clean as would be desired, the user would have choose the HS Taxonomy filter, instead of just Taxonomy filter when in fact this is just a display formatter for the existing functionality of the taxonomy filter. However I think the benefits of having your own filter handler vastly outweigh the advantages of keeping the interface semantics simpler for the end user.

Wim Leers’s picture

Assigned: Unassigned » Wim Leers
Priority: Normal » Critical
Status: Active » Postponed (maintainer needs more info)

Thanks for getting back to me mikey_p! I definitely know what you mean with "not having the time" :)

I also talked very briefly about this with merlinofchaos, but from a different perspective:
- whether exposed filters involved any significant magic besides the normal FAPI stuff, the answer was no
- whether the special **ALL** option had stayed and if other special options had been added, the answer was no

So, looking from the perspective of a straight port, it should be relatively straightforward. Integrating the UI for configuring HS properly will probably be a challenge though.

It's very likely that EclipseGc will sponsor this patch somewhere in the next 4 weeks through the company he works for. So unless you really badly need it, it's probably recommended that you just wait for that :)

In the mean time: could you go into more detail what the exact benefits would be of implementing a custom filter? I share the opinion that it shouldn't be a separate filter since it really is just another way of presenting the filter, it's essentially the same filter. It's possible that for some HS settings, such as the "save lineage" setting, a custom filter will be a necessity. But I can't say that yet right now because I don't know enough about Views 2 yet.

mikey_p’s picture

Well the short version, is that Views 2 features a nice OO design, with each filter, argument, field, or relationship item having it's code live in a 'handler' and the handlers in Views 2 are classes that extend a few base classes that define some basic methods for each item. For filters it's mainly options forms, exposed forms, and the validation functions that live in the end filters as methods, and in between there are a couple of general purpose handlers that handle the actual query modifications.

For instance, checkout the handler for the Taxonomy filter: http://views.doc.logrus.com/views__handler__filter__term__node__tid_8inc...

and then the it's parent at: http://views.doc.logrus.com/classviews__handler__filter__many__to__one.html

Basically the make your own filter version would involve either building a filter handler like view_handler_filter_term_node_tid that extends view_handler_filter_many_to_one, or a handler that extends views_handler_filter_term_node_tid directly and adds the settings for HS in the options_form methods.

johngriffin’s picture

It looks like I'll get the opportunity to work on this issue over the coming weeks, we need this feature for a project that I'm working on two days a week. Can anyone who is actively developing it please get in touch so that we can co-ordinate and avoid duplicating effort please?

I know it's asking a lot but I'd also really appreciate it if anyone who has spent some time looking into this would be brave enough to put a time estimate on it? I have a lot of experience of the Drupal API but none of writing handlers for Views 2. Looks like we've already got some good info in this issue.

Wim Leers’s picture

I estimate this at at least one full day of work to do it properly. All information I've collected and that has been contributed by mikey_p can be found in this issue.
The major thing that isn't very clear yet is this one: is it necessary, desirable or optional (i.e. which of the three is it?) to make a separate hierarchical taxonomy filter for Views? This is something that requires further research and possibly a chat with merlin.

If it turns out the best path is writing a new filter, then it's probably closer to two days of work.

All efforts are coordinated via this issue: mikey_p was going to work on this, but eventually isn't due to changed work circumstances, I was but haven't had the time, I *am* but not in the next 3 weeks. Other than the two of us, nobody has let me know they were working on this.
Follow-up #1 of internets contains a straight port using deadwood, which is appreciated, but useless. Views 2 works entirely different than Views 1, so a straight port is impossible.

There, now you know everything I know :) Please keep us in the loop!

johngriffin’s picture

Hi Wim, Just to let you know I'll be working on this today. It's a bit difficult to decide what is the best route without just diving in and getting started, so I'm going to look at extending the existing taxonomy filter handler first, specifically views_handler_filter_term_node_tid. If it starts to look like we need to override a lot, I'll drop back and extend views_handler_filter_many_to_one instead. Should I assign this issue to me?

Wim Leers’s picture

Assigned: Wim Leers » Unassigned

Sure, you can :) I'll take over from where you left it if you don't have the time to finish it off.

Thanks! :)

watbe’s picture

subscribing =)

johngriffin’s picture

Assigned: Unassigned » johngriffin
Liliplanet’s picture

definitely subscribe, thank you!

Summit’s picture

Hi,

Subscribing, very interesting!

Greetings,
Martijn

mordonez’s picture

subscribing :-)

Witch’s picture

subscribing

johngriffin’s picture

I've done about a day on this so far and I think I'm about half way there. One question has been thrown up today which I'd appreciate it if people could respond to as I'll be continuing development tomorrow:

Q: Is it desirable to set the hierarchical select element's options in the options box for the views filter? The alternative option is to leave the view filter options alone and have a separate page for setting the hierarchical select configuration options - as is the case in the Drupal 5 version.

Wim Leers’s picture

I think it'd be too much extra form stuff within the Views interface? Could you show how it currently looks, with a link to the config page?

Thanks for working on this! :) Since you're working on this right now, I assume you're not at the DrupalCon?

johngriffin’s picture

Hi Wim, I think you're right it would cramp the views interface to have the HS options there. I will release a demo later today hopefully, it's not quite at that stage yet.

Unfortunately I'm not at DrupalCon :-( I'm based in the UK and just couldn't take the time off for a trip to the US. I'm going to be starting a Drupal shop in Singapore later this year so lots of work going to preparation for that at the moment too!

zet’s picture

subscribing, this is critical

Renee S’s picture

subscribing

theabacus’s picture

subscribing

johngriffin’s picture

Status: Postponed (maintainer needs more info) » Needs work
FileSize
25.95 KB

Hey, I've attached a patch of my work, this is taken from HEAD in the hierarchical_select module directory. Wim is going to review this and sort out a couple of issues in order for it to work correctly so there is no point in anyone else reviewing it at the moment.

Wim, you will see my dirty hack in hierarchical_select.module for the views caching problem, I've have just used a session variable to store the name at the moment but you may have a nicer solution? The remaining issues are in a comment at the top of hs_taxonomy_views.module - I've marked the ones you said you'd have a look at since they are related to the main hierarchical select module. Good luck!

Wim Leers’s picture

Status: Needs work » Needs review
FileSize
409.48 KB
49.03 KB

- Your hook_menu() implementation was incorrect/incomplete: you shouldn't keep using $may_cache because it doesn't exist anymore. You should have used a 'title' plus 'title arguments' to generate the title. You shouldn't use drupal_set_title() in hs_taxonomy_views_config_form(). Fixed.
- Your Views hook implementations were mistakingly implemented as if they were part of hierarchical_select.module instead of hs_taxonomy_views.module. Fixed.
- In hs_taxonomy_views_data_alter(), you've got $data['term_data']['tid'] = array(…);. This one doesn't exist in taxonomy.views.inc, so I think it can be deleted.
- I've assumed that 'default' is the only supported display for now, i.e. I didn't add display-specific configs yet. I'll leave that to you. Very easy. The upgrade path is also very easy: just append "_default" to the variable names. I think.
- You weren't sure about implementing hs_taxonomy_views_hierarchical_select_implementation_info(). From API.txt: "Optional hook. This information is used to generate the configurations overview at admin/settings/hierarchical_select/configs." So yes, this has to be ported. I implemented it.
- Removed the _hs_taxonomy_views_apply_config() function that you weren't using anyway.
- It seems that the code you kept from my hook_form_alter() implementation, the code to keep the form id, is no longer necessary to make HS work. So I got rid of it.
- I made sure that multiple HS filters per View work, but only if you're using a different vocabulary for each exposed filter. But that's a sensible constraint, so that's fine.
- I created a define, HS_TAXONOMY_VIEWS_ALL_OPTION, for 'All', to prevent mistakes.
- "views filtering not working - prepareGETSubmit not working? param with name "tid" does not exist when submitting" Fixed. The reason was that you hadn't updated includes/views.js yet, which is understandable :)
- I've removed the 'exclusive_lineages' setting in favor of a new 'special_items' setting, as we discussed on Skype. See the docs for details.
- Your logic for setting #required was the same as mine in D5 and therefore it didn't work :P Fixed.
- It's not clear what this piece of code does – probably something necessary for Views exposed filters:

if (!empty($form_state['exposed']) && !isset($form_state['input'][$identifier])) {
      $form_state['input'][$identifier] = $default_value;
    } 

Please document it.
- I replaced $vid by $vocabulary->vid wherever possible, to prevent confusion with "view id".
- "Limit list to selected items" -> won't be supported.
- hook_uninstall() should reset the selection type from 'hierarchical_select' to select (added to TODO)
- made Hierarchical Select its own "Selection type" instead of an override of "Dropdown"
- changes the admin summary to "Uses Hierarchical Select" when Hierarchical Select is used
- when using Selection type 'Dropdown' with the 'Show hierarchy in dropdown' option enabled, it now uses Hierarchical Select to display terms
- From your TODO: "does cache get cleared?" -> No it does not, because the submit handler never gets fired because it's a GET form. Forms API doesn't properly support this. We need to find a work-around for this.
- The additional #submit handler for the config form has not yet been ported. This should also carefully integrate with the "expose_form" (which you get when you click "Taxonomy: Term").

Currently known bugs:
1) choosing hierarchical_select as type works fine everywhere, including the "expose_form", but NOT on the actual exposed filter form. There it just changes to "select". Even selecting Autocomplete ("textfield") doesn't work. Either a bug in Views or something wrong in the hs_taxonomy_views_handler_filter_term_node_tid class. For now, I'm enabling HS even when you've selected 'Dropdown' ('select').
2) The URL that is generated is just fine, but Views is again doing some sanitization it seems, because the value is reset to the empty array…

Search for [patch-review-by-Wim-Leers] in the attached patch to find my remarks.

I'd appreciate it if you could lift this patch as far as you can from here. I spent about 8 hours on improving this patch. I probably won't be able to put it in that much time again any time soon.

meet.h.thakkar’s picture

subscribing

Wim Leers’s picture

Status: Needs review » Needs work
FileSize
50.67 KB

Here's a reroll of the patch against current HEAD. I'm giving up. Views is too messy/hacky to support properly. I've spent 18 hours of my free time on this so far (John Griffin spent about the same time in paid hours I think) and it's still not yet ready. Why?

Short version: http://twitter.com/wimleers/status/1406405339

Long version (in chat to John Griffin):

It's 4:35 am here right now.

I'm getting incredibly frustrated by merlinofchaos' work. First this: http://drupal.org/node/368471. Then Views.

The patch fails indeed against current HEAD, so I updated it. It turns out that patch depended on behavior that a commit the day after (which fixed a regression that only exposes itself in one circumstance) had removed: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/hierarchica.... Not only that, but it turns out that virtually all this mess and weirdness is because Views has its own form building functions. So it does a lot of things slightly differently, which makes it virtually impossible to support Views.
For example my #submit callback gets fired twice, which in turn clears the cache, which in turn causes all AHAH updates to FAIL.

I'm going to give up for now. I really can't spend any more time on this.

In the attached patch you'll find debug output in _hierarchical_select_submit(). I also added an if test that successfully prevents the submit callback from firing when Views is enabled. But it also means that it *never* gets fired for Views. That is acceptable in the end because it's just for clearing the cache, which will happen automatically at some point in time.
So instead of the submit callback never being called, it's now being called too much (due to that fixed regression), but because that's worse than not being called at all, we're just ignoring all those calls. Yay.

I won't work on this until my bachelor thesis is finished or until somebody figures out work-arounds for all of this so that I only have to fix minor things.

I'm sorry Drupal community, but this is really not my fault.

fasdalf@fasdalf.ru’s picture

subscribing

liquixis’s picture

Assigned: johngriffin » Unassigned
Status: Needs work » Needs review

(sorry for my english)

I don't really know what is the problem! But maybe this will help...

http://drupal.org/node/342992#comment-1430622

johngriffin’s picture

Hi all, unfortunately I will not be able to do any more work on this for at least the next 6 weeks. Wim's last comment (#29) contains the most recent version of the patch. It is not working as it stands but a lot of work has been done and there is only really one critical issue remaining.

rapsli’s picture

how can we help? Coding ;) ... or something else? Since I don't know the code it would take me a while to get into this.

keyo’s picture

subscribing

Wim Leers’s picture

Yep, coding. I don't have *any* time at all, so even 1 million dollars wouldn't make a difference. And brace yourself, because this is *not* easy to dive into. There are many levels of processing and even more levels of confusion.
Just trying to warn you for a world of confusion and frustration. The end result will be worth it though :)

rapsli’s picture

@WimLeers. 1 million??? what would be more important? ;) ... when do you have more time? Is anybody else working on this right now?

Wim Leers’s picture

Nobody is working on this right now. I've talked to merlin though and he and I are on the same page when it comes to the current Forms API: it sucks and needs to be rewritten to allow for complex form elements and complex forms. That's why he chose to use alternative FAPI functions, which is understandable. He also has given me some useful insights in how to tackle this and he even worked on it for an hour or so, trying to get it to work. But one needs to know how HS operates *and* how FAPI operates internally *and* how Views' alternative FAPI functions give all of this another weird twist.

I'll be able to work on this in July, maybe sooner, but don't count on it.

Neither merlin, neither I am to blame. The state of the Forms API is to blame.

I'm sorry that this isn't usable yet, but it's outside of my power :)

Summit’s picture

Hi Wim, So very much appreciated you guys are trying! Hopefully in July you got a great brainwave!
Again thanks for trying and considering still building this!

Greetings, Martijn
www.trekking-world.com

tirdadc’s picture

Subscribing.

Jackinloadup’s picture

Subscribing.

westwesterson’s picture

subscribe

jasonxxx’s picture

Assigned: Unassigned » jasonxxx

закладка

Wim Leers’s picture

English please.

liquixis’s picture

"закладка" is something like "Subscribing".

Wim Leers’s picture

Assigned: jasonxxx » Unassigned

Thanks, overall. Unassigning again then.

Alexander Matveev’s picture

Subscribing

Freakachoo’s picture

Version: 6.x-3.x-dev » 5.x-3.0-rc6
Assigned: Unassigned » Freakachoo
Category: task » feature

Subscribing

watbe’s picture

Version: 5.x-3.0-rc6 » 6.x-3.x-dev
Category: feature » task

5.x-3.0 already has Taxonomy Views implemented.

liquixis’s picture

Assigned: Freakachoo » Unassigned
ari-meetai’s picture

Subscribing...

seanB’s picture

Subscribing...

leovw’s picture

Subscribing...

GreyHawk’s picture

subscribing

Mark Theunissen’s picture

This module has just been released:

http://drupal.org/project/views_filter_pack

It's not Hierarchical Select but it may help some of you who desperately need to improve your views filters. Disclaimer: I have no idea if it works or not.

GreyHawk’s picture

What about the Taxonomy Super Select module? Seems to work like this one, but with a slightly different twist, presentation/look & feel...

SlipAngel’s picture

Oi, this module is vital for large scale eCommerce. It seems like i'll have to abandoned my exposed filters entirely and move to an argument driven view that's fed from a static Javascript object. It's not the drupal way, but per the comments above sometimes the drupal way unfortunately involves skilled coders trying to build awesome modules on top of unstable base code.

ari-meetai’s picture

In my case, nothing would work as good as HS.

MattDrupalee’s picture

+1

Tresler’s picture

Status: Needs review » Needs work

As the last relevant posting I can see says that the patch does not work, I'm gonna take it at face value and set this to "needs work".

This is mission critical for a project I want to launch in the not to distant future so I am going to start looking into it. No promises, as I'm not familiar with the code and given the caliber of people who already took a crack at it, I'm not sure how much good I'll be able to do.

Wimleers and/or johngriffin, I'll be on AIM/SKYPE and/or IRC as samtresler or Tresler if you are already working on something or have pearls of wisdom, please ping me.

p.s. NOT assigning it to me till I get a grasp of what is entailed. Cheers.

Tresler’s picture

Talked to WimLeers who thinks he can look at this in the next few weeks so I'm sitting back for a while, crossing my fingers, and offering to test patches.

Cheers

timl’s picture

+1

Andrew Gorokhovets’s picture

Subscribing...

Wim Leers’s picture

Assigned: Unassigned » Wim Leers

Merge is sponsoring this patch now. The deadline is July 27, so by then, this should be resolved! I'll keep you posted.

BEfH’s picture

Ok, I'm new to this module but my first impresion is: WOW!
This is great work what you (all) had done.

@Wim: Hoping your effort on this will be successful!
Thanks in advance!

Wim Leers’s picture

It's 100% working. I'll post a patch tomorrow.

drupov’s picture

Wim Leers for president! What do you say, guys?

Thanks for the great effort, your work is a great improvement for the whole Drupal!

Wim Leers’s picture

Status: Needs work » Needs review
FileSize
64.85 KB

Ready for a quick round of review. I've tested it pretty thoroughly and it should be ready to go. Yes, it took me 17 revisions to get it ready.

Only one thing is not yet implemented: the "Display the node count" setting. It counts all nodes associated with each term. However, it should only look at the nodes in the current view instead of simply "all nodes".
I've contacted Earl Miles already about this, because this seems like a very complex thing to support. I'm not even sure it's possible.

benorgan’s picture

I'm getting the following error when using this with the dev version of Hierarchical Select and the version of Hierarchical Select Content Taxonomy from here http://drupal.org/node/342992#comment-1809098. I can't work out what code is at fault. The error didn't happen when I first installed the modules but has happened after I changed some settings, although changing them back to what they were doesn't seem to stop the error;

# warning: Invalid argument supplied for foreach() in /srv/www/htdocs/sites/all/modules/views/includes/handlers.inc on line 680.
# user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ) count_alias' at line 6 query: SELECT COUNT(*) FROM (SELECT DISTINCT(node.nid) AS nid, node.title AS node_title FROM node node LEFT JOIN content_field_associated_course_instance node_data_field_associated_course_instance ON node.vid = node_data_field_associated_course_instance.vid LEFT JOIN node node_node_data_field_associated_course_instance ON node_data_field_associated_course_instance.field_associated_course_instance_nid = node_node_data_field_associated_course_instance.nid WHERE (node.type in ('course')) AND () ) count_alias in /srv/www/htdocs/sites/all/modules/views/includes/view.inc on line 729.
# user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') LIMIT 0, 10' at line 6 query: SELECT DISTINCT(node.nid) AS nid, node.title AS node_title FROM node node LEFT JOIN content_field_associated_course_instance node_data_field_associated_course_instance ON node.vid = node_data_field_associated_course_instance.vid LEFT JOIN node node_node_data_field_associated_course_instance ON node_data_field_associated_course_instance.field_associated_course_instance_nid = node_node_data_field_associated_course_instance.nid WHERE (node.type in ('course')) AND () LIMIT 0, 10 in /srv/www/htdocs/sites/all/modules/views/includes/view.inc on line 755.

Wim Leers’s picture

@benorgan: Content Taxonomy or Content Taxonomy Views is not yet supported. This is just for regular Taxonomy.

benorgan’s picture

Actually I've just realised I am actually using Taxonomy rather than Content Taxonomy!

drupov’s picture

Hi Wim,

I just wanted to ask do you plan to release a patch for Content Taxonomy Views too in the near future?

Thanks in advance

Wim Leers’s picture

@benorgan: actually, that's virtually impossible. I'm not altering SQL queries, I'm just adding a layer on top. I suspect you're doing something wrong. You've applied the patch to the latest version of HS and have the latest version of Views installed?

@mitkoru: possibly, likely. No guarantees though.

benorgan’s picture

Hi Wim,

I've restored my database to a backup and it doesn't seem to be happening now. I have the latest HS and the latest released version of Views (do I need the dev version)?

It may have also been to do with me having Content Taxonomy HS installed before (I've since uninstalled this).

Regards,

Ben

Tresler’s picture

Will apply on a copy of the site I'm working on shortly.

Wim Leers’s picture

@benorgan: so is it working now?

@Tresler: okay, looking forward to your results :)

Wim Leers’s picture

venusrising’s picture

Going to test this today.

venusrising’s picture

I would really love to test this patch but I am trying to learn how to apply a patch without doing it manually (i.e. add and delleting the lines of code.) I read this but I am still confused http://drupal.org/node/60179 Any input would be appreciated.

Wim Leers’s picture

FileSize
135.14 KB

Here's a .zip with the patch applied to HS.

Andrew Gorokhovets’s picture

Thanks. I'm trying

venusrising’s picture

Thanks so much going to test now.

Andrew Gorokhovets’s picture

After adjustment hs_views, I see:

http://localhost/drupal6.13dev/?q=admin/build/views/hs_config/ViewTest/d...

Fatal error: Call to undefined method stdClass::save() in C:\webserver\Apache2.2\htdocs\drupal6.13dev\sites\all\modules\hierarchical_select\modules\hs_taxonomy_views.module on line 330

venusrising’s picture

Testing on Exisitng View and I now have a box that reads Sort Criteria but it is leaving a message of

Error: handler for term_data > tid doesn't exist!

Andrew Gorokhovets’s picture

When I'm created the new filter for views - I see the message:

You don't have Javascript enabled. Hover for more information! But don't worry: you can still use this web site! You have two options:
But JS enable.

Andrew Gorokhovets’s picture

But with all these errors, HS works correctly on Views page

GreyHawk’s picture

@andres_jw -- I get that javascript message occassionally, particularly when using Chrome; it appears to be when the page doesn't fully load correctly or some type of local memory / cache issue, as it's sporadic. (In other words, I have no idea why it shows up sometimes, but it usually ~doesn't~ show up.)

When I do get it, I reload a storm menu item and then drill down to the page I was on again and it usually reloads correctly unless I've got too many other windows open and loading other pages.

Dunno if that's something anyone else is experiencing, but thought it might be worth sharing.

Tresler’s picture

Installed latest hierarchical select (HEAD) applied patch, upgraded to latest stable Views (DRUPAL-6--2-6).

When running update.php for views hierarchical_select also wanted to run update 8, which may be a legacy from when I had this installed before, either way it looks fine "UPDATE {system} SET weight = 16 WHERE name = 'hierarchical_select'"

Back to admin/build/modules enable Hierarchical Select and Hiearchical Select Taxonomy. Enabled cleanly.

Edit the vocabulary in question and check Use the Hierarchical Select form element for this vocabulary.

Navigate to node/add/content-type and the form element appears to work throughout the node add process.

However, after that I go to enable hs_taxonomy_views and get that it is incompatible with the current version of Drupal Core (6.13) so, I can't test the taxonomy_views section yet. I'm about to try on a completely clean version of 6.13 in the event something on my current site is screwing this up.

Please post if I am missing something obvious.

Tresler’s picture

Hrm, strike that, looking at the .info files I see that my version of hs_taxonomy_views.info isn't updated so I see the patch wasn't applied correctly, or perhaps completely. Trying again.

Tresler’s picture

OK! so the patch isn't applying cleanly:

li26-107:/home/web/thenyclife.com/www/sites/all/modules# cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib co -d hierarchical_select -r HEAD contributions/modules/hierarchical_select

// Output from the checkout removed for brevity:

li26-107:/home/web/thenyclife.com/www/sites/all/modules/hierarchical_select# wget http://drupal.org/files/issues/views-v17.patch
--12:35:39-- http://drupal.org/files/issues/views-v17.patch
=> `views-v17.patch'
Resolving drupal.org... 140.211.166.6
Connecting to drupal.org|140.211.166.6|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 66,409 (65K) [text/plain]

100%[=======================================================>] 66,409 200.33K/s

12:35:39 (199.55 KB/s) - `views-v17.patch' saved [66409/66409]

li26-107:/home/web/thenyclife.com/www/sites/all/modules/hierarchical_select# patch -p0 < views-v17.patch
patching file API.txt
Hunk #1 succeeded at 78 (offset 3 lines).
Hunk #2 FAILED at 114.
Hunk #3 succeeded at 184 (offset 7 lines).
Hunk #4 succeeded at 223 (offset 7 lines).
Hunk #5 succeeded at 424 (offset 9 lines).
1 out of 5 hunks FAILED -- saving rejects to file API.txt.rej
patching file README.txt
Hunk #2 FAILED at 168.
1 out of 2 hunks FAILED -- saving rejects to file README.txt.rej
patching file hierarchical_select.js
patching file hierarchical_select.module
Hunk #3 FAILED at 366.
Hunk #6 succeeded at 643 (offset 2 lines).
Hunk #7 succeeded at 765 (offset 2 lines).
Hunk #8 succeeded at 781 (offset 2 lines).
Hunk #9 succeeded at 919 (offset 2 lines).
Hunk #10 succeeded at 1166 (offset 2 lines).
Hunk #11 succeeded at 1227 (offset 2 lines).
Hunk #12 succeeded at 1267 (offset 32 lines).
Hunk #13 succeeded at 1311 (offset 32 lines).
Hunk #14 succeeded at 1559 (offset 32 lines).
Hunk #15 succeeded at 1604 (offset 32 lines).
Hunk #16 succeeded at 1612 (offset 32 lines).
Hunk #17 succeeded at 1684 (offset 33 lines).
Hunk #18 succeeded at 2192 with fuzz 2 (offset 84 lines).
1 out of 18 hunks FAILED -- saving rejects to file hierarchical_select.module.rej
patching file includes/common.inc
Hunk #1 succeeded at 84 with fuzz 2 (offset 43 lines).
Hunk #2 succeeded at 107 (offset -23 lines).
patching file includes/theme.inc
patching file includes/views.js
patching file modules/hs_taxonomy_views.info
patching file modules/hs_taxonomy_views.module
patching file modules/hs_taxonomy_views_handler_filter_term_node_tid.inc
li26-107:/home/web/thenyclife.com/www/sites/all/modules/hierarchical_select#

It looks like only one of the three failures was related to code. Am I patching to the right codebase? this is against HEAD, correct?

Tresler’s picture

Ignoring that error for a moment, I now see in the node creation and edit form the HS form element, but when I attempt to select a taxonomy term I am getting a firefox popup that says "Invalid response from server"

I'm gonna back up and get a totally clean copy of views, HS, and Drupal, and create some dummy data on localhost as opposed to my server. This should tell me if this is related to my install or the patch. I should be able to get to that tomorrow or later today.

johngriffin’s picture

Hi Tresler,

Looks like you're applying an old version of the patch which is probably the cause of most of your errors. Wim updated the patch as it was broken against the latest revision of HEAD. See #76 for a link to the new patch.

Tresler’s picture

indeed. Oops.

Tresler’s picture

Ok, *that* patch applies cleanly.

Upon enabling a views filter and hitting the link provided for "configure Hierarchical Select" I get the php error:

Fatal error: Cannot use string offset as an array in /home/web/thenyclife.com/www/includes/form.inc on line 979

However, if I avoid hitting that link and just update the filter I also get the You don't have Javascript enabled error, when I most certainly do. This prevents me from editing the details of a taxonomy filter and it never shows up on the view itself.

Gotta run for now, but will try to be back tomorrow.

Wim Leers’s picture

FileSize
64.81 KB

#82:
That is … very, very odd. I'm doing

$view = views_get_view($view_name);
// Make some changes to $view.
// …
$view->save();

I cannot reproduce this.

#83:
Please clarify. Adding a sort criterium on Taxonomy terms works fine here.

#84:
Good catch. That only happens when you're creating a view though. When you edit it, it'll work fine. That's because I have to be able to dynamically insert JavaScript. Which is something Drupal doesn't support yet. I'll look into this.

#85:
Excellent :)

#86:
Yes, some browsers do seem to have that annoying behavior. I never see it in Safari 4 though. Especially Firefox seems to suffer from that.

#87, #88, #89:
you applied version 17 of the patch, while I already posted version 18 (in #76). But even version 18 doesn't apply anymore, Hierarchical Select is moving forward fast :) A new version of the patch is attached.

#90:
you need to rebuild your menu. Are you sure you did that? If that doesn't help, try clearing caches.

Wim Leers’s picture

FileSize
137.36 KB

Attached the latest module with the patch (version 19) applied. I forgot to attach this to the previous comment.

#93:
that's fixed in the patch above. For some unknown reason, the patch got applied to the wrong piece of code and hence ended up in the new version of the patch …

Andrew Gorokhovets’s picture

Thanks, I will test

Tresler’s picture

Actually, got some more time tonight. Installed on a fresh download this time, new drupal/views/and HS

Enabled only HS, hs taxonomy, hs taxonomy views, views, and vies UI. First step was to create a vocabulary for testing and got this at: http://d6.lcl/admin/content/taxonomy/add/vocabulary

* notice: Undefined index: vid in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 17.
* notice: Trying to get property of non-object in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 65.
* notice: Undefined offset: 0 in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 690.
* notice: Undefined variable: tree in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 707.
* notice: Undefined variable: depth in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 768.
* notice: Undefined offset: 0 in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 690.
* notice: Undefined variable: tree in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 707.
* notice: Undefined variable: depth in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 768.
* notice: Trying to get property of non-object in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 80.
* notice: Undefined index: #config in /home/stresler/www/d6/sites/all/modules/hierarchical_select/includes/common.inc on line 49.
* notice: Undefined index: require_entity in /home/stresler/www/d6/sites/all/modules/hierarchical_select/includes/common.inc on line 172.
* notice: Undefined offset: 0 in /home/stresler/www/d6/sites/all/modules/hierarchical_select/includes/common.inc on line 219.
* notice: Undefined offset: 0 in /home/stresler/www/d6/sites/all/modules/hierarchical_select/includes/common.inc on line 303.
* notice: Undefined index: op in /home/stresler/www/d6/sites/all/modules/hierarchical_select/hierarchical_select.module on line 921.
* notice: Undefined offset: 0 in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 690.
* notice: Undefined variable: tree in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 707.
* notice: Undefined offset: 0 in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 690.
* notice: Undefined variable: tree in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 707.
* notice: Undefined index: require_entity in /home/stresler/www/d6/sites/all/modules/hierarchical_select/hierarchical_select.module on line 1866.
* notice: Undefined property: stdClass::$childinfo in /home/stresler/www/d6/sites/all/modules/hierarchical_select/hierarchical_select.module on line 1046.
* notice: Undefined index: #size in /home/stresler/www/d6/sites/all/modules/hierarchical_select/hierarchical_select.module on line 512.
* notice: Undefined index: #disabled in /home/stresler/www/d6/sites/all/modules/hierarchical_select/hierarchical_select.module on line 659.
* notice: Undefined index: #post in /home/stresler/www/d6/includes/form.inc on line 886.
* notice: Undefined index: #post in /home/stresler/www/d6/includes/form.inc on line 886.
* notice: Undefined index: #post in /home/stresler/www/d6/includes/form.inc on line 886.
* notice: Undefined index: #post in /home/stresler/www/d6/includes/form.inc on line 886.
* notice: Undefined index: #post in /home/stresler/www/d6/includes/form.inc on line 886.
* notice: Undefined index: #post in /home/stresler/www/d6/includes/form.inc on line 886.
* notice: Undefined index: hs_form_build_id in /home/stresler/www/d6/sites/all/modules/hierarchical_select/hierarchical_select.module on line 717.
* notice: Undefined index: class in /home/stresler/www/d6/sites/all/modules/hierarchical_select/includes/theme.inc on line 33.
* notice: Undefined index: #error in /home/stresler/www/d6/sites/all/modules/hierarchical_select/includes/theme.inc on line 43.

Gonna ignore for now and keep testing. To confirm this is with the views-v19.patch applied cleanly.

Tresler’s picture

Ok, you can create the vocabulary, but when you get to adding terms the hierarchical select form item appears on the advanced options for selecting parents and siblings, I don't know if this is intended to show up on the admin forms or not.

When attempting to select parent or sibling terms I get the invalid response from server popup again upon hitting the HS add term button. I then installed devel and emptied the cache, same thing. and rebuilt the menus, same result.

So, I think the current patched version prevents the addition of terms with parents or siblings somehow. (firefox3.0.11/kubuntu), also the same error as above is appearing on all admin/ pages for the new vocabulary.

Tresler’s picture

I used the devel module to generate terms to bypass the above limitation and have 3 vocabularies with children terms to work with.

A) Upon creating a view and adding a filter it appears that I can choose hierarchical select for vocabularies that I haven't enabled "Use hierarchical select" on in the vocabulary settings. This may be intended behaviour, but it seems odd to me. Ignore if irrelevant.

B) The errors from above starting with "notice: Undefined index: 27 in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy.module on line 700." seem to be prevalent on each page that might use HS, ignoring until further notice. WIll list any others.

C) When adding a filter for a view, if one hits the Configure Hierarchical select Link, it takes you to the configure form. However, if you then hit the Return to views configuration link, you are told that "An invalid vocabulary is selected. Please change it in the options." You can then go to the filter settings and change it, but this seems like odd behaviour, the Return to views config should take you back to where you left off.... if possible.

D) When adding a filter for a view, if one doesn't use the configure HS link, you can choose a vocabulary. Once chosen you have the standard views options for term filters 'is one of', 'is all of', 'is none of'. When selecting 'is all of' you can't multi-select terms using the HS form element. It seems that if HS is going to be implemented here it should be displayed with its "Add term" button. Or just not be displayed here in an admin form.

E) During view creation, I at one point got this:
# notice: Trying to get property of non-object in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy_views.module on line 534.
# notice: Trying to get property of non-object in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy_views.module on line 535.
# notice: Trying to get property of non-object in /home/stresler/www/d6/sites/all/modules/hierarchical_select/modules/hs_taxonomy_views.module on line 535.

F) Upon attempting to save a view, I get the following error:

# warning: implode() [function.implode]: Invalid arguments passed in /home/stresler/www/d6/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc on line 295.
# user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT * FROM term_data td WHERE td.tid IN () in /home/stresler/www/d6/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc on line 295.

G) On the view page itself the filters appear, but changing them results in the "Invalid response from server" popup error. Also, it seems add that in teh view config I couldn't set them to be for multiple terms, but in the HS select box on the view, all terms appear.

Hope this actually helps and isn't just too much signal to noise. Please tell me if you have any specific tests you want me to perform, or if you need a hand in some of the easier to grok coding. Thanks for all your hard work!

johngriffin’s picture

Just had a quick test...

Looks like I have to save the view first before the HS drop-downs in the views UI can be used.

Steps to reproduce:

1. Create new taxonomy term filter and select Hierarchical select, click Update.

2. If you click "Configure Hierarchical select" link I get 404 not found (URL: admin/build/views/hs_config/SearchRoutes/default/tid ) - intermittent though, seems to work now.

3. All other HS dropdowns don't seem to work until I save the view, showing a JS alert of "Invalid response received from server". Firebug shows: POST http://dev.drupal6/hierarchical_select_json 404 Not Found

...

Filter seems to work perfectly when exposed on an actual page view. I noticed that the dropbox is buggy on the views UI preview though, not filtering correctly and losing it's value when you click apply.

Fantastic work though, I'll do some more testing soon!

Wim Leers’s picture

FileSize
136.15 KB
70.38 KB

New version (20) of the patch. Changes:
- new: entity count support, for which dynamic views are built on-the-fly and a filter is added to filter by the term that is being counted. Reason: now the node counts shown correspond with the nodes in the view instead of the nodes on your site. Obviously, if you have a lot of filters, these are now being accounted for and thus the counts match what the user gets to see, whereas previously it would seem completely wrong. This was pretty hard.
- fixed: when selecting the "Any" option and with a filled dropbox, the dropbox wouldn't get erased

#97:
Yes, HS is not notice free. Yes, PHP is stupid. And yes, I am stupid because I seem to fail to configure my local MAMP setup to show me those notices (E_ALL enabled).

#98:

Ok, you can create the vocabulary, but when you get to adding terms the hierarchical select form item appears on the advanced options for selecting parents and siblings, I don't know if this is intended to show up on the admin forms or not.

Yes, this is intended.

When attempting to select parent or sibling terms I get the invalid response from server popup again upon hitting the HS add term button. I then installed devel and emptied the cache, same thing. and rebuilt the menus, same result.

So, I think the current patched version prevents the addition of terms with parents or siblings somehow. (firefox3.0.11/kubuntu), also the same error as above is appearing on all admin/ pages for the new vocabulary.

Fixed.

#99:
A) Intended indeed. Reason: you can choose to use another widget than HS for input on node forms. HS doesn't take over anything, it's just a means of input, hence it may make sense to use different widgets for different use cases.

B) See above.

C) Can you post the exact steps to reproduce?

D) Of course you can, but you must enable the dropbox first. The reason is simple: the same settings are applied to the "Select terms from vocabulary " HS instance as to the HS instance on the exposed filters form. Why should the admin be allowed to select multiple terms if the end user can not? And how would that then be presented through HS? If you disagree, convince me of your point of view :)

E) Line numbers have changed already. Please post steps to reproduce.

F) Please posts steps to reproduce.

G) Huh? What's the output you get?

#100:
Problem reproduced in your third step. There's nothing I can do. That is the normal Taxonomy support working there, *but* it's inside the views_ui_config_item_form() form, which requires access to the $view object. But since it's not yet saved, it cannot be loaded. Hence it fails. If you save the view first, it'll work fine.
There's a way around this probably, but I'm exhausted right now (almost 4 AM). Will do that tomorrow.

Glad it's working okay :) The dropbox in the preview UI works fine here though. At least with the new patch.

Wim Leers’s picture

FileSize
142.33 KB
70.38 KB

#required checking was broken.

Andrew Gorokhovets’s picture

Ok. Will be test

Tresler’s picture

Updated to latest patch 21. That solved several of these, so if it isn't re-listed here, assume it is taken care of.

C) Problem: Configure HS link in view filter creation returns you to view page at a different point. This is somewhat minor.

To reproduce:
- install drupal, hs_tax_views, vviews, and devel, and generate nodes and terms with devel
- navigate to /admin/build/views/add and create a new node-type view
- add a Page display
- add a Taxonomy: Term filter to the page display
- Under "Page: Configure extra settings for filter Taxonomy: Term" select Hierarchical Select:
- Click the Configure link that appears.

At this point, you are now configuring for the default display when you were editing the Page display you were attempting to create. If you click return to views configuration on this page, you land back on the views default display config with your filter applied to the Default view AND the Page view. Furthermore, these filters don't have a vocabulary selected on them, as configuration was never completed, you can click back through and add them, but the user would need to know to do that.

It seems this behaviour is the same whenever you configure an HS taxonomy filter for any display (i.e. automatically adding it to the default display.) I would assume that you need to 'override' the default /before/ configuring HS, but not sure about that.

D) Of course you can, but you must enable the dropbox first. The reason is simple: the same settings are applied to the "Select terms from vocabulary " HS instance as to the HS instance on the exposed filters form. Why should the admin be allowed to select multiple terms if the end user can not? And how would that then be presented through HS? If you disagree, convince me of your point of view :)

I see what you are saying, but was very confused for a moment.

Right now, once I have chosen a vocabulary, I have the ability to select "Is all of" without having selected the dropbox option on HS effectively let me choose one option for an operator that implies more than one option. There should probably be some help text, letting the user know they can change that in the HS config
if they want it. Way, way minor, let me know if you want me to open a separate issue for it.

Other than those things. This is totally usable. Thanks again for the time you are spending on this.

Tresler’s picture

It might be good to get another person to reproduce this before Wimleers loosk at it if he is busy, as it is a bit involved. It took me over an hour to get reproduction steps accurate and having someone double check them would be nice.

HS preserves HS config after filter has been removed, AND won't allow alterations to new filters.

Steps to reproduce:
- Install clean Drupal, patched HS Views (views-21.patch), devel, and Views
- Generate 3 Vocabularies with children and 50 nodes.
- Create a View with a page display, path /test
- Add a taxonomy ID filter.
- Set to exposed.
- choose first vocabulary, and HS. hit update.
- Click on settings for the filter and click link to go to HS configuration.
- Enable dropbox, alter Title text ( I used title for ease of testing, other settings are similarly affected). I entered 'blah'. Save the config.
- click the link to take you back to the views config.
- Save the view.
- Check the view at example.com/test
- confirm 'blah' is the text that is listed on example.com/test.
- Edit the view and remove the taxonomy filter.
- clear views cache and drupal cache (just for safe measure.)
-Confirm the filter is gone at example.com/test

At this point that filter AND the HS config should be gone

- Add a taxonomy ID filter to the view.
- Select the *3rd* vocaulary ( could use the first, but using the third just checks that this bug isn't tied to the vocab used originally).
- Select HS, and update the filter.
- Select the filter settings and go to the HS config.
- Enable the dropdown box and enter a different unique string into the Title. 'Foobar'
- save teh config.
-navigate back to the view edit form using the link.
-Save the view.

visit example.com/test
The original text 'Blah' is there instead of 'foobar'.
As near as I can tell, at this point the only way to change the HS settings is to re-create the entire view from the beginning and delete this view.

Can someone else please confirm?

Tresler’s picture

Meanwhile, I found what is wrong with getting back to the views edit page from the HS config page, see 104 C. "tabs" should be "tab" in the url constructed on line 298 of hs_taxonomy_views.module. Such a small fix I didn't roll a patch, Wimleers if you want to remove the 's' on the next one it would be handy.

Tresler’s picture

In regards to 105, this behaviour is explained by HS_taxonomy_views always using the default display, regardless of override settings in the individual display. The interesting part is that this persists after deleting the Default filter and saving the view.

feuillet’s picture

Subscribing.

Can't wait for this... Thanks to all developers.

venusrising’s picture

I tested and it seems to work fine but I did need to go in and resave my current view and then it worked great.

Wim Leers’s picture

@Tresler: thanks for the detailed feedback! I'll fix that today!

@venusrising: of course that is necessary: your current view was probably using "Dropdown" or "Autocomplete", to change it to "Hierarchical Select", you of course need to save it again.

Excellent, excellent feedback.

Wim Leers’s picture

FileSize
181.75 KB
70.72 KB

#104:

C) Problem: Configure HS link in view filter creation returns you to view page at a different point. This is somewhat minor.

To reproduce:
- install drupal, hs_tax_views, vviews, and devel, and generate nodes and terms with devel
- navigate to /admin/build/views/add and create a new node-type view
- add a Page display
- add a Taxonomy: Term filter to the page display
- Under "Page: Configure extra settings for filter Taxonomy: Term" select Hierarchical Select:
- Click the Configure link that appears.

At this point, you are now configuring for the default display when you were editing the Page display you were attempting to create. If you click return to views configuration on this page, you land back on the views default display config with your filter applied to the Default view AND the Page view. Furthermore, these filters don't have a vocabulary selected on them, as configuration was never completed, you can click back through and add them, but the user would need to know to do that.

It seems this behaviour is the same whenever you configure an HS taxonomy filter for any display (i.e. automatically adding it to the default display.) I would assume that you need to 'override' the default /before/ configuring HS, but not sure about that.

Indeed you are configuring for the default display using those steps. Blame Views' UI for this unclarity. As long as you don't click the "Override" button (in "Page: Configure filter Taxonomy: Term", not in "Page: Configure extra settings for filter Taxonomy: Term", which makes this even less clear), you are configuring the default display. That's just how it works.
So yes, you need to override the default before configuring HS. The same would apply for Dropdown and Autocomplete.

D) Of course you can, but you must enable the dropbox first. The reason is simple: the same settings are applied to the "Select terms from vocabulary " HS instance as to the HS instance on the exposed filters form. Why should the admin be allowed to select multiple terms if the end user can not? And how would that then be presented through HS? If you disagree, convince me of your point of view :)

I see what you are saying, but was very confused for a moment.

Right now, once I have chosen a vocabulary, I have the ability to select "Is all of" without having selected the dropbox option on HS effectively let me choose one option for an operator that implies more than one option. There should probably be some help text, letting the user know they can change that in the HS config if they want it. Way, way minor, let me know if you want me to open a separate issue for it.

Not sure what you mean by this. Is it that I'm disabling that form item once you have Save Lineage enabled and am changing the description to "Managed by Hierarchical Select because the 'Save lineage' setting is enabled."?
Could you tell me what you'd like to see here?

Other than those things. This is totally usable. Thanks again for the time you are spending on this.

Excellent :) And thank Merge too, not just me ;) :)

#105:

It might be good to get another person to reproduce this before Wimleers loosk at it if he is busy, as it is a bit involved. It took me over an hour to get reproduction steps accurate and having someone double check them would be nice.

HS preserves HS config after filter has been removed, AND won't allow alterations to new filters.

Steps to reproduce:
- Install clean Drupal, patched HS Views (views-21.patch), devel, and Views
- Generate 3 Vocabularies with children and 50 nodes.
- Create a View with a page display, path /test
- Add a taxonomy ID filter.
- Set to exposed.
- choose first vocabulary, and HS. hit update.
- Click on settings for the filter and click link to go to HS configuration.
- Enable dropbox, alter Title text ( I used title for ease of testing, other settings are similarly affected). I entered 'blah'. Save the config.
- click the link to take you back to the views config.
- Save the view.
- Check the view at example.com/test
- confirm 'blah' is the text that is listed on example.com/test.
- Edit the view and remove the taxonomy filter.
- clear views cache and drupal cache (just for safe measure.)
-Confirm the filter is gone at example.com/test

At this point that filter AND the HS config should be gone

- Add a taxonomy ID filter to the view.
- Select the *3rd* vocaulary ( could use the first, but using the third just checks that this bug isn't tied to the vocab used originally).
- Select HS, and update the filter.
- Select the filter settings and go to the HS config.
- Enable the dropdown box and enter a different unique string into the Title. 'Foobar'
- save teh config.
-navigate back to the view edit form using the link.
-Save the view.

visit example.com/test
The original text 'Blah' is there instead of 'foobar'.
As near as I can tell, at this point the only way to change the HS settings is to re-create the entire view from the beginning and delete this view.

Can someone else please confirm?

I can confirm the HS config doesn't get deleted. It's simply not yet implemented (not in any module that HS supports, for that matter). But you still *can* change the config and the changes will get applied.

#106:

Meanwhile, I found what is wrong with getting back to the views edit page from the HS config page, see 104 C. "tabs" should be "tab" in the url constructed on line 298 of hs_taxonomy_views.module. Such a small fix I didn't roll a patch, Wimleers if you want to remove the 's' on the next one it would be handy.

Thanks, fixed!

#107:

In regards to 105, this behaviour is explained by HS_taxonomy_views always using the default display, regardless of override settings in the individual display. The interesting part is that this persists after deleting the Default filter and saving the view.

Thanks, fixed!
(In hs_taxonomy_views_handler_filter_term_node_tid::value_form(), on the fourth line of its body, I was passing $view instead of $this->view.)

New patch attached. I think that, with these two minor changes, this is now ready to be committed. I'd like one more round of reviews first though.

TonyGuy’s picture

In the zip the function hierarchical_select_common_config_del() is declared twice starting at line 42 in includes/common.inc . No other errors noticed yet once removed though.

Wim Leers’s picture

FileSize
190.31 KB
72.23 KB

@Tonyguy: right, I mixed two patches in the .zip. One of which got committed in the mean time and introduced that function. For some reason, this patch adds it a second time instead of failing.

I've rerolled the patch to fix this bug and against HEAD — several commits have occurred since I posted version 22 of the patch. Version 23 now and probably the final version! :)

askibinski’s picture

With this latest, I get the following fatal error on the page with the exposed hs taxonomy filter in a block:

Fatal error: Call to a member function clone_view() on a non-object in /(...)/sites/all/modules/hierarchical_select/modules/hs_taxonomy_views.module on line 423

This is on an already exisiting site with taxonomy and views.
I configured all settings, and the hs does show up in the preview pane when you add the filter in Views (though it does give the occasional JS invalid response error). However on the view itself I get the following error.

I'll doucle check my steps, but first I'm going to install it on a clean Drupal.

Wim Leers’s picture

FileSize
209.76 KB
74.08 KB

For the record: I went into askibinski's site (whom is the sponsor of this patch) and weird things were happening:
1) for the entity_count feature, the current view object is necessary (I get it using views_get_current_view()). But from a certain moment, it gets set to FALSE, which makes entity_count fail.
2) when the entity_count feature is disabled, the PHP error disappears, but HS still doesn't work. HS' form cache turns out to be empty.

I also found two minor issues: the none option would not be properly set in an exotic edge case introduced by this patch. However, HS Taxonomy Views did not suffer from this. Second, the entity_count or require_entity settings would not ignore special items, which they should.
Fixed these two things in this follow-up patch.

ianchov’s picture

Guys,
Your are doing a great job.
Even that i can`t still use HS on Views exposed taxonomy term i thank you.
When you think there is gonna be an update?

Wim Leers’s picture

@ianchov: what doesn't work? It works for everybody else, at least on a vanilla install.

crea’s picture

Status: Needs review » Needs work

Installed module files from zip, added HS to my view. Then at the preview I get following errors:
* warning: Illegal offset type in /home/crea/workspace/Drupal 6 Development/includes/common.inc on line 1608.
* warning: uasort() [function.uasort]: The argument should be an array in /home/crea/workspace/Drupal 6 Development/includes/common.inc on line 2843.
Also selecting any term in HS widget results in "Received invalid response from the server".

crea’s picture

I resaved my view once more (I did it already after I added HS) and previous problem started to show sometimes, not always.

Also, I think I have found a bug. When HS dropbox is set to "reset selection" widget selection seems to be ignored by the view, cause when I press "apply" button during preview, view is ignoring terms added to selection, and widget resets to empty.

ianchov’s picture

Hi Wim,

The HS works on node/$/edit but i cannot make it working on views exposed Taxonomy nor Content taxonomy field.
I just get a large select menu..
I must note that i didn`t use the file attached in this thread but the ones on modules pages.
Should i use these here?

Wim Leers’s picture

Status: Needs work » Needs review

#118: I can't reproduce that. Until you can post the steps to reproduce this on a vanilla Drupal installation, I'm going to assume this is caused by other modules.

#119: Works fine here.

#120: Content Taxonomy is not supported. And *obviously* you should use the ones in this thread. It seems you're new to Drupal and Drupal's processes. It might be better for you to wait until this is committed.

ianchov’s picture

Thanks Wim.

I will wait to be cvs-uped..

slider’s picture

#121:
Hi! I has errors like #118 too.
For cleanliness of experiment I try reproduce that on a vanilla Drupal installation.
Firs, I see that results "Received invalid response from the server" if form widget exposed in block.
I cannot tell that have found other errors in pure installation. This consequence much is possible water also sortings in tabular representation. But I think, it is possible to begin with an error in block representation.

...Thanks for fine work. This module is very important for my work.

jackbravo’s picture

subscribe

crea’s picture

Wim Leers’s picture

FileSize
191.61 KB

#118: any chance you were putting your exposed filters in a separate block? That was causing problems, apparently. Because of this in Views:

    // Some types of displays (eg. attachments) may wish to use the exposed
    // filters of their parent displays instead of showing an additional
    // exposed filter form for the attachment as well as that for the parent.
    if (!$this->display_handler->displays_exposed() || (!$block && $this->display_handler->get_option('exposed_block'))) {
      unset($form_state['rerender']);
    }

And that is the exact property I'm testing for in HS' #submit callback:

function _hierarchical_select_submit($form, &$form_state) {
  // Delete the stored form information when the form is submitted.
  // [VIEWS] TRICKY: when using Views, which uses its own Forms API workflow
  // instead of core's, whenever the $form_state['rerender'] flag is set, this
  // #submit callback is called even when there is nothing really there to
  // submit. So to prevent our cache to be cleared, which would result in
  // failing AHAH callbacks, we just prevent it from clearing the cache. This
  // results in cache entries that aren't cleared immediately upon finishing
  // use of the form, but that's acceptable in the end because the cache will
  // be cleared anyway at some point.
  if (isset($form_state['hs_form_build_id']) && !isset($form_state['rerender'])) {
    cache_clear_all($form_state['hs_form_build_id'], 'cache');
  }
}

The result is obviously that cache entries are being deleted when in fact the #submit callback is being called for no reason by Views' own layer on top of FAPI.

FAPI is a mess and Views' layer on top is a mess. Combine them and you get this world of pain.

I worked around this in this new version.

#123: see the above

#125: please check if this fixes that as well.

P.S.: To make the fun complete, it is also completely impossible at the moment to roll patches:

--( ~/Drupal/contributions/modules/hierarchical_select )-- d views-v25
can't create temporary directory /tmp/cvs-serv8087
No space left on device

Hence no .patch, only a .zip.

timl’s picture

thanks for the .zip, works a treat

Bartezz’s picture

Hi Wim,

I tried the latest .zip (in#126) but I can't enable;
-Hierarchical Select Book
-Hierarchical Select Content Taxonomy
-Hierarchical Select Content Taxonomy Views

As they are not compatible with version 6.13 of Drupal core. Is this correct or is it something in my settings?
I really would like to give Hierarchical Select Content Taxonomy Views a go.

Cheers

Wim Leers’s picture

FileSize
74.14 KB

#127: excellent!

#128: correct. Content Taxonomy sucks and supporting it flawlessly is a nightmare. The relevant issue is here: #342992: Port HS support for Content Taxonomy to Drupal 6.

Also, CVS is working again, so here's the patch of the .zip in #126:

Bartezz’s picture

FileSize
17.06 KB

Hi Wim,

I've been playing with the version attached with comment #126 and found the following;

- admin/settings/hierarchical_select/configs

    * warning: array_merge_recursive() [function.array-merge-recursive]: Argument #2 is not an array in C:\xampplite\htdocs\mydomain\sites\all\modules\hierarchical_select\hierarchical_select.admin.inc on line 79.
    * warning: array_merge_recursive() [function.array-merge-recursive]: Argument #1 is not an array in C:\xampplite\htdocs\mydomain\sites\all\modules\hierarchical_select\hierarchical_select.admin.inc on line 79.
    * warning: Invalid argument supplied for foreach() in C:\xampplite\htdocs\mydomain\sites\all\modules\hierarchical_select\hierarchical_select.admin.inc on line 84.

The overview of all Hierarchical Select confirgurations is empty

- Other errors I've encountered are with adding terms to a taxonomy (as user 1)
When I add the same sub-sub-term to multiple sub-terms I get this error;

user warning: Duplicate entry 'category/soort-hulpverlener/verloskundige/overige-hulpverleners/' for key 2 query: INSERT INTO sgz_url_alias (src, dst, language) VALUES ('taxonomy/term/41', 'category/soort-hulpverlener/verloskundige/overige-hulpverleners/oefentherapeut/huisartsenpost/huisarts/fysiotherapeut/eerstelij-0', '') in C:\xampplite\htdocs\mydomain\modules\path\path.module on line 112.

Yet the term is being added to all selected subterms?

- A critical bug is the following;
When in admin/content/taxonomy/2/add/term and trying to add a term of the 3rd level I'm getting strange errors.
For instance I want to add the term sedan to red
car -> red -> sedan

This works, yet the term is also being added to
bicycle -> red -> sedan

Which is rather strange!

- Another critical bug;
I want to add a second term to red called stationwagon
car -> red -> stationwagon
This results in mahem, can't explain but please attached see picture (terms are different the from my explanation above)

No if I click the 'add term' tab from that mahem page I get a whole lot of errors;

    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.
    * warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.

I will be doing some more testing and will post my results here. If you need more information just give me a shout!

Cheers

Bartezz’s picture

Maybe found the reason for the mahem...
Check out the attached image.

As you can see I'm hovering over Buytenwegh which is a term of Huisarts inside the taxonomy Soort Hulpverlener.

The url it should be pointing to is something like;
category/soor-hulpverlener/huisarts/buytenwegh

But it is actually pointing to;
category/soort-hulpverlener/verloskundige/overige-hulpverleners/oefentherapeut/huisartsenpost/huisarts/fysiotherapeut/eerstelijn

Is this because of my settings?? Or might this be a bug?

Cheers

Bartezz’s picture

Latest comment might be related to http://drupal.org/node/376024

venusrising’s picture

Thanks to everyone for testing this and Wim for the design, I wish I could help.

Wim Leers’s picture

#130:

Hi Wim,

I've been playing with the version attached with comment #126 and found the following;

- admin/settings/hierarchical_select/configs
* warning: array_merge_recursive() [function.array-merge-recursive]: Argument #2 is not an array in C:\xampplite\htdocs\mydomain\sites\all\modules\hierarchical_select\hierarchical_select.admin.inc on line 79.
* warning: array_merge_recursive() [function.array-merge-recursive]: Argument #1 is not an array in C:\xampplite\htdocs\mydomain\sites\all\modules\hierarchical_select\hierarchical_select.admin.inc on line 79.
* warning: Invalid argument supplied for foreach() in C:\xampplite\htdocs\mydomain\sites\all\modules\hierarchical_select\hierarchical_select.admin.inc on line 84.

The overview of all Hierarchical Select configurations is empty

I cannot reproduce this.

- Other errors I've encountered are with adding terms to a taxonomy (as user 1)
When I add the same sub-sub-term to multiple sub-terms I get this error;
user warning: Duplicate entry 'category/soort-hulpverlener/verloskundige/overige-hulpverleners/' for key 2 query: INSERT INTO sgz_url_alias (src, dst, language) VALUES ('taxonomy/term/41', 'category/soort-hulpverlener/verloskundige/overige-hulpverleners/oefentherapeut/huisartsenpost/huisarts/fysiotherapeut/eerstelij-0', '') in C:\xampplite\htdocs\mydomain\modules\path\path.module on line 112.

Not HS' responsibility. I assume you're using the [save-lineage-termpath] token. If that token turns out to be the same, that's possible. It's up to Pathauto to support that.

This is unrelated to Taxonomy Views support.

Yet the term is being added to all selected subterms?
- A critical bug is the following;
When in admin/content/taxonomy/2/add/term and trying to add a term of the 3rd level I'm getting strange errors.
For instance I want to add the term sedan to red
car -> red -> sedan

This works, yet the term is also being added to
bicycle -> red -> sedan

Which is rather strange!

Red is probably a term with multiple parents: car and bicycle. Correct? Then it's perfectly normal that "sedan" appears below both. With our without HS, it'll behave the same.
However, if this is not about *creating* a term, but *selecting* a term, then you must enable the "save lineage" setting. Then only the lineage that you selected will be stored. This is necessary because you've got terms with multiple parents. This is documented in the README.

This is unrelated to Taxonomy Views support.

- Another critical bug;
I want to add a second term to red called stationwagon
car -> red -> stationwagon
This results in mahem, can't explain but please attached see picture (terms are different the from my explanation above)
No if I click the 'add term' tab from that mahem page I get a whole lot of errors;
* warning: preg_match() expects parameter 2 to be string, array given in C:\xampplite\htdocs\zoetermeer-gezond\includes\bootstrap.inc on line 771.

UGH … WTF? Please open a separate issue for this. This is unrelated to Taxonomy Views support.

#131: This is because of your pathauto settings. Not because of your HS settings. This is unrelated to Taxonomy Views support.

@all: *Please* stay on topic. Only post problems with Taxonomy Views support, not with anything else. This issue is long enough as it is now.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

RTBC unless something pops up in the next 24 hours.

askibinski’s picture

edit: works fine!

Wim Leers’s picture

Status: Reviewed & tested by the community » Fixed

Committed!

Thanks askibinski (co-owner of Merge) for sponsoring this and thanks to the many participants in this issue for testing it!

Bartezz’s picture


- admin/settings/hierarchical_select/configs
* warning: array_merge_recursive() [function.array-merge-recursive]: Argument #2 is not an array in C:\xampplite\htdocs\mydomain\sites\all\modules\hierarchical_select\hierarchical_select.admin.inc on line 79.
* warning: array_merge_recursive() [function.array-merge-recursive]: Argument #1 is not an array in C:\xampplite\htdocs\mydomain\sites\all\modules\hierarchical_select\hierarchical_select.admin.inc on line 79.
* warning: Invalid argument supplied for foreach() in C:\xampplite\htdocs\mydomain\sites\all\modules\hierarchical_select\hierarchical_select.admin.inc on line 84.

The overview of all Hierarchical Select configurations is empty

I cannot reproduce this.

Hmmz, strange, it does this on my install out of the box?

I've edited the code to see what's up

function hierarchical_select_admin_configs() {
  $header = array(t('Hierarchy type'), t('Hierarchy'), t('Entity type'), t('Entity'), t('Context type'), t('Context'), t('Actions'));

  // Retrieve all information items
  $info_items = array();
  foreach (module_implements('hierarchical_select_config_info') as $module) {
	  echo $module."\n";
	  var_dump(module_invoke($module, 'hierarchical_select_config_info'));
	  echo "\n\n";
    $info_items = array_merge_recursive($info_items, module_invoke($module, 'hierarchical_select_config_info'));
  }

This cause the following to be printed;

hs_taxonomy_views
NULL


hs_taxonomy
array(0) {
}

That NULL is causing the error I think as array_merge_recursive needs arrays for it to work...

Sorry about my other posts these bugs started when I enabled HS so my first thought was it had to with this module...

Cheers

Wim Leers’s picture

If there are any problems remaining, please open a new issue for them.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Ujval Shah’s picture

Version: 6.x-3.x-dev » 6.x-3.0
Priority: Critical » Normal
Status: Closed (fixed) » Active
FileSize
11.43 KB
109.4 KB
64.48 KB

Issue still exists in this module too.

Please Find the attached screenshot.
any solution to this?

Best,
Drupal Rocking

Wim Leers’s picture

Version: 6.x-3.0 » 6.x-3.x-dev
Priority: Normal » Critical
Status: Active » Closed (fixed)

I can't believe this. Are you really opening an issue that's been closed for more than 4 months?

Please open a new issue ;)

Ujval Shah’s picture

FileSize
85.06 KB

@Wim Leers,

I just faced this issue; which i have mentioned above. actually may be a case that i am missing something from my end. so below is the process what i have done so far and how i came across this issue.

What i have done so far;
1. using Drupal 6.15
2. using following modules:
(2.a) CCK - 6.x-2.6
(2.b) Hierarchical Select - 6.x-3.0
(2.c) Content Taxonomy - 6.x-1.0-rc2
(2.d) Views - 6.x-2.8
(2.e) Chaos tool suite(ctools) - 6.x-1.2
3. i have page as a cck
in page cck i have created one field as a - Content Taxonomy Fields
4. i have created one vocabulary - for location.
having terms like,
Vocab: Location
Terms: Location
-- USA
-- Alamba
-- City of Alamba
-- New York
-- City of New York
5. i have created one view where i want the filer as i have described in the comment #141 of this thread.

But not able to get the results; getting an error !!!! REF - comment #141 of this thread.

Please Find the attached SQL Zip File of the work i have done so far, if you are configuring this on your end; Follow Process-1 and Process-2 mentioned in this post.

This is the same issue; reason i have not started new issue :) :)
and yes .... if you want me to open new issue i can put it separate from this one :) :)

Expecting Favorable reply.

Thanks,
Drupal Rocking

Ujval Shah’s picture

Version: 6.x-3.x-dev » 6.x-3.0
Priority: Critical » Normal
Status: Closed (fixed) » Active
FileSize
85.06 KB

@Wim Leers,

I just faced this issue; which i have mentioned above. actually may be a case that i am missing something from my end. so below is the process what i have done so far and how i came across this issue.

What i have done so far;
1. using Drupal 6.15
2. using following modules:
(2.a) CCK - 6.x-2.6
(2.b) Hierarchical Select - 6.x-3.0
(2.c) Content Taxonomy - 6.x-1.0-rc2
(2.d) Views - 6.x-2.8
(2.e) Chaos tool suite(ctools) - 6.x-1.2
3. i have page as a cck
in page cck i have created one field as a - Content Taxonomy Fields
4. i have created one vocabulary - for location.
having terms like,
Vocab: Location
Terms: Location
-- USA
-- Alamba
-- City of Alamba
-- New York
-- City of New York
5. i have created one view where i want the filer as i have described in the comment #141 of this thread.

But not able to get the results; getting an error !!!! REF - comment #141 of this thread.

Please Find the attached SQL Zip File of the work i have done so far, if you are configuring this on your end; Follow Process-1 and Process-2 mentioned in this post.

This is the same issue; reason i have not started new issue :) :)
and yes .... if you want me to open new issue i can put it separate from this one :) :)

Expecting Favorable reply.

Thanks,
Drupal Rocking

Wim Leers’s picture

Version: 6.x-3.0 » 6.x-3.x-dev
Priority: Normal » Critical
Status: Active » Closed (fixed)

You're breaking the Drupal etiquette here. Please *do* open a new issue. That makes it easier to follow than an issue with >100 comments. Thank you.

P.S.: never ever open old issues unless you're certain that it's a regression for a bug that was supposedly fixed. Since this issue is about the porting of functionality and not about a bug, that is most definitely not the case.