The method name system_get_info is deprecated and this needs to be updated for Drupal 9 Upgrade.

Line src/Plugin/Purge/DiagnosticCheck/AcquiaPurgeCheck.php
------ --------------------------------------------------------------------------
61 Call to deprecated function system_get_info():
in drupal:8.8.0 and is removed from drupal:9.0.0. Use
------ --------------------------------------------------------------------------

The module version is not available using system_get_info details.

Comments

drupalfox created an issue. See original summary.

drupalfox’s picture

Title: Drupal 9 deprecations » Call to deprecated function system_get_info() Drupal 9 deprecations
drupalfox’s picture

Issue summary: View changes
drupalfox’s picture

avpaderno’s picture

Status: Active » Needs review
Issue tags: -system_get_info() method deprecated in Drupal 9. +Drupal 9 compatibility
japerry’s picture

Title: Call to deprecated function system_get_info() Drupal 9 deprecations » Drupal 9 readiness
Category: Bug report » Task
Priority: Normal » Major
Status: Needs review » Needs work

Updating this to reflect this issue will cover all code needed for D9 readiness.

sushyl’s picture

Fixed both warnings found by Upgrade status

2 warnings found.

web/modules/contrib/acquia_purge/src/Plugin/Purge/DiagnosticCheck/AcquiaCloudCheck.php:
─────────────────────────────────────────────────────────────────────
STATUS LINE MESSAGE
─────────────────────────────────────────────────────────────────────
Fix later 63 Call to deprecated function system_get_info(). Deprecated in
drupal:8.8.0 and is removed from drupal:9.0.0. Use
\Drupal::service('extension.list.$type')->getExtensionInfo()
or
\Drupal::service('extension.list.$type')->getAllInstalledInfo() instead.

─────────────────────────────────────────────────────────────────────

web/modules/contrib/acquia_purge/acquia_purge.info.yml:
─────────────────────────────────────────────────────────────────────
STATUS LINE MESSAGE
─────────────────────────────────────────────────────────────────────
Check 0 Add core_version_requirement: ^8 || ^9 to
manually acquia_purge.info.yml to designate that the module is
compatible with Drupal 9. See https://www.drupal.org/node/3070687.

─────────────────────────────────────────────────────────────────────

sushyl’s picture

Status: Needs work » Needs review
msuthars’s picture

Assigned: Unassigned » msuthars
msuthars’s picture

Assigned: msuthars » Unassigned
Status: Needs review » Reviewed & tested by the community

@sushyl The patch looks fine. I reviewed and tested it and it works as expected.

guptahemant’s picture

Status: Reviewed & tested by the community » Needs work

hi @drupalfox and @sushyl

+++ b/src/Plugin/Purge/DiagnosticCheck/AcquiaCloudCheck.php
@@ -60,7 +60,7 @@ class AcquiaCloudCheck extends DiagnosticCheckBase implements DiagnosticCheckInt
+    $version = \Drupal::service('extension.list.module')->getExtensionInfo('acquia_purge');

Since we are using a service here, we should be using dependency injection, Hence setting this to needs work

guptahemant’s picture

Assigned: Unassigned » guptahemant
guptahemant’s picture

Status: Needs work » Needs review
Issue tags: +Drupal 9 porting day
StatusFileSize
new3.19 KB

Here is an updated patch,

Please review

guptahemant’s picture

Assigned: guptahemant » Unassigned
jaykandari’s picture

Assigned: Unassigned » jaykandari
jaykandari’s picture

Assigned: jaykandari » Unassigned
Status: Needs review » Reviewed & tested by the community

Applied the patch in #13

Ran Drupal-check & Rector. Below are the results. Thus marking it RTBC.

drupal8/modules/custom git/8.9.x*  20s
❯ drupal-check -ad acquia_purge 
 23/23 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

                                                                                                                        
 [OK] No errors                                                                                                         
                                                                                                                        

                                                                                                                                                                                                                                              
drupal8/modules/custom git/8.9.x*  6s
❯ ../../
                                                                                                                                                                                                                                              
drupal8 git/8.9.x*  
❯ vendor/bin/rector process modules/custom/acquia_purge --dry-run
Rector 0.8.x-dev@8896f0a
Config file: rector.yml

 69/69 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

                                                                                                                        
 [OK] Rector is done!                                                                                                   
                                                                                                                        

                                                                                                                                                                                                                                              
suzymasri’s picture

Patch #13 works for me too. It would be great if we can have it committed to dev so we're able to test the module on D9 projects.

recrit’s picture

The patch in #13 will fail for 1.1+ since the changes have been made already.

guptahemant’s picture

I think this issue can be marked as closed (outdated), since all the relevant changes are already committed in the latest version of codebase.

japerry’s picture

Status: Reviewed & tested by the community » Closed (outdated)