Where: on the page www.example.com/admin/structure/taxonomy/<vocabulary>
What happening: The buttons "Save" and "Reset to alphabetical" disappear if a taxonomy term has more than 1 parent
What is expected: Even with multiple relations, the buttons should still be there.

How to reproduce:

  1. add a new vocabulary in /admin/structure/taxonomy
  2. add 2 or more parent terms
  3. add one child term
  4. edit the child term and holding ctrl select the 2 parent terms on Relations at /taxonomy/term/3/edit?destination=admin/structure/taxonomy/<vocabulary>
  5. "Save" and "Reset to alphabetical" buttons disappeared from /admin/structure/taxonomy/auto_parts

The problem here is how to represent in the GUI a term having 2 or more parents? Changes in this interface are done by dragging and dropping terms in the list. The final result of how this list looks like is saved on the system.

I think the reason the system today hides the save button is to avoid overriding the multiple parents of the terms. If there is a better way to visually represent this complex hierarchy then part of the problem is solved.
Apparently it cannot be solved without developing a graphical solution, as I've said on comment #10

The following image shows the screen with the buttons, before assigning more than one relation for a specific term.

"Save" and "Reset to alphabetical" buttons

Proposed resolution

  • hold CTRL to drag terms to other parents, keeping the already existing parents.
  • highlight the multi-parented terms with a different color when hovered
  • identify the multi-parented term with text ("multi parented") in a visual way (which way?)
  • identify the multi-parented term its term id in order to better identify them across other parents
  • add a button or something else on the row of the term to allow deleting it from a selected parent.
  • add an operation release from other parents to switch this term as single-parented to the nearest parent. (needs more discussion)

I made an image of this proposal:
Highlighted multi-parented taxonomy terms

Edit 1: Propoesed solution on comment #18
Edit 2:updated as of comment #19 and #20

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mac_Weber’s picture

I just figured out this is limited by the following conditional. What is the reason for limiting $vocabulary->hierarchy < 2?

405   if ($vocabulary->hierarchy < 2 && count($tree) > 1) {
406     $form['actions'] = array('#type' => 'actions', '#tree' => FALSE);
407     $form['actions']['submit'] = array(
408       '#type' => 'submit',
409       '#value' => t('Save')
410     );
411     $form['actions']['reset_alphabetical'] = array(
412       '#type' => 'submit',
413       '#value' => t('Reset to alphabetical')
414     );
415     $form_state['redirect'] = array($_GET['q'], (isset($_GET['page']) ? array('query' => array('page' => $_GET['page'])) : array()));
416   }
attheshow’s picture

Confirmed. I was able to replicate this issue on Drupal 7.20.

attheshow’s picture

This also breaks the ability to sort the list of terms via drag & drop for some reason. You can't reorder terms when one of your terms has two parents.

attheshow’s picture

I made a patch for this since it's unclear what the reasoning behind the < 2 code is on the hierarchy.

attheshow’s picture

Status: Active » Needs review
askibinski’s picture

Status: Needs review » Needs work

I have this issue and tested the patch on a long (multiple page) hierachical taxonomy list.

The buttons re-appeared, but saving the page throws a fatal error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '5696-5538' for key 'PRIMARY': UPDATE {taxonomy_term_hierarchy} SET parent=:db_update_placeholder_0 WHERE (tid = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => 5538 [:db_condition_placeholder_0] => 5696 ) in taxonomy_overview_terms_submit() (regel 522 van /Users/albert/Sites/drupal7/modules/taxonomy/taxonomy.admin.inc).

I'm not entirely sure if this is caused by the patch (I can't save it without the patch so difficult to test)

josh@pixael.com’s picture

Priority: Normal » Major

Guys same problem here. Changed priority to major because I can't change terms order anymore...
I applied the patch but got same error of #6 when saving.

josh@pixael.com’s picture

Version: 7.x-dev » 7.22

changed to 7.22

Jooblay.net’s picture

Could this be theme related? It looks like your on Seven?

Mac_Weber’s picture

Priority: Major » Normal

@j0sh bug reports must be done against the dev version.

@leseeen this is not theme related, it is on drupal core.

IIRC it can be saved if you edit each single term separated. You cannot do batch updates on this list.

The problem here is how to represent in the GUI a term having 2 or more parents? Changes in this interface are done by dragging and dropping terms in the list. The final result of how this list looks like is saved on the system.

I think the reason the system today hides the save button is to avoid overriding the multiple parents of the terms. If there is a better way to visually represent this complex hierarchy then part of the problem is solved.

Anonymous’s picture

Subscribe

Anonymous’s picture

Subscribe

Mac_Weber’s picture

Version: 7.22 » 7.x-dev
Media Crumb’s picture

was this ever fixed?

Mac_Weber’s picture

@Media Crumb, apparently it cannot be solved without developing a graphical solution, as I've said on comment #10

Pancho’s picture

Title: Missing "Save" and "Reset to alphabetical" buttons on taxonomy terms list if a term has more than 1 parent » Improve the reordering and reparenting UI if any term has a multiple hierarchy
Version: 7.x-dev » 8.x-dev
Category: bug » task

On D8 the UI seems broken anyway, but this aspect still applies.
We could say "By design", but then it could still be improved or at least explained by a status message.
So moving to D8, our current dev branch.

Pancho’s picture

Probably should be backported.

Mac_Weber’s picture

I have a solution proposal:

  • hold CTRL to drag terms to other parents, keeping the already existing parents.
  • highlight the multi-parented terms with a different color
  • identify the multi-parented term with text ("multi parented")
  • identify the multi-parented term its term id in order to better identify them across other parents
  • add an operation release from other parents to switch this term as single-parented to the nearest parent.

I made an image of this proposal:
Highlighted multi-parented taxonomy terms

Pancho’s picture

Thanks for the cool sketch of your idea!

What I intuitively like about it is the CTRL + drag'n'drop feature that matches how items are copied in most file browsers and many other OS interfaces.
Some might say however that should only be used for copying items and we're basically creating something like a new instance of the child term. CTRL+SHIFT might be an alternative as it's being used for creating links which more closely matches what we're doing here.
However, I'm not sure our current tabledrag supprots this or can be easily tweaked. There's been some moves to #1524414: Rewrite tabledrag.js to use jQuery UI but that seemingly didn't work out well. We'd need to see how it can be made possible.

The "release other parents" link however is unintuitive and very much irritating. Why would you click on some button in one row to make things change in other rows? Rather we should support dragging the "instance" out of the table to remove it from a parent.

And the "multi parented" indicator isn't so nice either. We might want to add "(parent: Parent B)" to it.
Also, not all multi-parented terms should be colored. If you have several of them, this would make it harder to grasp, not easier. We should better only highlight other instances of the same term if one instance is hovered or even grabbed.

Otherwise this UI-wise looks like a major improvement, given we can make it work.

But first of all let me get the basics:

  1. It seems that currently in D8 the whole help system doesn't work. I'm enabling the help module and no help text is displayed. Can you reproduce this?
  2. Apart from that we shouldn't rely on the help system, but throw a message after one term has been multiparented. Alternatively, we might want to reintroduce the confirmation form that according to #1197240: Editing Vocabulary changes a Multiple Hierarchy Term list to be marked as a Flat list must have existed until D6. Both improvements would be backportable, while your larger improvement would be D8-only, if at all. Thoughts?
Mac_Weber’s picture

@pancho

The "release other parents" link however is unintuitive and very much irritating. Why would you click on some button in one row to make things change in other rows? Rather we should support dragging the "instance" out of the table to remove it from a parent.

I'm not sure, but I still think we need to provide a way to remove from that single parent, and also to make the term attached only to a chosen parent in an easy way.

And the "multi parented" indicator isn't so nice either. We might want to add "(parent: Parent B)" to it.

I also changed my mind right after posting. However, displaying like you said is not a good option, too. Imagine a term with 3 or more parents... we don't want all the names there. We need to develop this idea of a visual indicator.

Also, not all multi-parented terms should be colored. If you have several of them, this would make it harder to grasp, not easier. We should better only highlight other instances of the same term if one instance is hovered or even grabbed.

I had the same idea later! =D

Mac_Weber’s picture

Issue summary: View changes

Pdd propoesed solution on comment #18.
Improve problem description.

Pancho’s picture

still think we need to provide a way to remove from that single parent, and also to make the term attached only to a chosen parent in an easy way.

This would be just to make it even easier, right? I think we shouldn't do that anyway. It seems like an edge case. Also, even if other instances are highlighted, there might be more of them on the next pages, so more instances might be removed than the user knew about. Also, for single click operations, we have to provide a confirmation message. It would be much easier in this case to go to the edit page and reparent the term.
For quick, minor changes the visual support would be nice, however.

Imagine a term with 3 or more parents... we don't want all the names there.

Not a problem. My proposal was:

Green
-- Tree (Green)
-- Leaf
Large
-- Skyscraper
-- Tree (Large)
Old
-- Turtle

It scales up to any number of parents. That way, when dragging an instance somewhere else, the user would also know where the item was dragged from:

Green
-- Tree (Green)
-- Leaf
Large
-- Skyscraper ____
Old               |
-- Tree (Large) <-'
-- Turtle

An intuitive visual indicator would probably be even nicer, but shouldn't hold us up to much at this point.

Central question is: can we do it with current tabledrag.js, or what would we have to do to make it work. I'm not sure I will find time to figure this out in the next days, but if you'd find out something that'd be nice, and otherwise just ping me, so this doesn't get lost somewhere in the huge issue queue.
I can remember that some years ago I was unhappy with drag'n'drop being disabled here, so I'm really interested in getting this improved as much as possible.

Mac_Weber’s picture

@Pancho I don't see any reason for using help. There are some instructions on this page already about dragging the items. We just need to add this part of dragging with multi-hierarchy.

I don't think I understand your example... In my image there is the term Child 2 being used by 2 different parents, then it is displayed under both parents. In your example you are listing only the original parent and you are not displaying a "copy" of the term under the original parent. If it has 3 parents it will display only the original parent name and only under the last parent?

I don't know the answer for your question about tabledrag.js.

Pancho’s picture

I don't see any reason for using help. There are some instructions on this page already about dragging the items.

The existing instructions on the page are provided by the help module. But yes, as I said, we shouldn't rely on the help module being enabled.

We just need to add this part of dragging with multi-hierarchy.

"just" is good... ;)

In your example you are listing only the original parent and you are not displaying a "copy" of the term under the original parent.

??? No, I'm not.
Isn't it obvious that "Tree" is listed under both of its parent terms, "Green" and "Large". And after the latter instance gets dragged to "Old", it's displayed there.

Media Crumb’s picture

Sorry if this sounds dense, but even if it is a graphical issue, is there a way to solve it currently without using the admin area? I have a giant list of terms with several parents. I'd like to be able to sort all those terms into 1 parent in Alphabetical order. I don't mind playing around with the code. I guess I'm just looking for a solution in the short term.

Media Crumb’s picture

Issue summary: View changes

updated as of comment #20

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

adanielyan’s picture

This thread seems to be abandoned, but I'd like to resurrect it as the problem still exists. Was anyone able to find a solution/workaround for this?

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.