Problem/Motivation

drupal-check on version:
2bb97bd35d1e5135529236c5d9c7a8673021b161

 ------ -------------------------------------------------------------------------- 
  Line   menus_attribute.module                                                    
 ------ -------------------------------------------------------------------------- 
  22     Call to deprecated method entityManager() of class Drupal:                
         in Drupal 8.0.0 and will be removed before Drupal 9.0.0.                  
         Use \Drupal::entityTypeManager() instead in most cases. If the needed     
         method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the  
         deprecated \Drupal\Core\Entity\EntityManager to find the                  
         correct interface or service.                                             
  27     Variable $plugin_id might not be defined.                                 
  28     Variable $plugin_id might not be defined.                                 
  126    Call to deprecated method entityManager() of class Drupal:                
         in Drupal 8.0.0 and will be removed before Drupal 9.0.0.                  
         Use \Drupal::entityTypeManager() instead in most cases. If the needed     
         method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the  
         deprecated \Drupal\Core\Entity\EntityManager to find the                  
         correct interface or service.                                             
  138    Variable $plugin_id might not be defined.                                 
  138    Variable $plugin_id might not be defined.                                 
  138    Variable $plugin_id might not be defined.                                 
  138    Variable $temp might not be defined.                                      
  138    Variable $temp might not be defined.                                      
 ------ -------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------ 
  Line   src/StorageHelper.php                                                         
 ------ ------------------------------------------------------------------------------ 
  27     \Drupal calls should be avoided in classes, use dependency injection instead  
 ------ ------------------------------------------------------------------------------ 

                                                                                                
 [ERROR] Found 10 errors                                                                        
                                                                                                

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • d9-compatibility Comparecompare
  • 8.x-1.x Comparecompare

Comments

Ujin created an issue. See original summary.

ujin’s picture

Status: Active » Needs review
StatusFileSize
new2.22 KB
rpayanm’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, it looks good for me:

 4/4 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%


 [OK] No errors
edycarreyes99’s picture

Assigned: ujin » Unassigned
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.51 KB
new298 bytes

Missing core_version_requirement.

heddn’s picture

Status: Needs review » Reviewed & tested by the community

I think this is good now. Upgrade status and upgrade rector don't show anything else.

mιχaliς’s picture

I can apply the #2 patch, but I can't apply patch on comment #4.
Composer say " Could not apply patch! Skipping. The error was: Cannot apply patch".

This is my tests :

1 --------------
Apply patch #4 --> failed

2 --------------
Apply patch #2 and patch #4 --> failed

3 --------------
Apply patch #2 --> Worked

When I read the interdiff on patch #4 I see :

@@ -2,3 +2,4 @@ name: Menus Attribute
type: module
description: 'Attributes for menu links'
core: 8.x
+core_version_requirement: ^8 || ^9

But in code (version 1.1) I have :
name: Menus Attribute
type: module
description: 'Attributes for menu links'
# core: 8.x

May be it's failed because core attribute is comment ?

hamadknows’s picture

I cannot apply the patch in comment #4 as well.
Any solutions : )

gruda’s picture

StatusFileSize
new2.27 KB

Re-rolled against 8.x-1.1

gruda’s picture

I was able to get this module working with d9 by creating an issue fork from the patch in #8 and following the directions for Creating issue forks and merge requests to implement this with composer. Below are the relevant parts of my composer.json file.

Ultimately if you are taking the time to upgrade, consider using menu_link_attributes module, as it is better supported and looks to provide much of the same functionality.

    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8",
            "exclude": [
                "drupal/menus_attribute"
            ]
        },
        {
            "type": "git",
            "url": "git@git.drupal.org:issue/menus_attribute-3068910.git"
        }
    ],
...
    

and then

$ composer require drupal/menus_attribute:dev-d9-compatibility

themodularlab’s picture

Thanks to everyone for helping out with this fix. I am in the process of applying and committing this patch. It will be in the dev version shortly and included in the next release.

  • themodularlab committed 04da382 on feature/3068910 authored by gruda
    Issue #3068910 by gruda: Drupal 9 Deprecated Code Report
    
themodularlab’s picture

themodularlab’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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