Problem/Motivation

#3532741: Switching workspaces shouldn't clear the persistent entity cache was backported to 11.2.x, including a new deprecation.

In turn this deprecation is incompatible with Webform and causes fatal errors on upgrade: #3556348: Fatal error: Declaration of Drupal\webform\EntityStorage\WebformEntityStorageTrait::__get($name) must be compatible with Drupal\Core\Entity\ContentEntityStorageBase::__get(string $name): mixed

Steps to reproduce

Install Drupal 11.2.6 and Webform.

Proposed resolution

Remove the deprecation from 11.2.x, keep it in 11.3.x which gives Webform time to fix and users time to upgrade.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3556493

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

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review

alexpott’s picture

It's the return type that's breaking... we shouldn't even be adding that in 11.3.x - right? The deprecation is fine...

alexpott’s picture

IMO; Let's remove the return type and try to remember we can't not add them to existing methods on base classes like this....

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

OTOH let's do this now in 11.2.x and then remove the return typehint in 11.3.x

  • catch committed a5729165 on 11.2.x
    Issue #3556493 by longwave, alexpott: Revert deprecation in...

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.2.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.

alexpott’s picture

Status: Fixed » Needs review

Pushed up MR for 11.x / 11.3.x removal of the return typehint. Imo we'll never need to add it because we only have this for BC reasons so we'll remove the __get()

longwave’s picture

Also opened MR!13711 that re-adds the property that was deprecated and handled in the magic getter.

  • catch committed dc9d94a9 on 11.2.x
    Issue #3556493 by longwave, alexpott: Revert deprecation in...

catch’s picture

Went ahead and committed 11.2.x from needs review since it is only a partial revert, so that the merge pipeline can start running. Retrospective reviews would be welcome given we want to get the paperbag release out today, and it would be good not to be making a third release tomorrow after doing something silly.

catch’s picture

Version: 11.2.x-dev » 11.x-dev
Status: Needs review » Needs work

Fair enough about the argument type hint. Let's just swap the phpstan baseline entry for @return docs.

alexpott’s picture

Status: Needs work » Needs review

We also need to change the behaviour here... the current implementation gives public access to all the class properties. But that's not necessary __get() is not called for properties that exist so we can trigger a warning here and move on... that's what PHP would do without the __get() - see https://3v4l.org/9uHdt

catch’s picture

Title: Revert deprecation in ContentEntityStorageBase::__get() » Fix deprecation in ContentEntityStorageBase::__get()
Status: Needs review » Reviewed & tested by the community

Good find on the return, last approach looks good.

longwave’s picture

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

Committed and pushed to 11.x and 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 de1a892e on 11.3.x
    Issue #3556493 by longwave, alexpott, catch: Fix deprecation in...

  • longwave committed 2c0aa979 on 11.x
    Issue #3556493 by longwave, alexpott, catch: Fix deprecation in...

Status: Fixed » Closed (fixed)

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