Problem/Motivation

Since the update to 1.2.46, some entries in hierarchical select lists are missing. I am not yet sure which exact conditions trigger the issue.

Steps to reproduce

1. Create a hierarchy of tags like this:

2. Create an entity reference field referencing the tags with the following form display settings:
3. Go to the entity form and try to reference "Example B". It is not included in the list:
Even when explicitly searching for it, it does not show up. With 1.2.45, it shows up as expected.

Remaining tasks

- Locate the bug
- Fix the bug
- Add test coverage (?)

Issue fork tagify-3567274

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

nico.b created an issue. See original summary.

shank115’s picture

StatusFileSize
new7.98 KB

I am also able to consistently reproduce this issue on the latest version.

Observed behavior with hierarchical taxonomy terms in Tagify autocomplete:

  • Parent taxonomy terms cannot be selected when they have child terms.
  • If a top-level parent term does not have any children, it does not appear at all in the autocomplete list.
  • Child terms continue to appear and are selectable.
Anonymous’s picture

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

Anonymous’s picture

Status: Active » Needs review

Hi,

I've investigated this issue and successfully managed to replicate it locally with the steps provided in issue description and #1.

I've found that this happens due to how module js library handles term suggestions. In 1.2.46 version 'Parent Selection' option is introduced. If this setting is disabled, then tagify.js incorrectly filters out terms that have no parents. In my MR I've tweaked the js to allow terms to be selectable, but then I don't see any difference in having parent selection option either enabled or disabled.

I'm moving this to needs review.

gxleano’s picture

Thanks @Jernej Mramor to work on this, but in this case we need to keep the parent selection logic, so could be cases where the parent should not be selected.

I'm currently working on a fix.

gxleano’s picture

Version: 1.2.46 » 1.2.x-dev
Assigned: Unassigned » gxleano
Status: Needs review » Needs work

gxleano changed the visibility of the branch 3567274-missing-entries-in to hidden.

gxleano’s picture

Assigned: gxleano » Unassigned
Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • gxleano committed 8ef30739 on 1.2.x
    Issue #3567274: Fix missing entries on dropdown
    
gxleano’s picture

It will be included in release 1.2.47

gxleano’s picture

Status: Fixed » Closed (fixed)