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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damien Tournoud’s picture

The issue comes from the identification of the root element. Here harmonized for consistency.

catch’s picture

Status: Active » Needs review

This is a patch. Could use a test.

Anonymous’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

andypost’s picture

Is this still an issue?

andypost’s picture

andypost’s picture

andypost’s picture

taxonomy.module hunk was lost

andypost’s picture

Re-roll against current HEAD

andypost’s picture

Seems 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

xjm’s picture

Status: Needs review » Closed (fixed)
andypost’s picture

Status: Closed (fixed) » Needs review

I think this should be commited

andypost’s picture

xjm’s picture

Version: 7.x-dev » 8.x-dev

Sorry, 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?

Status: Needs review » Needs work

The last submitted patch, 277200-detect-hierachy-type-d7.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
FileSize
1.15 KB
1.19 KB

re-roll for 7 & 8

andypost’s picture

#15: 277200-detect-hierachy-type.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 277200-detect-hierachy-type-d7.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
FileSize
1.25 KB

Re-rolled patch with test

EDIT: summary updated

no_commit_credit’s picture

Attached merely removes t() from the assertion message, which is not actually translated. Reference: http://drupal.org/simpletest-tutorial-drupal7#t

xjm’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs backport to D7

Ah, I understand now. So the current patch does not include any functional changes. Instead, it includes:

  1. A code cleanup.
  2. An automated test to codify the correct behavior.

Patch looks good to me. Thanks @andypost for pushing this forward. :)

catch’s picture

Title: Adding a term change the hierarchy type of the vocabulary to "single hierarchy" » Add tests for vocabulary hierarchy
Version: 8.x-dev » 7.x-dev
Category: bug » task
Status: Reviewed & tested by the community » Patch (to be ported)

Thanks, committed/pushed to 8.x, moving to 7.x for backport.

xjm’s picture

Issue tags: +Novice

Should be a simple backport.

andypost’s picture

Status: Patch (to be ported) » Needs review
FileSize
1.15 KB
xjm’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @andypost!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

That's certainly much easier to read. and yay for tests.

Committed and pushed to 7.x. Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -Novice, -Needs backport to D7

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.