- First commit to issue fork.
- Status changed to Needs review
almost 2 years ago 11:46am 20 March 2023 - 🇳🇱Netherlands watergate
I've updated the patch of #16 ✨ Drush Support for extracting strings in the theme files Needs work to be compatible with Drupal 10 (and the latest version of Drupal 9).
The change involves the deprecation of
drupal_get_path()
in Drupal 9, see https://www.drupal.org/node/2940438 → . In case older versions of Drupal should still be supported, instead of$path = \Drupal::service('extension.list.theme')->getPath($theme);
, something like$path = function_exists('drupal_get_path') ? drupal_get_path('theme', $theme) : \Drupal::service('extension.list.theme')->getPath($theme);
(but in that case this change/fix should also be applied on the code handling extracting string translations from modules). - 🇳🇱Netherlands Eric_A
To facilitate reviewing I created an interdiff between #16 and #19 with git. While #19 applies on HEAD (1.0.0), for #16 I had to go back to 2 commits to Drupal 9 code. The interdiff contained a lot of files. I then removed all the files except the two that are changed by both patches.
So here's something of an interdiff. I'll try to review later on.
- 🇳🇱Netherlands Eric_A
So here's something of an interdiff. I'll try to review later on.
Right. The two relevant files contained irrelevant hunks from the D9-D10 commits. Removed those manually as well.
- 🇳🇱Netherlands Eric_A
I've updated the patch of #16 to be compatible with Drupal 10 (and the latest version of Drupal 9).
The change involves the deprecation of drupal_get_path() in Drupal 9, see https://www.drupal.org/node/2940438 → . In case older versions of Drupal should still be supported, instead of $path = \Drupal::service('extension.list.theme')->getPath($theme);, something like $path = function_exists('drupal_get_path') ? drupal_get_path('theme', $theme) : \Drupal::service('extension.list.theme')->getPath($theme); (but in that case this change/fix should also be applied on the code handling extracting string translations from modules).
According to the info file, potx is runnable on ^8 || ^9 ||^10. If that were true, then #19 would not be correct is as. However, looking at the code from the D10 compatibility issue it is clear that the new services are already in use since 1.0.0. That code will only run on higher versions of Drupal. According to the referenced change record that would be ^9.3.
So I guess the ideal way forward is to first tackle the version compatibility issue in a separate issue where the code will either be made more compatible or the info file would be fixed to declare a more restrictive version constraint.
I'll see if I can create that issue today. - 🇳🇱Netherlands Eric_A
More or less postponed on 🐛 The potx info file incorrectly claims ^8 || ^9 || 10 core compatibility Needs work ?
- Status changed to Needs work
over 1 year ago 12:42pm 18 April 2023 - 🇳🇱Netherlands Eric_A
I've updated the patch of #16 to be compatible with Drupal 10 (and the latest version of Drupal 9).
Hold on... Aren't *.drush.inc commandfiles only loaded by Drush 8 and earlier? Drush 8 is not compatible with Drupal 10 and Drupal 9. (It's Drupal 8 compatible but not recommended.)
So it seems then that for Drupal 10 only the new Command class should be touched and the potx.drush.inc should be left alone for those on old Drush and old Drupal.https://weitzman.github.io/blog/port-to-drush9
https://www.drush.org/latest/install/#drupal-compatibility - 🇳🇱Netherlands watergate
Good point; I think you are right, @Eric_A. However, similar changes were already made in #3285613 (i.e., rewriting the deprecated code in the potx.drush.inc file, but for extracting strings from module files).
Let's use #3354887 to discuss which core and Drush (combinations) are supported and the most suitable strategy.
- 🇳🇱Netherlands watergate
I updated the patch to be compatible with the latest version of this module (when using Drupal 10 or 11).
I noticed that ✨ Create a new 2.0.0 version of POTX Active has been created mainly to remove support for old/obsolete code. This issue will also become easier when a 2.0.0 version is released.