Drupal 10 Compatible Version

Created on 2 August 2023, 11 months ago
Updated 3 August 2023, 11 months ago

Problem/Motivation

No official Drupal 9 or 10 compatible release yet. The last available official release is up to Drupal 8 compatible and there have been several deprecated codes that aren't compatible with Drupal 10 and/or Drupal 9. Drupal 9 is near its EOL and still not even a D9 compatible release. All the focus should be now on a Drupal 10 fully compatible release and looking forwards to a Drupal 11 one afterwards.

Proposed resolution

I share here a patch I created from the diff against the latest official release 8.x-1.0 → . This includes patches made up to D9 compatible from this issue 📌 Drupal 9 compatibility RTBC and other fixes I made for D10 compatibility as well as fixing the broken help link issue. My contributions are mainly in the files:

  • src\Form\SettingsForm.php - replaced the deprecated taxonomy_vocabulary_get_names() function which was giving a php error on accessing admin/config/content/hashtags/settings_form
  • hashtags.module
    • Replaced the deprecated function drupal_get_path() in the hashtags_help() function which was giving php error on accessing the module help at admin/help/hashtags
    • Replaced the deprecated method \Drupal::toUrl() .
    • Fixed the broken paths to the help images.
  • hashtags.info.yml - added support for Drupal 10
  • README.txt renamed to README.md

I tested all features and functionality of the fixed module and all is good for me with no errors logged on my latest Drupal 10.1.1 install.

Remaining tasks

Test if working to enable the module using Drush instead of UI.
Using Drush en hashtags while enabled the module but broke the site. More on this later after I re-test.

IMPORTANT NOTES: Please make sure to have a DB backup before trying to install/enable the module via Drush. The only way I could install it before making the changes above was via UI while Drush caused site to break.

ALSO: make sure to FIRST read the README file for steps to do before you try to uninstall the module if you had to. You need to disable the hashtags filter in both Basic HTML and Full HTML text formats before disabling/uninstalling the module.

User interface changes

API changes

All commented in the files mentioned above.

Data model changes

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @cestmoi
  • Status changed to Needs review 11 months ago
  • @ Maintainer(s), this is my first such patch so kindly correct me where applicable.

  • Status changed to Closed: duplicate 11 months ago
  • 🇮🇳India keshav.k

    Thank you @cestmoi for your efforts.
    But there is already an issue for it https://www.drupal.org/project/hashtags/issues/3127386 📌 Drupal 9 compatibility RTBC

  • Status changed to Needs review 11 months ago
  • @keshav.k thank you but that issue is for D9 not D10 and while D9 is near its EOL shouldn't efforts be on a stable D10 version ? This issue is mainly for D10 compatibility while that issue has no mention of D10. I also added fixes for issues that weren't tackled in that other issue. Anyways, I just hope this module gets the attention it needs esp. that its latest release is only D8 compatible.

  • With regards to the module install/enable via Drush vs UI, I think since the module cannot be required with Composer due to absence of a compatible release and it has to be added manually, installing it via Drush would cause errors such as the one below because Drush uses the Composer autoloader to load classes, and if the module is not listed in the composer.json file, its classes won't be found. That's why it installs fine via admin UI but not via Drush.

    Drupal\Component\Plugin\Exception\PluginException: Plugin (filter_hashtags) instance class "Drupal\hashtags\Plugin\Filter\FilterHashtags" does not exist. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 97 of pathToDrupal-10\web\core\lib\Drupal\Component\Plugin\Factory\DefaultFactory.php).

    That's why until there is a compatible release that can be required with Composer, the only way to enable the module is via admin UI, I understand.

    I tried to `Composer require` it with the patch following this (D8/D9) tutorial but it didn't work.

  • Issue was unassigned.
  • I think this patch is ready for RTBC. Please test and report so we have a D10 release sooner.

  • Same patch, just renamed the file per known standards.

Production build 0.69.0 2024