Problem/Motivation

\Drupal\Tests\views\Kernel\Handler\FieldKernelTest triggers deprecations on PHP 8.5 due to the way the test is written.

    1) /builds/issue/drupal-3523596/core/modules/views/src/Plugin/views/field/FieldPluginBase.php:1696
    Using null as an array offset is deprecated, use an empty string instead

Steps to reproduce

Run \Drupal\Tests\views\Kernel\Handler\FieldKernelTest and \Drupal\Tests\views\Kernel\Handler\FieldDropbuttonTest::testDropbuttonMarkupShouldNotLeakBetweenRows and \Drupal\Tests\views\Kernel\Handler\FieldSelfTokensTest and \Drupal\Tests\views\Functional\Handler\FieldWebTest::testTextRendering and \Drupal\Tests\views\Functional\Handler\FieldWebTest::testAlterUrl

Proposed resolution

Fix test to not trigger deprecations in FieldPluginBase.php:1696

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-3557459

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

Status: Needs review » Active
alexpott’s picture

Issue summary: View changes
Status: Active » Needs review
alexpott’s picture

Title: \Drupal\Tests\views\Kernel\Handler\FieldKernelTest triggers deprecations on PHP 8.5 » Tests trigger deprecations in \Drupal\views\Plugin\views\field\FieldPluginBase::getRenderTokens on PHP 8.5
Issue summary: View changes
smustgrave’s picture

Locally using 8.5.0RC3 did not work so ran in the gitlab runner

Ran FieldKernelTest got 5 tests triggered 1 PHP deprecation:
Ran FieldDropbuttonTest::testDropbuttonMarkupShouldNotLeakBetweenRows got 1 test triggered 1 PHP deprecation:
Ran FieldSelfTokensTest got 1 test triggered 1 PHP deprecation
Ran FieldWebTest::testTextRendering got 1 test triggered 1 PHP deprecation:
Ran FieldWebTest::testAlterUrl got 1 test triggered 1 PHP deprecation:

Locally I'm still getting 1 deprecation,

1) /builds/issue/drupal-3557459/core/lib/Drupal/Core/Config/Schema/Mapping.php:185
Using null as an array offset is deprecated, use an empty string instead

Is this in scope? Example for FieldKernelTest https://git.drupalcode.org/issue/drupal-3557459/-/jobs/7282445

alexpott’s picture

@smustgrave no that is not in scope. The scope is the

    1) /builds/issue/drupal-3523596/core/modules/views/src/Plugin/views/field/FieldPluginBase.php:1696
    Using null as an array offset is deprecated, use an empty string instead

deprecation.

Merged in HEAD because that deprecation is already fixed.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Rock on!

  • catch committed ee60b69f on 11.3.x
    fix: #3557459 Tests trigger deprecations in \Drupal\views\Plugin\views\...

  • catch committed 819b0627 on 11.x
    fix: #3557459 Tests trigger deprecations in \Drupal\views\Plugin\views\...
catch’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked 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.

Status: Fixed » Closed (fixed)

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