Problem/Motivation

We are creating dynamic properties in the SelectQuery class:

Deprecated function: Creation of dynamic property SelectQuery::$alterTags is deprecated in SelectQuery->addTag() (line 978 of /includes/database/select.inc).
Deprecated function: Creation of dynamic property SelectQuery::$alterMetaData is deprecated in SelectQuery->addMetaData() (line 997 of /includes/database/select.inc).

Steps to reproduce

Run simpletest on PHP 8.2.

Proposed resolution

Add the properties.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3304886-2.patch655 bytespoker10

Comments

poker10 created an issue. See original summary.

poker10’s picture

Status: Active » Needs review
StatusFileSize
new655 bytes
mcdruid’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +RTBM

:thumbsup:

  • poker10 committed 3c7c72f on 7.x
    Issue #3304886 by poker10: [D7 PHP 8.2] Deprecated function: Creation of...
poker10’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -RTBM

Committed and pushed. Thanks!

Status: Fixed » Closed (fixed)

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

solideogloria’s picture

This change causes this contrib issue in Entity Reference

#3325972: Cannot access protected property SelectQuery::$alterTags in EntityReference_SelectionHandler_Generic->reAlterQuery()

Nothing needs to be done in core, but it'd be helpful if anyone knows a way to fix this issue.

Alternatively, the properties could be made public?

taran2l’s picture

https://git.drupalcode.org/project/drupal/-/blob/10.0.x/core/lib/Drupal/...

D10 made them public, we need a follow-up to revert this change

joseph.olstad’s picture

Thanks for the fix, I had one or two on 7.93, just upgrading them now to 7.94, people were confused, fixed now.