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
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
Comment #2
longwaveComment #4
alexpottIt's the return type that's breaking... we shouldn't even be adding that in 11.3.x - right? The deprecation is fine...
Comment #5
alexpottIMO; Let's remove the return type and try to remember we can't not add them to existing methods on base classes like this....
Comment #6
alexpottOTOH let's do this now in 11.2.x and then remove the return typehint in 11.3.x
Comment #9
catchCommitted/pushed to 11.2.x, thanks!
Comment #12
alexpottPushed 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()
Comment #13
longwaveAlso opened MR!13711 that re-adds the property that was deprecated and handled in the magic getter.
Comment #17
catchWent 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.
Comment #18
catchFair enough about the argument type hint. Let's just swap the phpstan baseline entry for @return docs.
Comment #19
alexpottWe 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
Comment #20
catchGood find on the return, last approach looks good.
Comment #21
longwaveCommitted and pushed to 11.x and 11.3.x. thanks!