Created on 13 July 2022, almost 2 years ago
Updated 18 April 2023, about 1 year ago

With https://www.drupal.org/community/events/drupal-10-global-porting-day-jul... ā†’ coming up and https://www.drupal.org/about/core/blog/the-project-update-bot-is-being-r... ā†’ starting to create automated update suggestion issues like šŸ“Œ Automated Drupal 10 compatibility fixes Fixed and #3290604: Automated Drupal 10 compatibility fixes ā†’ , it's time to start looking at D10.

I updated `core_version_requirement: ^8.8 || ^9 || ^10` in shs.info.yml, but to get an idea of how much work this is going to be. The field configuration worked fine.

However when adding or editing the content type with the field configure to use SHS in the form display, the field is rendered as just a text field. If you add a valid term id, the node will be saved and render as expected.

Somehow no errors are generated.

šŸŒ± Plan
Status

Fixed

Version

2.0

Component

Compatibility with other modules

Created by

šŸ‡ŗšŸ‡øUnited States kreynen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • šŸ‡ŗšŸ‡øUnited States oheller

    If you open the browser inspector, you will see an error about Once not being a function. This is because jquery.once has been removed from core: https://www.drupal.org/node/3158256 ā†’ .

    We need to update the library to call core/once and update AppView.js, around ln:42 to properly use once. I've tried but haven't succeeded yet.

  • šŸ‡ŗšŸ‡øUnited States oheller

    We have updated the js/views/AppView.js LN: 44 with:

    once('shs', this.$el)[0].classList.add('hidden');
    

    This adds the hidden class but we don't have the taxonomy terms added to the containers.

  • šŸ‡ŗšŸ‡øUnited States kreynen

    @rahul1707 was that patch created from the current 2.0.x branch?

    shs_d10_compatibility_issue_fixes-3349877-1_0.patch:153: trailing whitespace.
            $parents = []; 
    error: patch failed: modules/shs_chosen/src/Plugin/views/filter/ShsChosenTaxonomyIndexTidDepth.php:6
    error: modules/shs_chosen/src/Plugin/views/filter/ShsChosenTaxonomyIndexTidDepth.php: patch does not apply
    error: patch failed: src/Plugin/Field/FieldFormatter/EntityReferenceShsFormatter.php:69
    error: src/Plugin/Field/FieldFormatter/EntityReferenceShsFormatter.php: patch does not apply
    error: patch failed: src/Plugin/views/filter/ShsTaxonomyIndexTidDepth.php:42
    error: src/Plugin/views/filter/ShsTaxonomyIndexTidDepth.php: patch does not apply
    

    I've created an issue branch and started making the changes there. If you could use that as a starting point, I'm happy to review.

  • Upgrade status ā†’ has these D10 compatibility warnings against 2.0.0-rc3, and on a quick look, they still seem to apply latest 2.0.x-dev

    Simple hierarchical select 2.0.0-rc3
    Scanned on Thu, 03/23/2023 - 16:51.
    
    4 warnings found.
    
    web/modules/contrib/shs/shs.libraries.yml:
    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
    ā”‚  STATUS  ā”‚ LINE ā”‚                           MESSAGE                            ā”‚
    ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
    ā”‚ Check    ā”‚ 0    ā”‚ The 'shs.form' library is depending on a deprecated library. ā”‚
    ā”‚ manually ā”‚      ā”‚ The core/backbone asset library is deprecated in Drupal      ā”‚
    ā”‚          ā”‚      ā”‚ 9.4.0 and will be removed in Drupal 10.0.0.                  ā”‚
    ā”‚          ā”‚      ā”‚                                                              ā”‚
    ā”‚ Check    ā”‚ 0    ā”‚ The 'shs.form' library is depending on a deprecated library. ā”‚
    ā”‚ manually ā”‚      ā”‚ The core/jquery.once asset library is deprecated in Drupal   ā”‚
    ā”‚          ā”‚      ā”‚ 9.3.0 and will be removed in Drupal 10.0.0. Use the          ā”‚
    ā”‚          ā”‚      ā”‚ core/once library instead. See                               ā”‚
    ā”‚          ā”‚      ā”‚ https://www.drupal.org/node/3158256                          ā”‚
    ā”‚          ā”‚      ā”‚                                                              ā”‚
    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
    
    web/modules/contrib/shs/shs.info.yml:
    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
    ā”‚  STATUS  ā”‚ LINE ā”‚                          MESSAGE                           ā”‚
    ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
    ā”‚ Check    ā”‚ 0    ā”‚ Value of core_version_requirement: ^8.8 || ^9 is not       ā”‚
    ā”‚ manually ā”‚      ā”‚ compatible with the next major version of Drupal core. See ā”‚
    ā”‚          ā”‚      ā”‚ https://drupal.org/node/3070687.                           ā”‚
    ā”‚          ā”‚      ā”‚                                                            ā”‚
    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
    
    web/modules/contrib/shs/modules/shs_chosen/shs_chosen.info.yml:
    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
    ā”‚  STATUS  ā”‚ LINE ā”‚                          MESSAGE                           ā”‚
    ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
    ā”‚ Check    ā”‚ 0    ā”‚ Value of core_version_requirement: ^8.8 || ^9 is not       ā”‚
    ā”‚ manually ā”‚      ā”‚ compatible with the next major version of Drupal core. See ā”‚
    ā”‚          ā”‚      ā”‚ https://drupal.org/node/3070687.                           ā”‚
    ā”‚          ā”‚      ā”‚                                                            ā”‚
    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
    

    Replacing jquery.once should be relatively straightforward. The larger issue is replacing core/backbone. There seems to be three ways forward:

    1. Replace core/backbone dependency with core/internal.backbone. This would mean requiring at least D9.4. It is also highly discouraged by core maintainers to do this. #3258931: Deprecate backbone and tag it internal ā†’
    2. Adding backbone.js as its own library directly in this module
    3. Refactoring the JS implementation to completely remove Backbone

    Seems like the last one could be a separate issue to do over a longer term, and possibly be done in a 3.0.x branch. But in order to be D10 compatible in the short term, perhaps one of the first two approaches could be a short term fix?

  • Also caught these two lines that need updating per Creating an instance of the class Drupal\Core\Database\Query\Condition with the new keyword is deprecated and an API addition with the method Drupal\Core\Database\Query\Query::getConnection() ā†’ :
    Drupal\shs_chosen\Plugin\views\filter\ShsChosenTaxonomyIndexTidDepth
    l. 139
    $or_condition = new Condition('OR');
    Drupal\shs\Plugin\views\filter\ShsTaxonomyIndexTidDepth
    l. 141
    $or_condition = new Condition('OR');

    Replacement for both should probably be
    $or_condition = $this->database->condition('OR');

  • šŸ‡®šŸ‡³India rahul1707

    Created patch for 2.0.x-dev to fix Drupal 10 compatibility issues. Please review it.

  • Status changed to RTBC about 1 year ago
  • I have tested patch on latest 2x version which is applied cleany and working as expected on Drupal 9 & 10..making it RTBC

  • Patch is apply and no issues on D10.

  • šŸ‡ŗšŸ‡øUnited States kreynen

    "No issues" meaning SHS is fully functional?

  • It is not fully functional for me.
    Not working Chosen widget and creating new items.

  • šŸ‡¬šŸ‡ŖGeorgia almador

    Hi, rahul1707, and thank you so much for the patch!

    I'm using the latest shs-2.0.0-rc3 with your patch and I can confirm that it works with selecting hierarchical items.

    BUT when I'm trying to allow creating new items on the form display widget:
    admin/structure/types/manage/article/form-display

    "Allow creating new items
    Allow users to create new items of the source bundle."

    widget checkbox is gray and not available

  • šŸ‡¬šŸ‡ŖGeorgia almador

    This patch should help with shs_chosen search is not working

  • @kreynen opened merge request.
  • šŸ‡ŗšŸ‡øUnited States kreynen

    Chosen still seems buggy, but core SHS functionality seems to be working as expected in D10. I haven't tested in D9 yet. I opened an MR to the 2.x branch. Not sure if that's the direction @stBorchert and @jhedstrom want to do with this, but this unblocks me on šŸ“Œ Automated Drupal 10 compatibility fixes Fixed . If we want to push these changes to a 3.x branch and make that D10 only, I'm happy to help with that.

    HUGE thanks to everyone who has contributed!

  • First commit to issue fork.
  • šŸ‡ŗšŸ‡øUnited States jhedstrom Portland, OR

    Thanks all!

  • Status changed to Fixed about 1 year ago
  • šŸ‡ØšŸ‡±Chile Aneida

    Hi, remember 'static' return type declaration is only allowed since PHP 8.0

    In php 7.4 not working.

    src/Cache/ShsCacheableJsonResponse.php:37
    src/Cache/ShsCacheableJsonResponse.php:56
  • šŸ‡ŗšŸ‡øUnited States kreynen

    @Aneida That's what I was afraid of. There's only 4 months of D7 support left, but trying to keep everything work with D9/PHP7 and D10/PHP8.1 is challenging. Probably should have gone with a 3.0.x release for D10.

  • šŸ‡ØšŸ‡±Chile Aneida

    Another way would be to add the composer.json file, where the minimum php requirement is indicated. This way, you avoid creating a version that as you mention, will lose maintenance.

    https://www.drupal.org/docs/develop/creating-modules/let-drupal-know-abo... ā†’

    Greetings.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024