Problem/Motivation
Drupal 10 is almost on the table at 2022, or has been already in Drupal 9, they said.
Proposed resolution
Identify deprecation etc. Make sure it's compatible to D10 by checking it on upgrade status module.
Remaining tasks
CONTRIBUTED PROJECTS
--------------------------------------------------------------------------------
Crop API 8.x-2.2
Scanned on Wed, 03/02/2022 - 16:55.
4 errors found. 10 warnings found. Avoid some manual work by using drupal-rector
for fixing issues automatically or Upgrade Rector to generate patches.
C:\xampp\htdocs\d9\modules\contrib\crop\src\Events\AutomaticCrop.php:
┌──────────┬──────┬──────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │ MESSAGE │
├──────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Check │ 13 │ Class Drupal\crop\Events\AutomaticCrop extends deprecated │
│ manually │ │ class Symfony\Component\EventDispatcher\Event: since Symfony │
│ │ │ 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead │
│ │ │ │
└──────────┴──────┴──────────────────────────────────────────────────────────────┘
C:\xampp\htdocs\d9\modules\contrib\crop\src\Events\AutomaticCropProviders.php:
┌──────────┬──────┬───────────────────────────────────────────────────────────┐
│ STATUS │ LINE │ MESSAGE │
├──────────┼──────┼───────────────────────────────────────────────────────────┤
│ Check │ 10 │ Class Drupal\crop\Events\AutomaticCropProviders extends │
│ manually │ │ deprecated class Symfony\Component\EventDispatcher\Event: │
│ │ │ since Symfony 4.3, use │
│ │ │ "Symfony\Contracts\EventDispatcher\Event" instead │
│ │ │ │
└──────────┴──────┴───────────────────────────────────────────────────────────┘
C:\xampp\htdocs\d9\modules\contrib\crop\tests\src\Functional\CropFunctionalTest.
php:
┌──────────┬──────┬──────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │ MESSAGE │
├──────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Fix with │ 100 │ Call to deprecated method drupalPostForm() of class │
│ rector │ │ Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and │
│ │ │ is removed from drupal:10.0.0. Use $this->submitForm() │
│ │ │ instead. │
│ │ │ │
│ Fix with │ 122 │ Call to deprecated method drupalPostForm() of class │
│ rector │ │ Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and │
│ │ │ is removed from drupal:10.0.0. Use $this->submitForm() │
│ │ │ instead. │
│ │ │ │
│ Fix with │ 141 │ Call to deprecated method drupalPostForm() of class │
│ rector │ │ Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and │
│ │ │ is removed from drupal:10.0.0. Use $this->submitForm() │
│ │ │ instead. │
│ │ │ │
│ Fix with │ 151 │ Call to deprecated method drupalPostForm() of class │
│ rector │ │ Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and │
│ │ │ is removed from drupal:10.0.0. Use $this->submitForm() │
│ │ │ instead. │
│ │ │ │
│ Fix │ 164 │ Call to deprecated function drupal_get_path(). Deprecated in │
│ later │ │ drupal:9.3.0 and is removed from drupal:10.0.0. Use │
│ │ │ Drupal\Core\Extension\ExtensionPathResolver::getPath() │
│ │ │ instead. │
│ │ │ │
│ Fix │ 166 │ Call to deprecated constant FILE_STATUS_PERMANENT: │
│ later │ │ Deprecated in drupal:9.3.0 and is removed from │
│ │ │ drupal:10.0.0. Use │
│ │ │ Drupal\file\FileInterface::STATUS_PERMANENT or │
│ │ │ \Drupal\file\FileInterface::setPermanent(). │
│ │ │ │
│ Fix │ 191 │ Call to deprecated function file_create_url(). Deprecated in │
│ later │ │ drupal:9.3.0 and is removed from drupal:10.0.0. Use the │
│ │ │ appropriate method on │
│ │ │ \Drupal\Core\File\FileUrlGeneratorInterface instead. │
│ │ │ │
└──────────┴──────┴──────────────────────────────────────────────────────────────┘
C:\xampp\htdocs\d9\modules\contrib\crop\tests\src\Kernel\CropUnitTestBase.php:
┌────────┬──────┬──────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │ MESSAGE │
├────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Fix │ 116 │ Call to deprecated function drupal_get_path(). Deprecated in │
│ later │ │ drupal:9.3.0 and is removed from drupal:10.0.0. Use │
│ │ │ Drupal\Core\Extension\ExtensionPathResolver::getPath() │
│ │ │ instead. │
│ │ │ │
│ Fix │ 119 │ Call to deprecated constant FILE_STATUS_PERMANENT: │
│ later │ │ Deprecated in drupal:9.3.0 and is removed from │
│ │ │ drupal:10.0.0. Use │
│ │ │ Drupal\file\FileInterface::STATUS_PERMANENT or │
│ │ │ \Drupal\file\FileInterface::setPermanent(). │
│ │ │ │
└────────┴──────┴──────────────────────────────────────────────────────────────┘
modules/contrib/crop/crop.info.yml:
┌──────────┬──────┬────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │ MESSAGE │
├──────────┼──────┼────────────────────────────────────────────────────────────┤
│ Check │ 0 │ Value of core_version_requirement: ^8.8 || ^9 is not │
│ manually │ │ compatible with the next major version of Drupal core. See │
│ │ │ https://drupal.org/node/3070687. │
│ │ │ │
└──────────┴──────┴────────────────────────────────────────────────────────────┘
modules/contrib/crop/modules/crop_media_entity/crop_media_entity.info.yml:
┌──────────┬──────┬────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │ MESSAGE │
├──────────┼──────┼────────────────────────────────────────────────────────────┤
│ Check │ 0 │ Value of core_version_requirement: ^8.7.7 || ^9 is not │
│ manually │ │ compatible with the next major version of Drupal core. See │
│ │ │ https://drupal.org/node/3070687. │
│ │ │ │
└──────────┴──────┴────────────────────────────────────────────────────────────┘
modules/contrib/crop/composer.json:
┌──────────┬──────┬──────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │ MESSAGE │
├──────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Check │ 0 │ The drupal/core requirement is not compatible with the next │
│ manually │ │ major version of Drupal. Either remove it or update it to be │
│ │ │ compatible. See │
│ │ │ https://drupal.org/node/2514612#s-drupal-9-compatibility. │
│ │ │ │
└──────────┴──────┴──────────────────────────────────────────────────────────────┘
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | interdiff_16-18.txt | 1.6 KB | nkoporec |
| #18 | 3267287-18.patch | 93.58 KB | nkoporec |
| #16 | interdiff_14_16.txt | 808 bytes | s_bhandari |
| #16 | 3267287-16.patch | 91.86 KB | s_bhandari |
| #14 | interdiff_12-14.txt | 387 bytes | nkoporec |
Comments
Comment #2
pradeepjha commentedReview this patch.

Upgrade status report after applying patch:
Comment #3
daniel.bosenSince Drupal 8 is not supported anymore and we cannot run the tests anymore, we might drop the core_version_requirement for 8.x as well.
Comment #4
heddnComment #5
heddnI noticed I missed an interdiff in there. Here are some more fixes and the missing interdiff.
Comment #6
heddnI'm not sure why the test failures. I did have to update to use the 9.3 bare fixture since the 8.8 and 9.0 fixture aren't available in drupal 10. Is there something related to that?
Comment #7
daniel.bosenThis is propably the reason, why the update tests fail.
crop-1.0-alpha2 cannot be installed on Drupal 9.3, and the core update hooks, that change serial to integer are not run, when starting at Drupal 9.3.
We have to create a new fixture with crop-2.0 installed
Comment #8
heddnOr remove testing for crop 1.0 alpha2 upgrade.
Comment #9
daniel.bosenI think, testing the upgrade path is a good idea, but we can only test from crop 2.0 onwards
Comment #10
berdirAll crop update functions are older than crop 8.x-2.0 (and most are older than 8.x-2.x-dev), so no, there is no point in keeping those update tests.
What should be done is to add a update last removed hook and then remove the update functions, test and the fixture. Nobody can be on Drupal 9 and haven't yet run those update functions.
Updating fixtures is a lot of work and should only be done if there's a good reason.
Comment #11
mglamanPatch no longer applies.
Comment #12
nkoporecAs @berdir suggested, I removed the update hooks and implemented the hook_update_last_removed, I also removed the test and fixtures.
Comment #13
berdirthis should use the drupal event classes, see change record for this: https://www.drupal.org/node/3159012
Comment #14
nkoporecUpdated the event classes.
Comment #15
berdirThe last patch only fixes one of the two event classes.
Comment #16
s_bhandari commentedHi,
Added a patch for the same. Please review.
Thanks.
Comment #17
berdirAdded test runs (reminder to set up default test configuration for issues again), passed before so this will pass again RTBC, just have two minor remarks that could be fixed in an updated patch or fixed on commit (or ignored).
this should probably be a use statement to not have the inline namespace.
same here.
Comment #18
nkoporecI think its good to do it in the same patch, so attaching an updated patch with fixes from #17.
Comment #19
lisa.rae commentedComment #20
phenaproximaCrediting folks.
Comment #22
phenaproximaReviewed the patch and I didn't see anything objectionable. Sure feels good to remove those update paths, eh! :)
Committed and pushed to 8.x-2.x. Thanks!
Comment #23
solideogloria commentedJust a note, isn't this the sort of thing that should be done in a new branch, due to being backwards incompatible?
Comment #24
berdirRaising the required core version is not a BC break. And the removed update functions are old enough that it's not possible for anyone to be on an older version when updating to Drupal 10, if someone is still on D8 they can update to 2.2 first.