Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
taxonomy.module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
13 Dec 2011 at 04:24 UTC
Updated:
27 Sep 2016 at 13:36 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
xjmTagging.
Comment #2
chris.leversuch commentedI'll have a go at this one.
Comment #3
chris.leversuch commentedFirst attempt
Comment #4
chris.leversuch commentedForgot to include grep results for review. I don't think the remaining occurances need changing
Comment #5
acouch commentedAwesome start @chris.leversuch. I noticed a couple of small things. There was an extra space before the the multiple constant, I added the constants for the cases in the help section, and have a question about the following:
Shouldn't that be left out since it is referring to the value of the parent?
Comment #6
xjmI think @acouch is right about #5; that query is checking whether the term has any parents rather than the hierarchy of the vocab. I also noticed one other thing:
For these, should we avoid relying on the literal value of the disabled and multiple constants being less than the multiple? I think it might be better to check for:
Comment #7
chris.leversuch commentedHere's a new patch based on #5 with the changes from #6
Comment #8
xjmHm, for these two, let's make the order of operations more explicit:
if (($vocabulary->hierarchy == TAXONOMY_HIERARCHY_DISABLED || $vocabulary->hierarchy == TAXONOMY_HIERARCHY_SINGLE) && count($tree) > 1)Edit: Actually, how about this (not sure why I didn't think of this earlier):
if (($vocabulary->hierarchy != TAXONOMY_HIERARCHY_MULTIPLE) && (count($tree) > 1))Comment #9
chris.leversuch commentedChanged all 4 occurences from #6 to match the new logic in #8
Comment #10
xjmThanks @chris.leversuch. Codewise, the patch looks correct to me now. Two minor questions:
Sorry that I did not notice this before, but we need to move this comment up to the preceding line since it's now over 80 chars. I'd just reroll/RTBC with that change myself, except...
These two additions are new to the latest patch in #9. Is that intentional? They don't seem to be related to the issue.
Comment #11
chris.leversuch commentedHa, oops. They're from #1370060: Add cross-references between taxonomy_vocabulary_load() and taxonomy_vocabulary_machine_name_load(). I obviously didn't have a clean working dir when I created the patch.
Try this one.
Comment #12
xjmAlright, this looks good now. Thanks @chris.leversuch!
Comment #13
catchLooks good. Committed/pushed to 8.x.
Comment #14
chris.leversuch commentedHere's a D7 version
Comment #15
acouch commentedI reviewed this and there are no instances of hierarchy that I could find that were missed.
Comment #16
webchickThis seems like a good improvement, but not sure it really makes sense for Drupal 7. It's not fixing a bug or adding a new capability, merely cleaning things up. If you feel strongly the opposite, we can discuss, though.
Moving back to 8.x and we should get a change notice for this.
Comment #17
izus commentedAdded change notice http://drupal.org/node/1385926
Comment #19
xjmComment #19.0
xjmUpdated issue summary.
Comment #20
wim leersFollow-up for this issue: #2807263: Impossible to write unit tests involving Vocabulary, because TAXONOMY_HIERARCHY_(DISABLED|SINGLE|MULTIPLE) are defined in taxonomy.module instead of VocabularyInterface.