Problem/Motivation

drupal-check results on commit hash: fcca4f104b30c4ca52f4ded3c342ba83cb373691


 

 ------ ------------------------------------------------------------ 
  Line   src/Controller/FieldPermissionsController.php               
 ------ ------------------------------------------------------------ 
  98     Call to deprecated method getList() of class                
         Drupalield_permissions\FieldPermissionsServiceInterface.  
  148    Call to deprecated method getPermissionsByRole() of class   
         Drupalield_permissions\FieldPermissionsServiceInterface.  
 ------ ------------------------------------------------------------ 

 ------ --------------------------------------------------- 
  Line   src/Plugin/FieldPermissionType/CustomAccess.php    
 ------ --------------------------------------------------- 
  106    Call to deprecated method getList() of class       
         Drupalield_permissions\FieldPermissionsService.  
 ------ --------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------- 
  Line   tests/src/Functional/FieldPermissionsCommentTest.php                              
 ------ ---------------------------------------------------------------------------------- 
  116    Call to deprecated function entity_get_form_display().                            
  124    Call to deprecated function entity_get_display().                                 
  139    Call to deprecated function entity_get_form_display().                            
  145    Call to deprecated function entity_get_display().                                 
  192    Call to deprecated method assertEscaped() of class Drupal\Tests\BrowserTestBase.  
  193    Call to deprecated method assertEscaped() of class Drupal\Tests\BrowserTestBase.  
  199    Call to deprecated method assertEscaped() of class Drupal\Tests\BrowserTestBase.  
  200    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  208    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  209    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  229    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  230    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.   
  232    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  233    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  236    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  242    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.   
  263    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.   
  264    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  265    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  266    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  269    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.   
  282    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  292    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  295    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  313    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.   
  316    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.   
  321    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
  324    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.     
 ------ ---------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------- 
  Line   tests/src/Functional/FieldPermissionsNodeTest.php                                  
 ------ ----------------------------------------------------------------------------------- 
  77     Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.      
  85     Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.      
  91     Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.      
  100    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.      
  110    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.    
  118    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.      
  119    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.      
  127    Call to deprecated method assertResponse() of class Drupal\Tests\BrowserTestBase.  
  128    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.      
  129    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.    
  139    Call to deprecated method assertResponse() of class Drupal\Tests\BrowserTestBase.  
  140    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.    
  144    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.      
  154    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.      
  155    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.      
 ------ ----------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------- 
  Line   tests/src/Functional/FieldPermissionsUserTest.php                                  
 ------ ----------------------------------------------------------------------------------- 
  23     Call to deprecated method strtolower() of class Drupal\Component\Utility\Unicode.  
  76     Call to deprecated function entity_get_form_display().                             
  80     Call to deprecated function entity_get_form_display().                             
  84     Call to deprecated function entity_get_display().                                  
  97     Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.      
  102    Call to deprecated method assertEscaped() of class Drupal\Tests\BrowserTestBase.   
  113    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.      
  125    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.    
  136    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.      
  147    Call to deprecated method assertResponse() of class Drupal\Tests\BrowserTestBase.  
  148    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.    
 ------ ----------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------- 
  Line   tests/src/Kernel/Plugin/FieldPermissionType/ManagerTest.php                    
 ------ ------------------------------------------------------------------------------- 
  19     Usage of deprecated trait Drupal\simpletest\UserCreationTrait in class         
         Drupal\Testsield_permissions\Kernel\Plugin\FieldPermissionType\ManagerTest.  
 ------ ------------------------------------------------------------------------------- 

 [ERROR] Found 58 errors                                                                   
 

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mcdwayne created an issue. See original summary.

Snehal Brahmbhatt’s picture

Status: Active » Needs review
FileSize
14.67 KB

@mcdwayne, Please find the below-attached patch, & let me know if any further changes are required.

Thanks!

Status: Needs review » Needs work

The last submitted patch, 2: field-permission-3042752-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

clemens.tolboom’s picture

JeroenT’s picture

  1. +++ b/tests/src/Functional/FieldPermissionsCommentTest.php
    @@ -113,7 +113,7 @@ class FieldPermissionsCommentTest extends FieldPermissionsTestBase {
    +    Drupal::service('entity_display.repository')->getFormDisplay($entity_type, $bundle, 'default')
    

    Drupal::service(...)
    Should be \Drupal::service(...)

  2. +++ b/tests/src/Functional/FieldPermissionsCommentTest.php
    @@ -205,8 +205,8 @@ class FieldPermissionsCommentTest extends FieldPermissionsTestBase {
    +    $this->assertSession('Limit User comment subject');
    

    $this->assertSession() should not be used like that. See Drupal\FunctionalTests\AssertLegacyTrait for all alternatives.

    E.g. $this->assertText() should be $this->assertSession()->pageTextContains().

    $this->assertResponse() should be $this->assertSession()->statusCodeEquals()

    and so on.

Snehal Brahmbhatt’s picture

@JeroenT, Please find the updated patch for the same, thanks for your inputs. Hope this works now.

Snehal Brahmbhatt’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 6: field-permission-3042752-6.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

JeroenT’s picture

  1. +++ b/tests/src/Functional/FieldPermissionsCommentTest.php
    @@ -113,7 +113,7 @@ class FieldPermissionsCommentTest extends FieldPermissionsTestBase {
    +    EntityFormDisplay::load($entity_type, $bundle, 'default')
    

    EntityFormDisplay class should be imported.

  2. +++ b/tests/src/Functional/FieldPermissionsCommentTest.php
    @@ -189,15 +189,15 @@ class FieldPermissionsCommentTest extends FieldPermissionsTestBase {
    +    $this->assertSession()->responseContains()($this->commentSubject);
    

    This line seems odd. Should be replaced with $this->assertSession()->responseContains($this->commentSubject);

dhirendra.mishra’s picture

Assigned: Unassigned » dhirendra.mishra

I am working on it.

dhirendra.mishra’s picture

Here is the correct patch. Kindly review and merge.

dhirendra.mishra’s picture

Assigned: dhirendra.mishra » Unassigned
Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 11: field-permission-3042752-17.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

AmandeepKaur’s picture

Issue tags: +VB_Drupal_Contrib_Aug
-enzo-’s picture

Hi folks

I took the patch in comment #12, and solved to issues reported by drupal-check, but there two internal @deprecated issues that should be fixed or may be ignored.

------ ----------------------------------------------------------------------------------------------------------------------
  Line   src/Controller/FieldPermissionsController.php
 ------ ----------------------------------------------------------------------------------------------------------------------
  98     Call to deprecated method getList() of class Drupal\field_permissions\FieldPermissionsServiceInterface:
         This function will be removed before 8.x-1.0
  148    Call to deprecated method getPermissionsByRole() of class Drupal\field_permissions\FieldPermissionsServiceInterface:
         This function will be removed before 8.x-1.0
 ------ ----------------------------------------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------
  Line   src/Plugin/FieldPermissionType/CustomAccess.php
 ------ ------------------------------------------------------------------------------------------------
  106    Call to deprecated method getList() of class Drupal\field_permissions\FieldPermissionsService:
         This function will be removed before 8.x-1.0
 ------ ------------------------------------------------------------------------------------------------
-enzo-’s picture

Please ignore the files attached in the previous comment

-enzo-’s picture

Status: Needs work » Needs review
xeM8VfDh’s picture

is this done and ready to be merged, and are we all squared away for D9 support after merging?

xeM8VfDh’s picture

Status: Needs review » Needs work

I believe there is also a composer.json change that should be made to add the Drupal 9 support badge to the module's main page, as explained here: https://www.drupal.org/project/auto_entitylabel/issues/3111526

EDIT: or perhaps the change needs to be made to the core_version_requirement field in the module's .info file. Here's an example from another project: https://www.drupal.org/files/issues/2020-03-12/3119389-d9-upgrade-2.patch

EDIT 2: my information about composer.yml and info.yml was incorrect, sorry. Apparently there is some switch the maintainer can flip to trigger the badge and mark the module as D9 compatible, but I don't know where that switch is since I am not a maintainer. Sorry.

xeM8VfDh’s picture

Status: Needs work » Needs review
xeM8VfDh’s picture

Status: Needs review » Reviewed & tested by the community

@-enzo-, I applied patch field-permission-3042752-12.patch and I see no core deprecation warnings. However, I do still see the internal field_permissions warnings:

$ ./vendor/bin/drupal-check modules/field_permissions/
 24/24 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ---------------------------------------------------------------------------------------------------------------------- 
  Line   src/Controller/FieldPermissionsController.php                                                                         
 ------ ---------------------------------------------------------------------------------------------------------------------- 
  98     Call to deprecated method getList() of class Drupal\field_permissions\FieldPermissionsServiceInterface:               
         This function will be removed before 8.x-1.0                                                                          
  148    Call to deprecated method getPermissionsByRole() of class Drupal\field_permissions\FieldPermissionsServiceInterface:  
         This function will be removed before 8.x-1.0                                                                          
 ------ ---------------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------ 
  Line   src/Plugin/FieldPermissionType/CustomAccess.php                                                 
 ------ ------------------------------------------------------------------------------------------------ 
  106    Call to deprecated method getList() of class Drupal\field_permissions\FieldPermissionsService:  
         This function will be removed before 8.x-1.0                                                    
 ------ ------------------------------------------------------------------------------------------------ 

 ------ ---------------------------------------------------------------------------------------------------------- 
  Line   tests/src/Functional/FieldPermissionsTestBase.php                                                         
 ------ ---------------------------------------------------------------------------------------------------------- 
  136    Call to deprecated method getAllPermissions() of class Drupal\field_permissions\FieldPermissionsService:  
         This function will be removed before 8.x-1.0                                                              
 ------ ---------------------------------------------------------------------------------------------------------- 

                                                                                                                        
 [ERROR] Found 4 errors

Seeing as this issue is about Drupal 9 compatibility, I think these internal deprecation are outside the scope of this issue, thus I am marking this as RTBC. Maintainers, should we open another issue about these internal deprecation warnings?

heddn’s picture

Status: Reviewed & tested by the community » Needs work

I don't see any further deprecations then what are fixed in this issue. I've added a D9 test pass, to see if it catches things we can't find via static test analysis.

However, this module still needs core_version_requirement: ^8 || ^9 to info.yml and (possibily) drupal/core: "^8 || ^9. For that, marking NW.

xeM8VfDh’s picture

@heddn, can you provide that patch?

heddn’s picture

I'll try to get to that. But I learned a few more things since I posted that comment yesterday and
core_version_requirement: ^8 || ^9 to info.yml is all that is needed.

xeM8VfDh’s picture

@heddn I have attached 3042752-13.patch, which includes core_version_requirement change. Please review.

heddn’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
289 bytes

That looks good to me. Thanks for throwing up the patch. Here's an interdiff for anyone else between #16and #25.

xeM8VfDh’s picture

thanks @heddn

heddn’s picture

With D9 releasing today, any chance for a commit and new tagged release? Maybe a mention in the Drupal 9 support project field what the plans are for supporting D9?

xeM8VfDh’s picture

+1

JeroenT’s picture

Status: Reviewed & tested by the community » Needs work

Tests are still failing.

+++ b/tests/src/Functional/FieldPermissionsUserTest.php
@@ -73,15 +73,15 @@ class FieldPermissionsUserTest extends FieldPermissionsTestBase {
+    EntityFormDisplay::load('user', 'user', 'default')
...
+    EntityFormDisplay::load('user', 'user', 'register')

EntityFormDisplay class should be imported.

xeM8VfDh’s picture

Sorry, my fault, I am having issues running tests on my machine

attaching 3042752-13.patch to address #30. I'm not sure if the other test failures are related.

JeroenT’s picture

Status: Needs work » Needs review
FileSize
19.65 KB
14.79 KB
xeM8VfDh’s picture

sorry @JeroenT, thanks for cleaning up my mess *facepalm*

I just applied your patch 3042752-32.patch cleanly and it resolved the D9 deprecations. Again, I;m having trouble running test on my machine, but your testbot results obviously passed. So, if you aren't still working and 3042752-32.patch is your final patch, feel free to mark this RTBC.

JeroenT’s picture

Status: Needs review » Reviewed & tested by the community

@xeM8VfDh, np.

Marking the issue RTBC.

  • japerry committed 7e73c17 on 8.x-1.x authored by JeroenT
    Issue #3042752 by JeroenT, -enzo-, japerry, xeM8VfDh, Snehal Brahmbhatt...
japerry’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all for working on this. Fixed!

  • japerry committed e3a8044 on 8.x-1.x
    Issue #3042752 by japerry: Followup: Remove core key from permissions...

Status: Fixed » Closed (fixed)

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