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.
| Comment | File | Size | Author |
|---|---|---|---|
| #36 | 2019905-nr-bot.txt | 149 bytes | needs-review-queue-bot |
| #11 | interdiff.txt | 5.98 KB | claudiu.cristea |
| #11 | 2019905-11.patch | 8.03 KB | claudiu.cristea |
Issue fork drupal-2019905
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
Comment #0.0
Anonymous (not verified) commentedUpdated description
Comment #0.1
Anonymous (not verified) commentedupdated description
Comment #1
claudiu.cristeaMoving 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.
Comment #2
claudiu.cristeaHere's a fix for D8.
Comment #3
claudiu.cristeaComment #8
claudiu.cristeaFixed tests.
Comment #11
claudiu.cristeaOuch!
Comment #13
claudiu.cristeaComment #14
amateescu commentedNot really related to entity reference :)
Comment #19
merilainen commentedBehavior 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]
Comment #26
pameeela commentedTransferring credit from #1981404: Hierarchy information is lost on taxonomy term edit page
Comment #29
mohit_aghera commentedI 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.
Comment #30
mohit_aghera commentedComment #31
damiengr commentedWith 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()
Comment #36
needs-review-queue-bot commentedThe 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.