Problem/Motivation

Drupal 10.0 development


Thank you so much for the Drupal Core team

Following with


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.

Farther drupal-check on

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

  • N/A

Data model changes

  • N/A

Release notes snippet

  • N/A

Comments

Rajab Natshah created an issue. See original summary.

rajab natshah’s picture

Issue summary: View changes
Issue tags: +Drupal 10 compatibility
StatusFileSize
new1.38 KB
libbna’s picture

Assigned: Unassigned » libbna
Issue tags: +Drupal 10 porting day

I will give it a try on this.

libbna’s picture

Status: Active » Needs work
StatusFileSize
new2.49 KB

I have updated the composer.json file and .info file. But there is one more error that needs to fixed which is

libbna’s picture

Assigned: libbna » Unassigned
Status: Needs work » Needs review
StatusFileSize
new3.42 KB

This is the final patch. Did all the changes.

rajab natshah’s picture

Priority: Normal » Major
rajab natshah’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#3296653: Automated Drupal 10 compatibility fixes