Vocabulary hierarchy was always changed to single after term edit. This been fixed in #762604: Taxonomy terms list broken, term add/edit forgets it's parent
But we still has no test for "flatness" and this issue fixes it with more clear/readable condition in code
To reproduce:
- Create a new vocabulary, on the term list page, you see "flat vocabulary"
- Add any term, on the term list page, the vocabulary type changed to "single hierarchy"
Expected behavior: the vocabulary type should stay in "flat vocabulary" as long as there is no parent/child relationship in the vocabulary.
Comment | File | Size | Author |
---|---|---|---|
#23 | 277200-vocab7.patch | 1.15 KB | andypost |
#19 | vocab-hierarchy-277200-19-test.patch | 1.24 KB | no_commit_credit |
#18 | 277200-detect-hierachy-type-18.patch | 1.25 KB | andypost |
#15 | 277200-detect-hierachy-type.patch | 1.19 KB | andypost |
#15 | 277200-detect-hierachy-type-d7.patch | 1.15 KB | andypost |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedThe issue comes from the identification of the root element. Here harmonized for consistency.
Comment #2
catchThis is a patch. Could use a test.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedThe last submitted patch failed testing.
Comment #4
andypostIs this still an issue?
Comment #5
andypostFix with test
EDIT: parent for [root] is not set #762604: Taxonomy terms list broken, term add/edit forgets it's parent
EDIT2: new issue about hierarchy #763380: Do not use \Drupal\taxonomy\TermStorageInterface::loadTree() in \Drupal\taxonomy\Form\OverviewTerms::buildForm()
Comment #6
andypostRe-roll last patch suppose no need to wait debatable #763380: Do not use \Drupal\taxonomy\TermStorageInterface::loadTree() in \Drupal\taxonomy\Form\OverviewTerms::buildForm()
Comment #7
andyposttaxonomy.module hunk was lost
Comment #8
andypostRe-roll against current HEAD
Comment #9
andypostSeems this was fixed in #846524: Terms cannot be manually reordered by weight.
So patch still useful
- Adds a test
- isset() a bit faster then array_shift() + compare
Comment #10
xjmComment #11
andypostI think this should be commited
Comment #12
andypost#8: 277200-detect-hierachy-type-d7.patch queued for re-testing.
Comment #13
xjmSorry, I thought you said in #9 that the issue was fixed. Can we update the title and issue summary to reflect what the current patch is for?
Comment #15
andypostre-roll for 7 & 8
Comment #16
andypost#15: 277200-detect-hierachy-type.patch queued for re-testing.
Comment #18
andypostRe-rolled patch with test
EDIT: summary updated
Comment #19
no_commit_credit CreditAttribution: no_commit_credit commentedAttached merely removes
t()
from the assertion message, which is not actually translated. Reference: http://drupal.org/simpletest-tutorial-drupal7#tComment #20
xjmAh, I understand now. So the current patch does not include any functional changes. Instead, it includes:
Patch looks good to me. Thanks @andypost for pushing this forward. :)
Comment #21
catchThanks, committed/pushed to 8.x, moving to 7.x for backport.
Comment #22
xjmShould be a simple backport.
Comment #23
andypostComment #24
xjmThanks @andypost!
Comment #25
webchickThat's certainly much easier to read. and yay for tests.
Committed and pushed to 7.x. Thanks!
Comment #26.0
(not verified) CreditAttribution: commentedUpdated issue summary.