Prepare the module for Drupal 9

  • Remove the deprecated code
  • Add the core_version_requirement key in the *.info.yml files

Comments

iheb.attia created an issue. See original summary.

arunkumark’s picture

Title: Drupal 9 readiness » Prepare the module for Drupal 9
Issue summary: View changes

Updated the Issue details.

arunkumark’s picture

StatusFileSize
new3.28 KB

Created the Patch to fix the Issues

wrd’s picture

I'm getting the following error when attempting to enable the module:

Got error 'PHP message: Uncaught PHP Exception Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException: "You have requested a non-existent service "libraries.manager"." at /var/www/vhosts/example.com/site/httpdocs/core/lib/Drupal/Component/DependencyInjection/Container.php line 153'

naresh_bavaskar’s picture

Version: 8.x-1.3 » 8.x-1.x-dev
Status: Needs review » Needs work

Facing an issue while applying patch #3 in 8.x-1.x

Drupal_9_3135152.patch:43: trailing whitespace.
  $directory = \Drupal::service('libraries.manager')->load($library);
Drupal_9_3135152.patch:59: trailing whitespace.

warning: 2 lines add whitespace errors.
iheb.attia’s picture

StatusFileSize
new5.91 KB
iheb.attia’s picture

Status: Needs work » Needs review
meghasharma’s picture

Status: Needs review » Needs work

Have run drupal-check & rector tools and scanned upgrade_status on superfish module:
rector is done and while scanning upgrade_status: No errors reported;
but while running the drupal_check
its giving errors:
my_site_name_dir % vendor/bin/drupal-check -ad web/modules/contrib/superfish
4/4 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

------ -------------------------------------------------------
Line src/Plugin/Block/SuperfishBlock.php
------ -------------------------------------------------------
56 Unsafe usage of new static().
💡 Consider making the class or the constructor final.
1466 Variable $type might not be defined.
------ -------------------------------------------------------

------ ---------------------------------------------
Line superfish.module
------ ---------------------------------------------
203 Function libraries_get_path not found.
208 Function libraries_get_path not found.
251 Function libraries_get_libraries not found.
------ ---------------------------------------------

------ -------------------------------------------------------------------------------------------------------------------------------------------
Line superfish.theme.inc
------ -------------------------------------------------------------------------------------------------------------------------------------------
31 Function template_preprocess_superfish not found while trying to analyse it - autoloading is probably not configured properly.
82 Function template_preprocess_superfish_menu_items not found while trying to analyse it - autoloading is probably not configured properly.
------ -------------------------------------------------------------------------------------------------------------------------------------------

[ERROR] Found 7 errors

my_site_name_dir % vendor/bin/rector process web/modules/contrib/superfish --dry-run
Rector 0.8.x-dev@8896f0a
Config file: rector.yml

12/12 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] Rector is done!

ankitsingh0188’s picture

Assigned: Unassigned » ankitsingh0188
ankitsingh0188’s picture

Assigned: ankitsingh0188 » Unassigned

Apologies, unable to spare time for this. Unassigning so others may take this forward.

rishabhthakur’s picture

Assigned: Unassigned » rishabhthakur

I will work on that..

rishabhthakur’s picture

Assigned: rishabhthakur » Unassigned
Status: Needs work » Needs review
StatusFileSize
new5.27 KB
new5.61 KB

Patch #6 failed to apply in Latest committed code, Some of cod already merged with last release
So, Re-rolled patch #6, Updated patch as per the changes suggested in #8 (drupal-check errors).

Please review and confirm

arno2mars’s picture

Hello,

I have checked patch in #12.
Patch is working however after applying it upgrade_status still report the following deprecation:

FILE NAME LINE ERROR
\web\modules\contrib\superfish\superfish.module 208 Call to deprecated function libraries_get_path(): Will be removed before a stable Drupal 8 release. Please use the new library load and managment concepts described at: https://www.drupal.org/node/2170763

The patch indeed adds the following line containing the deprecated function it is supposed to remove:

+ $directory_path = libraries_get_path($library);

Hoping it helps!
Thanks :-)

ivnish’s picture

Category: Bug report » Task
dontayeb’s picture

I got the same error as #13 using patch at #12

I changed line 208 to
$directory_path = superfish_libraries_get_path($library);

and that took care of the error and now Superfish is error/warning free.

ivnish’s picture

Status: Needs review » Fixed

Already fixed

Status: Fixed » Closed (fixed)

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