Drupal 11 compatibility

Created on 2 May 2024, 7 months ago
Updated 5 September 2024, 3 months ago

Problem/Motivation

Drupal 11 will be released soon. Let's make this module Drupal 11 compatible!

Analysis of work to be done

1. Drupal's project update bot ( 📌 Automated Drupal 11 compatibility fixes for media_library_form_element Needs review ) does not report/provide any changes beyond changing the core_version_requirement.
2. An execution of drupal-rector finds no other Drupal deprecations:

docker@cli:/var/www$ vendor/bin/rector process web/modules/contrib/media_library_form_element/ --dry-run
 13/13 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

                                                                                                                        
 [OK] Rector is done!                                                                                                   
                                                                                                                   

3. Running tests against Drupal 11 reports the following, due to the use of waitOnAjaxRequest:

Time: 00:25.266, Memory: 10.00 MB

There was 1 error:

1) Drupal\Tests\media_library_form_element\FunctionalJavascript\SingleItemTest::testForm
RuntimeException: Unable to complete AJAX request.

/var/www/repos/drupal/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php:117
/var/www/repos/drupal/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php:38
/var/www/web/modules/contrib/media_library_form_element/tests/src/FunctionalJavascript/SingleItemTest.php:147
/var/www/web/modules/contrib/media_library_form_element/tests/src/FunctionalJavascript/SingleItemTest.php:247
/var/www/vendor/phpunit/phpunit/src/Framework/TestResult.php:729

4. Running the tests with deprecation helpers in D10 yields:

  12x: Drupal\FunctionalJavascriptTests\JSWebAssert::assertExpectedAjaxRequest called unnecessarily in a test is deprecated in drupal:10.2.0 and will throw an exception in drupal:11.0.0. See https://www.drupal.org/node/3401201
    11x in SingleItemTest::testForm from Drupal\Tests\media_library_form_element\FunctionalJavascript
    1x in SingleItemTest::testWebform from Drupal\Tests\media_library_form_element\FunctionalJavascript

  4x: Using a translatable string as a category for field type is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3375748
    2x in SingleItemTest::testForm from Drupal\Tests\media_library_form_element\FunctionalJavascript
    2x in SingleItemTest::testWebform from Drupal\Tests\media_library_form_element\FunctionalJavascript
📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States mark_fullmer Tucson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024