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_class

cd  /var/www/html/sandboxes/drupal10block_class/

composer require 'drupal/block_class:2.0.x-dev@dev'

is having the following problem

- drupal/block_class dev-2.0.x requires drupal/core ^8 || ^9 -> satisfiable by drupal/core[8.0.0-beta6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.0.0-beta6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.0.x-dev].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.0.0-beta12, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.0.x-dev].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.0.0-beta16, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.0.x-dev].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.0.0-rc3, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.0.x-dev].
    - You can only install one version of a package, so only one of these can be installed: drupal/core[8.4.0-rc1, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.0.x-dev].
    - drupal/core-recommended 10.0.x-dev requires drupal/core 10.0.x-dev -> satisfiable by drupal/core[10.0.x-dev].
    - Root composer.json requires drupal/core-recommended ^10.0 -> satisfiable by drupal/core-recommended[10.0.0-alpha1, ..., 10.0.x-dev].


Farther drupal-check on

composer create-project drupal/recommended-project:~9 /var/www/html/sandboxes/drupal9block_class

cd /var/www/html/sandboxes/drupal9block_class/

composer config minimum-stability dev

composer require drupal/block_class

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_class/

Output:

block_class--drupal-check--report.txt

 ------ ---------------------------------------------- 
  Line   block_class.module                            
 ------ ---------------------------------------------- 
  56     Call to an undefined method                   
         Drupal\Core\Form\FormInterface::getEntity().  
 ------ ---------------------------------------------- 

 ------ -------------------------------------------------------- 
  Line   tests/src/Functional/BlockClassTest.php                 
 ------ -------------------------------------------------------- 
  58     Call to deprecated method assertRaw() of class          
         Drupal\Tests\BrowserTestBase:                           
         in drupal:8.2.0 and is removed from drupal:10.0.0. Use  
           $this->assertSession()->responseContains() instead.   
  60     Call to deprecated method assertRaw() of class          
         Drupal\Tests\BrowserTestBase:                           
         in drupal:8.2.0 and is removed from drupal:10.0.0. Use  
           $this->assertSession()->responseContains() instead.   
 ------ -------------------------------------------------------- 

 [ERROR] Found 3 errors                                                         



Proposed resolution

  • Change to ^8 || ^9 || ^10 in the composer.json file
  • Change all deprecated packages, classes, functions, asset libraries to the Drupal 10 way

Remaining tasks

  • ➖ Change to ^8 || ^9 || ^10 in the composer.json file
  • ➖ 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
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Rajab Natshah created an issue. See original summary.

rajab natshah’s picture

rajab natshah’s picture

Issue summary: View changes
StatusFileSize
new1.18 KB

hswong3i made their first commit to this issue’s fork.

rajab natshah’s picture

Status: Active » Closed (duplicate)

Closing as a duplicate
Moving the conversion if needed to
#3296649: Automated Drupal 10 compatibility fixes for Block Class

dydave’s picture

Version: 2.0.x-dev » 4.0.x-dev
Status: Closed (duplicate) » Needs review

Some interesting changes in this merge request:
https://git.drupalcode.org/project/block_class/-/merge_requests/5

Needs re-roll though: Create a new merge request on 4.0.x with the same changes.
(Could be moved manually, since there are very few changes)

Moving to Needs review, for now, as an attempt to get more attention and help with the re-roll, testing and review.

Feel free to let us know if you have any questions or concerns on any aspects of the latest code changes or the module in general, we would surely be glad to hear your feedback. 😊
Thanks in advance!

dydave’s picture

Title: Support Drupal 10 and update all use of deprecation in the Block Class module » Suggested deprecated code clean-up
rajab natshah’s picture

This issue was Closed (duplicate), also it is outdated.
to my knowledge it could be fixed in #3296649: Automated Drupal 10 compatibility fixes for Block Class
David, feel free to file a new issue.

dydave’s picture

Thanks Rajab (@rajab natshah)!

Sure, I understand and saw the history on this issue but if possible we would like to keep this merge request opened:
I "think" we might still want to merge these changes, but haven't had time to test or review them properly myself yet.

No problem for creating a new ticket with a new merge request, since this one doesn't apply anymore.

But if possible it would be good to keep this issue opened a little bit longer so these changes are not buried. 😅

We should create a follow-up ticket from this issue, with the same changes, and move this one back to Duplicate. 👌

Any advice, comments or suggestions would be greatly appreciated.
Thanks in advance! 😊

csakiistvan’s picture

@dydave, @rajab natshah — the surviving changes from MR !5 now have their own tickets on 4.0.x, so this one can go back to Closed (duplicate) as suggested in #7 and #10:

Two of the four changes in MR !5 were left out on purpose: the useDrupal\block\Entity\Block docblock typo is already fixed on 4.0.x, and the help_text_qty_items hunk replaces the empty check with an unconditional $help_text_qty_items = '';, which discards the incoming value. That is a behaviour change rather than a clean-up, so it needs its own decision — happy to open a third ticket if you want it kept.

The original Drupal 10 compatibility report is resolved: block_class.info.yml is on core_version_requirement: ^9 || ^10 || ^11.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.