Problem/Motivation

Identify and fix deprecation notices, if any. Via Drupal-check or Upgrade status, etc. There might be deprecated Twig, or tests.

Proposed resolution

Search and destroy.

blazy 10-ready

Remaining tasks

  • https://www.drupal.org/pift-ci-job/2267416:
    PHP Fatal error: Declaration of Drupal\Tests\blazy\FunctionalJavascript\BlazyJavaScriptTestBase::setUp() must be compatible with Drupal\Tests\BrowserTestBase::setUp(): void in
    /var/www/html/modules/contrib/blazy/tests/src/FunctionalJavascript/BlazyJavaScriptTestBase.php on line 46

    This has consequences to Slick, etc. since they also extend Blazy tests.

Scanned on Thu, 12/16/2021 - 15:39.

29 warnings found.

Check manually

Errors without Drupal source version numbers including parse errors and use of APIs from dependencies.
Status File name Line Error
[x] web/modules/custom/blazy/src/BlazyManagerBase.php 110 The "app.root" service is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Use the app.root parameter instead. See https://www.drupal.org/node/3080612
[x] web/modules/custom/blazy/src/Plugin/Filter/BlazyFilterBase.php 91 The "app.root" service is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Use the app.root parameter instead. See https://www.drupal.org/node/3080612
[x] web/modules/custom/blazy/tests/src/FunctionalJavascript/BlazyFilterJavaScriptTest.php 53 The "app.root" service is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Use the app.root parameter instead. See https://www.drupal.org/node/3080612
[x] web/modules/custom/blazy/tests/src/FunctionalJavascript/BlazyJavaScriptTestBase.php 51 The "app.root" service is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Use the app.root parameter instead. See https://www.drupal.org/node/3080612
[x] web/modules/custom/blazy/blazy_ui/blazy_ui.info.yml 0 Value of core_version_requirement: ^8.8 || ^9 is not compatible with the next major version of Drupal core. See https://drupal.org/node/3070687.

Fix later

Based on the Drupal deprecation version number of these, fixing them may make the contributed project incompatible with supported Drupal core versions.
Status File name Line Error
[x] web/modules/custom/blazy/src/BlazyAlter.php 111 Call to deprecated function drupal_get_path(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.
[x] web/modules/custom/blazy/src/BlazyUtil.php 91 Call to deprecated function file_build_uri(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0 without replacement.
[x] web/modules/custom/blazy/src/BlazyUtil.php 214 Call to deprecated function file_create_url(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface instead.
[x] web/modules/custom/blazy/src/BlazyUtil.php 215 Call to deprecated function file_url_transform_relative(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
Drupal\Core\File\FileUrlGenerator::transformRelative() instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class
Drupal\Tests\blazy\FunctionalJavascript\BlazyFilterJavaScriptTest)
484 Call to deprecated function file_create_url(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class
Drupal\Tests\blazy\FunctionalJavascript\BlazyFilterJavaScriptTest)
484 Call to deprecated function file_url_transform_relative(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
Drupal\Core\File\FileUrlGenerator::transformRelative() instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class
Drupal\Tests\blazy\FunctionalJavascript\BlazyFilterJavaScriptTest)
492 Call to deprecated function file_create_url(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class
Drupal\Tests\blazy\FunctionalJavascript\BlazyFilterJavaScriptTest)
511 Call to deprecated function file_create_url(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class
Drupal\Tests\blazy\FunctionalJavascript\BlazyFilterJavaScriptTest)
511 Call to deprecated function file_url_transform_relative(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
Drupal\Core\File\FileUrlGenerator::transformRelative() instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class
Drupal\Tests\blazy\FunctionalJavascript\BlazyJavaScriptTestBase)
484 Call to deprecated function file_create_url(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class
Drupal\Tests\blazy\FunctionalJavascript\BlazyJavaScriptTestBase)
484 Call to deprecated function file_url_transform_relative(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
Drupal\Core\File\FileUrlGenerator::transformRelative() instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class
Drupal\Tests\blazy\FunctionalJavascript\BlazyJavaScriptTestBase)
492 Call to deprecated function file_create_url(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class
Drupal\Tests\blazy\FunctionalJavascript\BlazyJavaScriptTestBase)
511 Call to deprecated function file_create_url(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class
Drupal\Tests\blazy\FunctionalJavascript\BlazyJavaScriptTestBase)
511 Call to deprecated function file_url_transform_relative(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
Drupal\Core\File\FileUrlGenerator::transformRelative() instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class Drupal\Tests\blazy\Kernel\BlazyKernelTestBase) 484 Call to deprecated function file_create_url(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class Drupal\Tests\blazy\Kernel\BlazyKernelTestBase) 484 Call to deprecated function file_url_transform_relative(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
Drupal\Core\File\FileUrlGenerator::transformRelative() instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class Drupal\Tests\blazy\Kernel\BlazyKernelTestBase) 492 Call to deprecated function file_create_url(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class Drupal\Tests\blazy\Kernel\BlazyKernelTestBase) 511 Call to deprecated function file_create_url(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class Drupal\Tests\blazy\Kernel\BlazyKernelTestBase) 511 Call to deprecated function file_url_transform_relative(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
Drupal\Core\File\FileUrlGenerator::transformRelative() instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class Drupal\Tests\blazy\Kernel\Views\BlazyViewsTestBase) 484 Call to deprecated function file_create_url(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class Drupal\Tests\blazy\Kernel\Views\BlazyViewsTestBase) 484 Call to deprecated function file_url_transform_relative(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
Drupal\Core\File\FileUrlGenerator::transformRelative() instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class Drupal\Tests\blazy\Kernel\Views\BlazyViewsTestBase) 492 Call to deprecated function file_create_url(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class Drupal\Tests\blazy\Kernel\Views\BlazyViewsTestBase) 511 Call to deprecated function file_create_url(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on
\Drupal\Core\File\FileUrlGeneratorInterface instead.
[x] web/modules/custom/blazy/tests/src/Traits/BlazyCreationTestTrait.php (in context of class Drupal\Tests\blazy\Kernel\Views\BlazyViewsTestBase) 511 Call to deprecated function file_url_transform_relative(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
Drupal\Core\File\FileUrlGenerator::transformRelative() instead.

User interface changes

None, yet.

API changes

None, yet.

Data model changes

None, yet.

Comments

gausarts created an issue. See original summary.

gausarts’s picture

Issue summary: View changes
gausarts’s picture

Issue summary: View changes
gausarts’s picture

Issue summary: View changes
gausarts’s picture

Issue summary: View changes
gausarts’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new4.33 KB

We'll fix them one at a time for easy tracking.

Fixing:
app.root and core_version_requirement

  • gausarts committed b2eb485 on 8.x-2.x
    Issue #3254692 by gausarts: Drupal 10, identify deprecation, etc
    
gausarts’s picture

Issue summary: View changes
StatusFileSize
new6.49 KB

Fixing:
file_BLAH

gausarts’s picture

Issue summary: View changes
StatusFileSize
new75.99 KB
gausarts’s picture

StatusFileSize
new1.56 KB

Fixing:
::setUp() with typehints, specific for FunctionalJavascript.

It looks like only applicable to FunctionalJavascript, but not Drupal\Tests\field\Kernel\FieldKernelTestBase, etc.

Based on this CR, typehints should be applicable to all. But the codebase at current D9.3 shows FieldKernelTestBase::setUp() has no type hints:
https://git.drupalcode.org/project/drupal/-/blob/9.3.0/core/modules/fiel...

This one I don't fully understand, making me worry no longer compatible with D9 when pursuing D10 for tests:
> In order for tests to be compatible with both PHPUnit 6 and 7 (used in Drupal 8) and PHPUnit 8 (used in Drupal 9), a backward compatibility shim was added so these typehints are not yet required, but this compatibility shim will be removed in Drupal 10, or earlier if a newer version of PHPUnit means it is no longer viable to support.

More info is appreciated. Thanks.

gausarts’s picture

StatusFileSize
new5.43 KB

Fixing the remaining:
::setUp() with typehints.

Let's see if any complaints at D9.

  • gausarts committed 6132b85 on 8.x-2.x
    Issue #3254692 by gausarts: Drupal 10, identify deprecation, etc
    
gausarts’s picture

StatusFileSize
new1.08 KB

Fixing the leftover:
::setUp() with typehints, specific for Views.

  • gausarts committed ceccca1 on 8.x-2.x
    Issue #3254692 by gausarts: Drupal 10, identify deprecation, etc
    

  • gausarts committed d88f719 on 8.x-2.x
    Issue #3254692 by gausarts: Drupal 10, identify deprecation, etc
    
gausarts’s picture

Status: Needs review » Fixed

Looks like D9 and D10 are happy now:
https://www.drupal.org/node/2663268/qa

If any additional or new deprecation notices to fix, feel free to create a new thread referencing this as parent for documentation purposes, and to de-clutter.

This session is done. It's finished.

Any misses or improvements due to this change may follow behind the screen (formalities are over now), or your bug report as usual.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

heddn’s picture

Can we create a new release with these fixes in it?