Problem/Motivation
Thank you so much for the
Drupal Core team
Following with
Drupal 10.0.0 is coming soon. Help us test it today!
A snapshot to allow module and theme developers to test compatibility with the next major release. No upgrade path is provided between alpha releases and many additional changes will be included prior to 10.0.0.
The current composer require status for this module under Drupal 10
composer create-project drupal/recommended-project:10.0.0-alpha4@alpha /var/www/html/sandboxes/drupal10block_library
cd /var/www/html/sandboxes/drupal10block_library/
composer config minimum-stability dev
composer require drupal/block_library
is having the following problem
Using version ^1.0@alpha for drupal/block_library
./composer.json has been updated
Running composer update drupal/block_library
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires drupal/block_library ^1.0@alpha -> satisfiable by drupal/block_library[dev-master, 1.0.0-alpha2].
- drupal/block_library[dev-master, ..., 1.0.0-alpha2] require drupal/core ^8.7.7 || ^9 -> found drupal/core[8.7.7, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev] but the package is fixed to 10.0.0-alpha4 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require drupal/block_library:*" to figure out if any version is installable, or "composer require drupal/block_library:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
composer create-project drupal/recommended-project:~9 /var/www/html/sandboxes/drupal9block_library
cd /var/www/html/sandboxes/drupal9block_library/
composer config minimum-stability dev
composer require drupal/block_library
composer require drupal/core-dev:~9 --with-all-dependencies
composer require mglaman/drupal-check --dev
composer require phpspec/prophecy-phpunit:^2 --dev
php vendor/bin/drupal-check -d web/modules/contrib/block_library/
Output:
block_library--drupal-check--report.txt
3/3 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ ----------------------------------------------
Line block_library.module
------ ----------------------------------------------
22 Call to an undefined method
Drupal\Core\Form\FormInterface::getEntity().
------ ----------------------------------------------
------ ---------------------------------------------------------------
Line src/Controller/ChooseBlockController.php
------ ---------------------------------------------------------------
34 Call to deprecated function file_create_url():
in drupal:9.3.0 and is removed from drupal:10.0.0.
Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface
instead.
34 Call to deprecated function file_url_transform_relative():
in drupal:9.3.0 and is removed from drupal:10.0.0.
Use \Drupal\Core\File\FileUrlGenerator::transformRelative()
instead.
------ ---------------------------------------------------------------
[ERROR] Found 3 errors
Proposed resolution
- Change from
^8 || ^9 to core_version_requirement: ^8 || ^9 || ^10 in the block_library.info.yml
- Change from
^8.7.7 || ^9 to ^8 || ^9 || ^10 in the composer.json
- Change all deprecated packages, classes, functions, asset libraries to the Drupal 10 way
Remaining tasks
- ➖ Change to
core_version_requirement: ^8 || ^9 || ^10
- ➖ This will ease the work on farther drupal-check issues
- ➖ Real physical testing with Drupal ~10
API changes
Data model changes
Release notes snippet
Comments
Comment #2
rajab natshahComment #3
libbna commentedI will give it a try on this.
Comment #4
libbna commentedI have updated the composer.json file and .info file. But there is one more error that needs to fixed which is
Comment #5
libbna commentedThis is the final patch. Did all the changes.
Comment #6
rajab natshahComment #7
rajab natshahClosing as duplicate of #3296653: Automated Drupal 10 compatibility fixes