Problem/Motivation

After updating to version 2.0.6, the SHS widget no longer renders the hierarchical select list. Instead, the widget outputs empty HTML, so no select fields or hierarchy are displayed.
Drupal: 10.6.14
PHP: 8.4

Proposed resolution

Downgrading to 2.0.5

Issue fork shs-3613802

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

eryk created an issue. See original summary.

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

dkmishra’s picture

Version: 2.0.6 » 2.0.x-dev
Status: Active » Needs review
StatusFileSize
new2.37 KB

Patch attached, please review.

pasqualle’s picture

the patch fixed the issue

webnicola’s picture

Confirmed: the patch fixed the issue for me as well on Drupal 10.6.15 with SHS 2.0.6. Thanks!

alrueden’s picture

The patch fixed the issue. I tried it with both Drupal 10.6.14 and 10.6.15 and noticed no additional problems. Thanks!

jonathan_hunt’s picture

I am getting the exact same error on 3.0.0-beta6. Reverting to 3.0,0-beta5 solved the problem. The patch #4 also applied against 3.0.0-beta6 on Drupal 10.6.15 to solve the issue.

fabianfiorotto’s picture

The patch didn't work for me. The only solution is to roll back to version 2.0.5.

kovalevm’s picture

I confirm the issue. The patch didn't help, so I had to roll back to version 2.0.5. Please help!

dkmishra’s picture

StatusFileSize
new2.48 MB

Re-tested this directly against the 2.0.6 tag to confirm the fix.

  1. git checkout 2.0.6 in modules/contrib/shs, then drush cr -- confirms the bug: the Category field renders with no select/hierarchy widgets at all (empty output), matching the original report.
  2. Downloaded the patch: wget https://www.drupal.org/files/issues/2026-08-02/3613802-empty-widget-output.patch
  3. Applied it cleanly with patch -p1 < 3613802-empty-widget-output.patch
    -- patches src/Cache/ShsTermCacheDependency.php and src/Plugin/Field/FieldWidget/OptionsShsWidget.php with no rejects.
  4. drush cr, reloaded node/add/article — the Category widget now renders correctly with the full hierarchical select cascade.

Screen recording attached showing the before/after. Since this reproduces and resolves cleanly on the 2.0.6 tag. Happy to rebase the MR if needed.

kovalevm’s picture

Thank you for your detailed testing and the video! I really appreciate your work on this issue.

I confirm that I also tested the patch (#4) on my production site, but unfortunately it did not resolve the issue for me. The widget still rendered empty HTML after applying the patch, clearing caches, and even rebuilding the site's container.

Here are my environment details:

  • Drupal: 10.6.15
  • PHP: 8.4
  • SHS: 2.0.6
  • Site: Production environment with many custom modules and fields

What I tried:

  1. Applied the patch cleanly (no rejects)
  2. Cleared all caches (drush cr, also manually cleared OPcache)
  3. Rebuilt the container (drush rebuild)
  4. Tried on different browsers and with different users
  5. Checked the widget settings in form-display
  6. The only thing that worked for me was rolling back to version 2.0.5.

I'm wondering if there might be a conflict with another module, or perhaps with the way the field is configured in my setup. Here are the fields I'm using SHS with:

  • og_group_ref (entity reference to Content, bundle: Community)
  • field_field_community_term (entity reference to Taxonomy term, vocabulary: Community categories)

Could there be a specific configuration or dependency that affects the patch's effectiveness?

Do you think this could be related to Organic Groups? My fields are both OG-related, and the issue only appeared after updating SHS.

dkmishra’s picture

Thanks for the detailed environment information, @kovalevm — that's very helpful in narrowing this down.

Since the patch has been confirmed to work for some of us, this may indicate a separate underlying issue rather than a problem with the patch itself.

Could you check whether a plain taxonomy reference field (not OG-related) using the SHS widget renders correctly on the same site? That would help us determine whether the issue is specific to OG or related to a any other configuration issue on your installation.

kovalevm’s picture

I updated the module to the latest version 2.0.7 and tested it on other content types. The issue persists not only with the "Community Entry" (Organic Group) content type, but also with all other content types if I select the "SHS" category selection type. Please help!

eryk’s picture

Thanks for working on this. Unfortunately, I can confirm that the issue is still present in SHS 2.0.7.

After updating to 2.0.7, the widget still renders empty HTML and the hierarchical select list is not displayed. Downgrading to 2.0.5 resolves the issue again.

kovalevm’s picture

I confirm, the problem persists and can only be solved by rolling back to 2.0.5.

eduardo.heuvel’s picture

I can confirm this issue (or similar, maybe because of the same bug) on SHS version 2.0.7.

In my setup, when editing an existing node that already has values saved, the select options themselves render correctly, but the previously saved selections are immediately wiped/reset to empty.

Downgrading back to 2.0.5 resolves the issue completely—the saved values are properly pre-selected on node edit, and the conditional logic works as expected.