While I've done a lot of web development in Python and Javascript, I'm new to Drupal and PHP. As a result, maybe I missed something that experienced Drupal folks would have picked up on right away. But it's worth being user-friendly to those who are new to a given framework. With that in mind, I'd like to suggest a small change to the API documentation. I cut and pasted into a custom module the bit of code at the beginning of the API documentation that is designed to show newbies like myself how to utilize a hierarchical select widget in custom forms. I then lost a couple of days to the task of trying to figure out why I was getting fatal error messages at hierarchical_select.module line 1502 or 1557 (depending on whether I used the nodeapi or menu hook to build my form), a series of warnings at lines 1658 and 1944 in the same module, and a hierarchical select widget that had absolutely nothing in it and seemed to be ignoring all of my config settings. All of these problems went away and everything worked perfectly when I simply changed the line in the sample code in the API documentation from "'module' => 'taxonomy'" to "'module' => 'hs_taxonomy'". I'd suggest either making that change in API.txt or adding to the documentation a simple description of any preliminary configuration setup that needs to be done in a custom module if using the hooks from the taxonomy instead of the hs_taxonomy module.
Comments
Comment #1
wim leersThat's indeed something that's a leftover from HS 2. I'll fix it :)
Second, I'll make sure that there's a piece of code to ensure that the entered implementation actually exists, or display an error message otherwise, which would aid in tracking this down.
Also, a new, tutorial-ish piece of documentation is coming up on how to write a HS implementation. That should simplify that part of HS as well.
Thanks for reporting this! :)
Comment #2
ricardo37 commentedThanks for the quick response and the proposed extra failsafe and documentation. Great module by the way (which is why I was willing to spend time trying to get it to work for me).
Comment #3
wim leersDone :)
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.