Problem/Motivation

Drupal\Tests\views\Kernel\ThirdPartyUninstallTest triggers a deprecation in config schema on PHP 8.5.

Steps to reproduce

Run Drupal\Tests\views\Kernel\ThirdPartyUninstallTest and see

    Third Party Uninstall (Drupal\Tests\views\Kernel\ThirdPartyUninstall)
     ⚠ Third party uninstall
    
    1 test triggered 2 PHP deprecations:
    
    1) /builds/issue/drupal-3458923/core/lib/Drupal/Core/Config/Schema/Mapping.php:185
    Using null as an array offset is deprecated, use an empty string instead
    
    Triggered by:
    
    * Drupal\Tests\views\Kernel\ThirdPartyUninstallTest::testThirdPartyUninstall (42 times)
      /builds/issue/drupal-3458923/core/modules/views/tests/src/Kernel/ThirdPartyUninstallTest.php:43
    
    2) /builds/issue/drupal-3458923/core/modules/views/tests/modules/views_test_config/src/Hook/ViewsTestConfigHooks.php:24
    Using null as an array offset is deprecated, use an empty string instead
    
    Triggered by:
    
    * Drupal\Tests\views\Kernel\ThirdPartyUninstallTest::testThirdPartyUninstall (29 times)
      /builds/issue/drupal-3458923/core/modules/views/tests/src/Kernel/ThirdPartyUninstallTest.php:43

NOTE: We are only fixing one of the deprecations in this issue.

Proposed resolution

Don't do unnecessary array work when fallback value is NULL.

Remaining tasks

User interface changes

None

Introduced terminology

N/a

API changes

None

Data model changes

None

Release notes snippet

N/a

Issue fork drupal-3557055

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

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review

alexpott’s picture

Version: 11.3.x-dev » 11.x-dev
andypost’s picture

I bet it will fix more then this test, guess it needs Wim's approval

alexpott’s picture

Title: Drupal\Tests\views\Kernel\ThirdPartyUninstallTest triggers a deprecation on PHP 8.5 » \Drupal\Core\Config\Schema\Mapping::getDynamicallyValidKeys() triggers a deprecation on PHP 8.5

@andypost the code is equivalent - there's no actual change here. For the same inputs you get the same outputs. It is just more efficient.

Yes it fixes more tests that trigger the same deprecation. But it is not a bug fix.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Yes, it's more efficient then I did! Let's unblock remains

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed c5aeab53a01 to 11.x and 61189f33d47 to 11.3.x. Thanks!

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.

  • longwave committed 61189f33 on 11.3.x
    Issue #3557055 by alexpott, andypost: \Drupal\Core\Config\Schema\Mapping...

  • longwave committed c5aeab53 on 11.x
    Issue #3557055 by alexpott, andypost: \Drupal\Core\Config\Schema\Mapping...

Status: Fixed » Closed (fixed)

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