Closed (fixed)
Project:
TaxiSelect
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Dec 2009 at 03:51 UTC
Updated:
3 Jan 2010 at 02:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
alan d. commentedNice work on your first Drupal issue.
The function seemed to complex for the task at hand, so I have rewritten it to parse the parental path directly via SQL.
Comment #2
alan d. commentedThis one should take into account the parental path that the user entered. Try this one instead of the above patch.
Without recording the exact user entered path per term added, it will be impossible to always use this path on the final rendition of the term on the node, so this is a big "Won't fix"!!
I haven't got a decent testing environment (for this use case), so all feedback is appreciated.
Comment #3
mrchuckles commentedThanks for the kind words and the quick response.
taxiselect-single-parental-path-657846-3.patch works for my scenarios, although per design it suggests only a single path. Continuing with the original example:
If "D" is typed, it will suggest a single path D >> C >> A.
If "D, B" is typed (ie/the path prefix for the path not suggested), the prefix is honored and it correctly suggests D >> B >> A. If that path is added to a multi-select box it will revert to D >> C >> A since only the single term, not the whole path, is saved. I understand the "Won't fix!" there.
It comes down to a question of how you want to handle multiple paths ... suggest all or just one. For my use case, users should recognize the final term via any path so a single suggestion is fine, but suggesting all feels "more correct".
Comment #4
alan d. commentedIn regards to suggest all or just one, I'll stick to all. I think that this feature is going to be dropped in Drupal 7, so I don't want to invest to much time into it. ( Just thinking that a simple distinct in the query could do this. Happy to follow through if you want to try. )
I've pushed the second patch into the next dev release; these take up to 24 hours to come through
Cheers
Comment #5
mrchuckles commentedYou said "In regards to suggest all or just one, I'll stick to all.", but your patch suggests just one. I fear I may not have explained the error well enough since I did not give detailed instructions to reproduce in my original post. So here we go:
1. Create the A -> B, C -> D vocabulary I described in my original post and associate it with a content type.
2. In Content Management -> Taxonomy -> TaxiSelect Settings
* Change "Taxiselect trigger length" to 1, so the lookup occurs after entering the first character.
* Associate the widget with the same content type you associated the vocabulary.
* Settings for the vocabulary set both of the following:
- Use TaxiSelect for the selected content types
- Use TaxiSelect for administrating this vocabulary
3. Create a new content item
4. When selecting the term for the new vocabulary, enter only "D" and Taxiselct will suggest matching taxonomy terms/paths. This is the behavior with the various patches:
* If no patch is applied, the single suggestion is D >> B >> C >> A, which is not a valid path through the hierarchy. This is the original bug. See "Original-Bug.png".
* If my original patch is applied, both paths are suggested D >> B >> A and D >> C >> A. This is what I meant by "suggesting all paths". See "Mrchuckles-Patch-1.png"
* Using your committed patch, only D >> B >> A is suggested. So only one of the possible paths is presented. See "Commited-Patch-3.png"
As I said, for my use case presenting a single path is sufficient as the final term will be recognized via any path, but it doesn't feel like the right solution.
Comment #6
alan d. commentedSorry, a moment of dyslexia there, I think that I meant just the one.
Reason: The path is used for both the lookup and presentation, so displaying the one path by default would be mean more probability of consistency here. Displaying both, and the user selects the second, would result in the system showing the first, confusing the user even more.
Comment #7
mrchuckles commentedFair enough. Thanks for the fix.
Comment #8
alan d. commentedThxs for the feedback too :)