Problem/Motivation

Steps to reproduce:
1. Create a vocabulary with two terms (A & B), both in root.
- A
- B
2. Make B a child of A AND a child of root. Save.
- A
-- B
- B
3. Edit B's. Notice that the only highlighted parent term is A. Root is not highlighted.

This is observable in UI but reveals a bug of \Drupal\taxonomy\TermStorage::loadParents(). The method filters out from the root parent from its result.

Proposed resolution

Fix \Drupal\taxonomy\TermStorage::loadParents()

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork drupal-2019905

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Anonymous’s picture

Issue summary: View changes

Updated description

Anonymous’s picture

Issue summary: View changes

updated description

claudiu.cristea’s picture

Title: Multiple parents values are not selected in parent terms multi-select » Root parentMultiple parents values are not selected in parent terms multi-select
Version: 7.x-dev » 8.0.x-dev
Issue summary: View changes
Status: Active » Needs review
Issue tags: +Needs backport to D7
StatusFileSize
new1.6 KB

Moving this to be fixed first in 8.0.x. Added a test to reveal the bug. The test doesn't show the UI failure but reveals directly the cause.

claudiu.cristea’s picture

Title: Root parentMultiple parents values are not selected in parent terms multi-select » Term::loadParents() is missing the <root> parent from the returned list
StatusFileSize
new4.18 KB

Here's a fix for D8.

claudiu.cristea’s picture

Title: Term::loadParents() is missing the <root> parent from the returned list » TermStorage::loadParents() is missing the <root> parent from the returned list

The last submitted patch, 1: test_fail.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 2: 2019905-2.patch, failed testing.

The last submitted patch, 1: test_fail.patch, failed testing.

The last submitted patch, 2: 2019905-2.patch, failed testing.

claudiu.cristea’s picture

Status: Needs work » Needs review
StatusFileSize
new3.23 KB
new1.71 KB

Fixed tests.

Status: Needs review » Needs work

The last submitted patch, 8: 2019905-8.patch, failed testing.

The last submitted patch, 8: 2019905-8.patch, failed testing.

claudiu.cristea’s picture

Status: Needs work » Needs review
StatusFileSize
new8.03 KB
new5.98 KB

Ouch!

claudiu.cristea queued 11: 2019905-11.patch for re-testing.

claudiu.cristea’s picture

Issue tags: +ER check for RC
amateescu’s picture

Issue tags: -ER check for RC

Not really related to entity reference :)

mgifford queued 11: 2019905-11.patch for re-testing.

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.

merilainen’s picture

Status: Needs review » Needs work

Behavior still exists, but cannot apply patch. I get:

$ patch -p1 < 2019905-11.patch
patching file core/modules/forum/src/Form/ForumForm.php
Hunk #1 succeeded at 125 (offset -4 lines).
patching file core/modules/taxonomy/src/TermStorage.php
Reversed (or previously applied) patch detected! Assume -R? [n]

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.

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.

pameeela’s picture

mohit_aghera made their first commit to this issue’s fork.

mohit_aghera’s picture

Issue tags: +Bug Smash Initiative

I came across this issue while reviewing one issue (https://www.drupal.org/project/drupal/issues/1981404) from Bug smash initiative.

Performed the following tasks:
- Re-roll for the 9.3.x. There have been some changes in implementation.
Primarily due to changes in loadParents() method. I've adopted code accordingly.
- All other test cases seem to be passing except Migration test case.
I've created a PR to see if we have any additional failures.
- Tagging with Bugsmash initiative.

mohit_aghera’s picture

Status: Needs work » Needs review
damiengr’s picture

With the latest patch applied i'm getting errors from the Facets contrib module :

Error : Call to a member function id() on null in Drupal\facets\Plugin\facets\hierarchy\Taxonomy->taxonomyGetParent()

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.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new149 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

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.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.