Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Feed Tamper module is required by Tamper module. So I ran drupal-check tamper and display the next:
65/65 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ -------------------------------------------------------------------------------------------------------------
Line src/TamperInterface.php
------ -------------------------------------------------------------------------------------------------------------
12 Interface Drupal\tamper\TamperInterface extends deprecated interface Drupal\Component\Plugin\ConfigurablePluginInterface:
Drupal\Component\Plugin\ConfigurablePluginInterface is deprecated
in Drupal 8.7.0 and will be removed before Drupal 9.0.0. You should implement
ConfigurableInterface and/or DependentPluginInterface directly as needed. If
you implement ConfigurableInterface you may choose to implement
ConfigurablePluginInterface in Drupal 8 as well for maximum compatibility,
however this must be removed prior to Drupal 9.
------ -------------------------------------------------------------------------------------------------------------
------ ----------------------------------------------------------------------------------------------
Line tests/src/Kernel/ChainedTamperTest.php
------ ----------------------------------------------------------------------------------------------
46 Call to deprecated method getMock() of class Drupal\KernelTests\KernelTestBase:
in drupal:8.5.0 and is removed from drupal:9.0.0.
Use \Drupal\Tests\PhpunitCompatibilityTrait::createMock() instead.
50 Call to deprecated method setExpectedException() of class Drupal\KernelTests\KernelTestBase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ ----------------------------------------------------------------------------------------------
------ -------------------------------------------------------------------------
Line tests/src/Unit/Adapter/TamperableComplexDataAdapterTest.php
------ -------------------------------------------------------------------------
33 Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase:
in drupal:8.5.0 and is removed from drupal:9.0.0.
Use \Drupal\Tests\PhpunitCompatibilityTrait::createMock() instead.
------ -------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/ArrayFilterTest.php
------ --------------------------------------------------------------------------------------
27 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/ConvertCaseTest.php
------ --------------------------------------------------------------------------------------
38 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
61 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
84 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
107 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
130 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ -------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/CountryToCodeTest.php
------ -------------------------------------------------------------------------
35 Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase:
in drupal:8.5.0 and is removed from drupal:9.0.0.
Use \Drupal\Tests\PhpunitCompatibilityTrait::createMock() instead.
------ -------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/ExplodeTest.php
------ --------------------------------------------------------------------------------------
36 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
54 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/FindReplaceTest.php
------ --------------------------------------------------------------------------------------
103 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/HashTest.php
------ --------------------------------------------------------------------------------------
31 Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase:
in drupal:8.5.0 and is removed from drupal:9.0.0.
Use \Drupal\Tests\PhpunitCompatibilityTrait::createMock() instead.
73 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/HtmlEntityDecodeTest.php
------ --------------------------------------------------------------------------------------
34 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
37 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
40 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/HtmlEntityEncodeTest.php
------ --------------------------------------------------------------------------------------
34 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/ImplodeTest.php
------ --------------------------------------------------------------------------------------
30 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/RequiredTest.php
------ --------------------------------------------------------------------------------------
52 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
60 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
87 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
100 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
115 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
130 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ -------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/RewriteTest.php
------ -------------------------------------------------------------------------
33 Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase:
in drupal:8.5.0 and is removed from drupal:9.0.0.
Use \Drupal\Tests\PhpunitCompatibilityTrait::createMock() instead.
------ -------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/StrPadTest.php
------ --------------------------------------------------------------------------------------
75 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/StrToTimeTest.php
------ --------------------------------------------------------------------------------------
38 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/StripTagsTest.php
------ --------------------------------------------------------------------------------------
50 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ -----------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/TamperPluginTestBase.php
------ -----------------------------------------------------------------------------------
27 Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase:
in drupal:8.5.0 and is removed from drupal:9.0.0.
Use \Drupal\Tests\PhpunitCompatibilityTrait::createMock() instead.
47 Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase:
in drupal:8.5.0 and is removed from drupal:9.0.0.
Use \Drupal\Tests\PhpunitCompatibilityTrait::createMock() instead.
58 Call to deprecated method assertInternalType() of class PHPUnit\Framework\Assert:
https://github.com/sebastianbergmann/phpunit/issues/3369
65 Call to deprecated method assertInternalType() of class PHPUnit\Framework\Assert:
https://github.com/sebastianbergmann/phpunit/issues/3369
72 Call to deprecated method assertInternalType() of class PHPUnit\Framework\Assert:
https://github.com/sebastianbergmann/phpunit/issues/3369
79 Call to deprecated method assertInternalType() of class PHPUnit\Framework\Assert:
https://github.com/sebastianbergmann/phpunit/issues/3369
86 Call to deprecated method assertInternalType() of class PHPUnit\Framework\Assert:
https://github.com/sebastianbergmann/phpunit/issues/3369
86 Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase:
in drupal:8.5.0 and is removed from drupal:9.0.0.
Use \Drupal\Tests\PhpunitCompatibilityTrait::createMock() instead.
93 Call to deprecated method assertInternalType() of class PHPUnit\Framework\Assert:
https://github.com/sebastianbergmann/phpunit/issues/3369
------ -----------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/UniqueTest.php
------ --------------------------------------------------------------------------------------
27 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/UrlDecodeTest.php
------ --------------------------------------------------------------------------------------
27 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
43 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line tests/src/Unit/Plugin/Tamper/UrlEncodeTest.php
------ --------------------------------------------------------------------------------------
40 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
52 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
77 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
89 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
[ERROR] Found 47 errors
Thank's
Comment | File | Size | Author |
---|---|---|---|
#26 | tamper-assertIs-methods-3100431-26.patch | 2.77 KB | MegaChriz |
Comments
Comment #2
MegaChriz CreditAttribution: MegaChriz as a volunteer commented@gmangones
Thanks for scanning. It seems the majority of the deprecation warnings are from Drupal 8.8. We cannot fix these yet, as we still support Drupal 8.7. But the deprecations introduced in Drupal 8.7 or earlier could be fixed right now.
Comment #3
Chandru Ranganathan CreditAttribution: Chandru Ranganathan as a volunteer and at Dialed In Design commentedHi guys,
Here I have added the patch to solve deprecated warnings in drupal 8.7 and earlier.
Can anyone review it.
Thanks.
Comment #4
jamesdixon CreditAttribution: jamesdixon as a volunteer and at Dialed In Design commentedThanks this is a big step in the right direction!
Since Feeds officially supports Drupal 8.7, if we fix deprecations beyond 8.7 then we risk breaking Tamper with Drupal 8.7.
Would you mind running the report to find deprecation issues up to Drupal 8.7 (and no further)?
The next step would be to update the patch to fix deprecations up to Drupal 8.7.
Comment #5
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedTests are failing because D8.8 cannot be tested in combination with PHP 5, so I updated the automated testing settings.
Comment #6
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedIt's okay to replace
ConfigurablePluginInterface
withConfigurableInterface
, butConfigurablePluginInterface
has one additional method calledcalculateDependencies()
. This method should then be removed from the class TamperBase.This should be removed.
Comment #7
jamesdixon CreditAttribution: jamesdixon as a volunteer and at Dialed In Design commentedAh okay then we don't need to rewrite it to work for Drupal 8.7 only, it is passing for Drupal 8.7.
Lets work in @megachriz's feedback to the existing patch.
Comment #8
Chandru Ranganathan CreditAttribution: Chandru Ranganathan as a volunteer and at Dialed In Design commentedThanks @jamesdixon and @MegaChriz
All the requested changes are made.
Here is the updated patch.
tamper-drupal9_deprecated-3100431-8.patch
Please review it.
Thanks.
Comment #9
Chandru Ranganathan CreditAttribution: Chandru Ranganathan as a volunteer and at Dialed In Design commentedComment #10
jenlamptonI believe that if you add drupal 9 as an option to the
composer.json
file in this project you can get a nice little Compatible with Drupal 9 badge in the Project information section on the module page.Below is a code sample from a module that has the badge.
It also looks like it may possible to get the badge by adding the 'core_version_requirement' key in the modules info.yml file, which, in turn, will add the version to the require section of
composer.json
. Example follows.Do you want to include this change in the patch here or open a separate issue?
Comment #11
jamesdixon CreditAttribution: jamesdixon as a volunteer and at Dialed In Design commentedThanks for the suggestion.
Lets add this into the patch here.
Comment #12
MegaChriz CreditAttribution: MegaChriz as a volunteer commented@jenlampton, @jamesdixon
Good suggestion, but we can only declare Drupal 9 compatibility when all deprecations are fixed. Fixing some of the deprecation warnings breaks testing on D8.7, so we cannot add the "core_version_requirement" line until we drop support for Drupal 8.7. I propose to drop support for that version at the end of March, then we have two months to get the module compatible with Drupal 9.
Requiring drupal/core in composer.json is not necessary, by my knowledge.
Comment #13
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedThe D8.8 deprecations can be fixed now as well.
The composer.json change suggested in #10 isn't necessary. See @berdir's comment on #3111526-4: Add Drupal 9 into the require section of composer.json:
Comment #14
sja112 CreditAttribution: sja112 at Srijan | A Material+ Company for Drupal India Association commentedComment #15
sja112 CreditAttribution: sja112 at Srijan | A Material+ Company for Drupal India Association commentedI have added core_version_requirement key in info.yml
Comment #16
MegaChriz CreditAttribution: MegaChriz as a volunteer commented@sja112
Thanks for your help. The next step is to fix also all drupal:8.8.0 deprecations. See issue summary.
Comment #17
sja112 CreditAttribution: sja112 at Srijan | A Material+ Company for Drupal India Association commented@megachriz I have updated the patch to fix drupal:8.8.0 deprecations.
Comment #18
sja112 CreditAttribution: sja112 at Srijan | A Material+ Company for Drupal India Association commentedFixed D8.8.0 deprecations in the patch. The patch passed D8.9 all test cases.
Comment #19
sja112 CreditAttribution: sja112 at Srijan | A Material+ Company for Drupal India Association commentedComment #20
MegaChriz CreditAttribution: MegaChriz as a volunteer commented@sja112
Looks good! After applying the patch the Upgrade status reports it no longer finds errors. I inspected each change as well and all looks correct. I only removed the change in composer.json. That one didn't seem necessary to add.
I think that the D9 tests can only pass after commit. The testbot seems to have issues detecting a patch as D9 compatible when the dev version isn't compatible with D9 yet.
Comment #22
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedassertIsString()
,assertIsArray()
andassertIsBool()
are not available in Drupal 8.8.So I added
assertVarIsString()
,assertVarIsArray()
andassertVarIsBool()
for these.Comment #24
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedTests for D8.8 are passing. Tests for D8.7 are failing, so in the commit support for D8.7 is now dropped, by using "^8.8 | ^9" as core_version_requirement. See also https://www.drupal.org/node/3070687.
Let's see how D9 tests will go.
Comment #25
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedGood news! Tests are passing on D9: https://www.drupal.org/pift-ci-job/1677520
I guess we could schedule a new release for Tamper now.
Comment #26
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedassertIsString()
,assertIsArray()
andassertIsBool()
have just been added in Drupal 8.8:#3126787-36: [D8 only] Add forwards-compatibility shim for assertInternalType() replacements in phpunit 6&7.
So let's remove our workaround methods again.
Comment #28
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedGreat, tests are passing on both D8.8 and D9. Committed #26.