Problem/Motivation

------ -----------------------------------------------------------------------
  Line   src/Tests/TokenFieldUiTest.php
 ------ -----------------------------------------------------------------------
  91     Call to deprecated function entity_get_form_display().
  263    Call to deprecated method getTokenInfo() of class Drupal\token\Token.
  268    Call to deprecated method getTokenInfo() of class Drupal\token\Token.
  273    Call to deprecated method getTokenInfo() of class Drupal\token\Token.
  277    Call to deprecated method getTokenInfo() of class Drupal\token\Token.
 ------ -----------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------
  Line   src/Tests/TokenTestTrait.php (in context of class Drupal\Tests\token\Kernel\KernelTestBase)
 ------ ---------------------------------------------------------------------------------------------
  34     Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  106    Call to deprecated method assertIdentical() of class Drupal\KernelTests\KernelTestBase.
 ------ ---------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------
  Line   tests/src/Kernel/CommentTest.php
 ------ ---------------------------------------------------------------------
  65     Call to deprecated method url() of class Drupal\Core\Entity\Entity.
 ------ ---------------------------------------------------------------------

 ------ -----------------------------------------------------------------------------------------
  Line   tests/src/Kernel/EntityTest.php
 ------ -----------------------------------------------------------------------------------------
  47     Call to deprecated method assertIdentical() of class Drupal\KernelTests\KernelTestBase.
  48     Call to deprecated method assertIdentical() of class Drupal\KernelTests\KernelTestBase.
  49     Call to deprecated method assertIdentical() of class Drupal\KernelTests\KernelTestBase.
  50     Call to deprecated method assertIdentical() of class Drupal\KernelTests\KernelTestBase.
  51     Call to deprecated method assertIdentical() of class Drupal\KernelTests\KernelTestBase.
  52     Call to deprecated method assertIdentical() of class Drupal\KernelTests\KernelTestBase.
  53     Call to deprecated method assertIdentical() of class Drupal\KernelTests\KernelTestBase.
  54     Call to deprecated method assertIdentical() of class Drupal\KernelTests\KernelTestBase.
  55     Call to deprecated method assertIdentical() of class Drupal\KernelTests\KernelTestBase.
  56     Call to deprecated method assertIdentical() of class Drupal\KernelTests\KernelTestBase.
  63     Call to deprecated method assertIdentical() of class Drupal\KernelTests\KernelTestBase.
  64     Call to deprecated method assertIdentical() of class Drupal\KernelTests\KernelTestBase.
 ------ -----------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------
  Line   tests/src/Kernel/FieldTest.php
 ------ -------------------------------------------------------------------------------------
  265    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  266    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  267    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  269    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  270    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  308    Call to deprecated method getTokenInfo() of class Drupal\token\Token.
  309    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  310    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  311    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  340    Call to deprecated method getTokenInfo() of class Drupal\token\Token.
  341    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  342    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  343    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  344    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  347    Call to deprecated method getTokenInfo() of class Drupal\token\Token.
  348    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  350    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  351    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  390    Call to deprecated function entity_get_display().
  503    Call to deprecated method getTokenInfo() of class Drupal\token\Token.
  510    Call to deprecated method getTokenInfo() of class Drupal\token\Token.
  516    Call to deprecated method getTokenInfo() of class Drupal\token\Token.
  523    Call to deprecated method getTokenInfo() of class Drupal\token\Token.
 ------ -------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------------
  Line   tests/src/Kernel/RandomTest.php
 ------ --------------------------------------------------------------------------------------------
  24     Call to deprecated method assertNotIdentical() of class Drupal\KernelTests\KernelTestBase.
 ------ --------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------
  Line   tests/src/Kernel/UnitTest.php
 ------ -------------------------------------------------------------------------------------
  106    Call to deprecated method assertEqual() of class Drupal\KernelTests\KernelTestBase.
  115    Call to deprecated method getTokenInfo() of class Drupal\token\Token.
  116    Call to deprecated method getTokenInfo() of class Drupal\token\Token.
 ------ -------------------------------------------------------------------------------------

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

josephdpurcell created an issue. See original summary.

thalles’s picture

Follow the patch!

Status: Needs review » Needs work
voleger’s picture

Mark #3045247: Replace deprecated assertEqual() with assertEquals() as related
Better to make this issue as a meta issue and do exact replacements in the child issue. See #3045247: Replace deprecated assertEqual() with assertEquals()

Sergiu Stici’s picture

I run

php drupal-check.phar modules/contrib/token/
 50/50 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ -------------------------------------------------------- 
  Line   tests/src/Functional/TokenFieldUiTest.php               
 ------ -------------------------------------------------------- 
  91     Call to deprecated function entity_get_form_display().  
  130    Call to deprecated function file_unmanaged_copy().      
  131    Call to deprecated function file_unmanaged_copy().      
 ------ -------------------------------------------------------- 

 ------ ------------------------------------------------------- 
  Line   tests/src/Functional/TokenUserTest.php                 
 ------ ------------------------------------------------------- 
  57     Call to deprecated function file_prepare_directory().  
 ------ ------------------------------------------------------- 

 ------ --------------------------------------------------- 
  Line   tests/src/Kernel/FieldTest.php                     
 ------ --------------------------------------------------- 
  404    Call to deprecated function entity_get_display().  
 ------ --------------------------------------------------- 

                                                                                                                        
 [ERROR] Found 5 errors 
Sergiu Stici’s picture

Status: Needs work » Needs review
Berdir’s picture

Status: Needs review » Postponed

Thanks, but Drupal 8.8 has a better replacement for entity_get_form_display() and the file functions are only in 8.7/8.8, so we'll update them later when 8.6 is no longer supported. There are already dedicated issues for them.

robpowell’s picture

@berdir can we link to the dedicated issues? And is this postponed till 8.6 support is finished which seems to mean January 2020? https://www.drupal.org/core/release-cycle-overview

kim.pepper’s picture

Status: Postponed » Active

8.6 is no longer supported so changing status to active.

Berdir’s picture

Status: Active » Postponed

All the 8.7 stuff is done, only 8.8 remaining, so back to Postponed ;)

Berdir credited czigor.

Berdir’s picture

This should take care of all the remaining deprecations.

Berdir’s picture

Missed on call.

Matroskeen’s picture

assertIdentical() and assertNotIdentical() are not deprecated yet, but they will be soon.
Let's be ahead of the game and prevent one more issue with deprecation report in the near future :)

maximpodorov’s picture

The patch for the 8.x-1.6 version of the module (the same as in #15).

Abhijith S’s picture

Status: Needs review » Needs work

Patch #16(token_deprecated-3042568-15-1.6.patch) not working.Please fix it.
The error I was getting is given below.

git apply token_deprecated-3042568-15-1.6.patch
error: patch failed: token.info.yml:1
error: token.info.yml: patch does not apply

Berdir’s picture

Status: Needs work » Needs review

That patch isn't supposed to apply, it is for 8.x-1.6. Which doesn't really make sense, because there is no practical reason to apply this patch to a released version and include it in a project. This doesn't fix any problems on Drupal 8.

John Cook’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +ContributionWeekend2020

I've checked the patch from #15. The code all looks good.

After applying the patch, I get the following report from drupal-check:

./vendor/bin/drupal-check modules/contrib/token
 53/53 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%


 [OK] No errors                                                                              

So all deprications have been fixed.

I've got one small nit-pick. There is a typo in:

+++ b/src/MenuLinkFieldItemList.php
@@ -0,0 +1,26 @@
+ * Defines a menu link list class for storen menu link information.

But this can be fix on commit, so marking RTBC for #15

DamienMcKenna’s picture

Title: Drupal 9 Deprecated Code Report » Drupal 9 Deprecated Code Report for Token

  • Berdir committed 2dd0b4e on 8.x-1.x authored by maximpodorov
    Issue #3042568 by Berdir, Matroskeen, Sergiu Stici, thalles,...
Berdir’s picture

Status: Reviewed & tested by the community » Fixed

Committed, that means token 1.x-dev will now require Drupal 8.8.

maximpodorov’s picture

It's not fair that I was credited in this commit.

Berdir’s picture

Well, that's the first time I hear someone complaining that they *did* get credited :)

Too late for that, at least for the commit message.

Status: Fixed » Closed (fixed)

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