Problem/Motivation

Discover if there are any problems when migrating to Drupal 9.

Proposed resolution

Running the checking tool against commit 15da24b6 gives:

./vendor/bin/drupal-check modules/contrib/taxonomy_machine_name/ 
 5/5 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ----------------------------------------------------------------------------------- 
  Line   taxonomy_machine_name.module                                                       
 ------ ----------------------------------------------------------------------------------- 
  164    Call to deprecated method getVocabularyId() of class Drupal\taxonomy\Entity\Term.  
  172    Call to deprecated function entity_load_multiple_by_properties().                  
  225    Call to deprecated method strtolower() of class Drupal\Component\Utility\Unicode.  
  248    Call to deprecated method getVocabularyId() of class Drupal\taxonomy\Entity\Term.  
  262    Call to deprecated method strlen() of class Drupal\Component\Utility\Unicode.      
  265    Call to deprecated method getVocabularyId() of class Drupal\taxonomy\Entity\Term.  
 ------ ----------------------------------------------------------------------------------- 


 [ERROR] Found 6 errors                                                                                                 

Remaining tasks

Replace calls to deprecated code.

Comments

John Cook created an issue. See original summary.

john cook’s picture

Status: Active » Needs review
Issue tags: +ContributionWeekend2020
StatusFileSize
new2.65 KB

I've created a patch to address the deprecated code.

john cook’s picture

Issue summary: View changes
rogerpfaff’s picture

Status: Needs review » Reviewed & tested by the community

Patch applied (PHPSTORM). Deprecated code calls are all removed and drupal-check returns OK.

john cook’s picture

Status: Reviewed & tested by the community » Needs work

I've run the patch against upgrade status. There are currently some outstanding issues:

$ drush us-a taxonomy_machine_name
 [notice] Processing /var/www/drupalvm/drupal/web/modules/contrib/taxonomy_machine_name.
 5/5 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%


================================================================================
Taxonomy Machine Name,  8.x-1.0-beta4
Scanned on Thu, 05/28/2020 - 10:11

FILE:
web/modules/contrib/taxonomy_machine_name/src/Plugin/views/filter/TaxonomyIndexM
achineName.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Fix now        69   Call to deprecated method getStorage() of class             
                    Drupal\Core\Entity\EntityManager. Deprecated in drupal:8.0.0
                    and is removed from drupal:9.0.0. Use                       
                    Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() 
                    instead.                                                    
--------------------------------------------------------------------------------
Fix now        70   Call to deprecated method getStorage() of class             
                    Drupal\Core\Entity\EntityManager. Deprecated in drupal:8.0.0
                    and is removed from drupal:9.0.0. Use                       
                    Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() 
                    instead.                                                    
--------------------------------------------------------------------------------

FILE: web/modules/contrib/taxonomy_machine_name/taxonomy_machine_name.info.yml

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 0    Add `core_version_requirement: ^8 || ^9` to      
                    taxonomy_machine_name.info.yml to designate that the module 
                    is compatible with Drupal 9. See                            
                    https://drupal.org/node/3070687.                            
--------------------------------------------------------------------------------

The core_version_requirement issue is covered in #3109472: Drupal 9 Readiness. I'm setting the status back to Needs work for the other issues.

mrinalini9’s picture

Assigned: Unassigned » mrinalini9
mrinalini9’s picture

Assigned: mrinalini9 » Unassigned
suresh prabhu parkala’s picture

Status: Needs work » Needs review
StatusFileSize
new3.36 KB
new602 bytes

updated patch as mentioned in #5. Please review.

smrutha’s picture

Patch #8 works fine.

drupal-check -d modules/contrib/taxonomy_machine_name
5/5 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] No errors

smrutha’s picture

Status: Needs review » Reviewed & tested by the community
DonAtt’s picture

StatusFileSize
new3.12 KB

+1: Patch #8 works perfectly for me on Drupal 9.0.7.

One small nitpick:

This is not required as Drupal\taxonomy\TermStorage is not used.

@@ -4,6 +4,7 @@ use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\taxonomy\Entity\Term;
 use Drupal\taxonomy\TermInterface;
+use Drupal\taxonomy\TermStorage;
 
 /**
  * Implements hook_entity_base_field_info().

I added the fixed patch.

  • sdstyles committed 67a851e on 8.x-1.x authored by DonAtt
    Issue #3109005 by Suresh Prabhu Parkala, John Cook, DonAtt, sdstyles:...
sdstyles’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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