Problem/Motivation

\Drupal\tour\TipPluginBase::getLocation causes deprecations on PHP 8.1 because of expecting that $location is string (but it could be null)

See #3220021: [meta] Ensure compatibility of Drupal 9 with PHP 8.1 (as it evolves) and commit https://git.drupalcode.org/project/drupal/-/commit/b1e8cb8326a31194baa92... for credits

Steps to reproduce

Run core/modules/views_ui/tests/src/Functional/ViewsUITourTest.php on PHP 8.1

Exception : Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated
Drupal\tour\TipPluginBase->getLocation()() (Line: 162)

Proposed resolution

Fix \Drupal\tour\TipPluginBase::getLocation() to handle null properly in trim()

Remaining tasks

review/commit

User interface changes

no

API changes

no

Data model changes

no

Release notes snippet

no

CommentFileSizeAuthor
#2 3240362-2.patch527 bytesandypost
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost created an issue. See original summary.

andypost’s picture

Status: Active » Needs review
FileSize
527 bytes

Patch from commit

daffie’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 3265a80 and pushed to 9.3.x. Thanks!

  • alexpott committed 3265a80 on 9.3.x
    Issue #3240362 by andypost: \Drupal\tour\TipPluginBase::getLocation()...

Status: Fixed » Closed (fixed)

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