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.
A taxonomy tree involving more than 5 nested categories can't be treated with the module.
Comment | File | Size | Author |
---|---|---|---|
#6 | ssu.png | 53.91 KB | rconstantine |
Comments
Comment #1
rconstantine CreditAttribution: rconstantine commentedSorry folks. I'm going to be lazy and post the code changes inline, rather than attach a patch. You can shoot me later.
In taxonomy_super_select_form_alter, delete everything after
Take care to leave necessary closing braces.
Immediately after the code above and before the remaining braces, add this:
The function should end with three closing braces in case you deleted them.
Then add this function:
From my small testing session, everything seems to be the same as before in terms of function.
Comment #2
rconstantine CreditAttribution: rconstantine commentedI should have checked other issues before posting, but---
I saw the alphabetizing patch at http://drupal.org/node/136319, so incorporated it. My new function should now be:
and _tss_branch() should now be:
Again, sorry for the inline code.
Comment #3
rconstantine CreditAttribution: rconstantine commentedI've been using this code just fine in my own module, cck_taxonomy_super_select_ultra. Could probably be committed to this project as-is.
Comment #4
SemperFideles CreditAttribution: SemperFideles commentedI've tried this "patch" twice on two sites and the taxonomy is still not organized alphabetically on my site.
Comment #5
rconstantine CreditAttribution: rconstantine commentedWell what do you know. Not sure how I missed that glaring error! Would have been nice to know about it sooner. At least the nesting part works. I have verified that. I wonder if I had too small of a test taxonomy before or something. Or maybe I entered it in in alphabetical order and didn't realize it, so it was spitting out correctly for wrong reasons. In any case, I'll fix it in my module, and if there is an easy translation to this one, post the changes.
Comment #6
rconstantine CreditAttribution: rconstantine commentedNo, wait a minute. I just realized mine is alphabetized, or pseudo-alphabetized if you'd like to call it that. I'm not sure if I adjusted things since the posted code above or not. Let me know if you get the same results as the screen shot.
Basically, each level is in order with leaf terms alphabetized, then branch terms. There is an exception. If you've set the option (in my module) to have branch terms 'checkable', then they appear first inside of themselves (bolded) before the alphabetized leaf terms. At least, I think so.
So for the first level, the leaves are "baseball, football, and new term" which are in order, followed by the branches, "fish, indoor activities, outdoor activities". Inside of fish, there are leaf terms of "fish and deep sea fishing" so the branch term comes first. Indoor activities looks similarly okay. Outdoor activities seems to not be in leaf/branch order and seems to be the only problem here. Perhaps I have an issue when a child branch comes before the current branch alphabetically in getting that child to the proper place in the list. So other than that problem, do you see any other deviations from my explanation of how it should work?
Comment #7
SemperFideles CreditAttribution: SemperFideles commentedI don't know. I had 7 taxonomies and they would not sort alphabetically for me. I ended up having to force the issue by assigning different weights to the terms. I even tried exporting the table of the main vocabularies, re-ordering them in the sql file and then re-importing them so they were in the table in alphabetical order and the selections were still all jumbled in the category selections. It mattered not if I had the module installed or not installed.
Comment #8
rconstantine CreditAttribution: rconstantine commentedWell, although I may not fix this version of the code, I'll very likely fix the version of it in my module since that's the one I use and I'd like it to be alphabetic. Thanks for the info.
Comment #9
NancyDruIt worked for me, although, admittedly, I have a small vocabulary. I think it is better, at this point, to get the unlimited depth code into the module. Ordering, if it is not fixed can be accomplished with weighting.
Comment #10
NancyDruThis is now in 5.x-1.10. If the alphabetization is not correct, please open a new issue.
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.