Problem/Motivation

\Drupal\workspaces\WorkspaceRepository::loadTree() uses NULL as an array key to signify that a workspace has no parent. This cannot work on PHP 8.5 as this triggers a deprecation. As it goes a NULL as an array key has always been an empty string so let's just continue with that. See https://3v4l.org/6qLRr

Steps to reproduce

Run \Drupal\Tests\workspaces\Kernel\WorkspaceEntityRepositoryTest on PHP 8.5.

Proposed resolution

Use an empty string as an array key in \Drupal\workspaces\WorkspaceRepository::loadTree() when the workspace has no parent.

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

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
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Updated my ddev to 8.5.0RC3 and ran the full file WorkspaceEntityRepositoryTest got
1 test triggered 4 PHP deprecations:

Applied the MR

Re-ran same exact file and got 0 deprecations

LGTM.

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.

  • catch committed b7ca1b18 on 11.3.x
    Issue #3556884 by alexpott, smustgrave: \Drupal\workspaces\...

  • catch committed 79fea467 on 11.x
    Issue #3556884 by alexpott, smustgrave: \Drupal\workspaces\...

Status: Fixed » Closed (fixed)

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