Problem/Motivation
Some forms desire to render the name of the currently logged in user (e.g., the comment form). If the form is stored in the cache, then the AccountProxy gets serialized. This currently does not seem to have any bad effects, but it does not make much sense to serialize the proxy either. Affected code typically looks like this:
$form['#theme'] = 'username';
$form['#account'] = $this->currentUser;
Proposed resolution
?
Remaining tasks
User interface changes
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | drupal-AccountProxy-should-not-be-serialized-2430447-18-test.patch | 651 bytes | avpaderno |
| #7 | 2430447-07.patch | 589 bytes | jhedstrom |
| #1 | 2430447-do-not-serialize-account-proxy.diff | 562 bytes | znerol |
Comments
Comment #1
znerol commentedComment #2
znerol commentedComment #4
znerol commentedComment #5
xjmDiscussed with @znerol; this sounds probably at least major.
Comment #6
dawehnerSo those places are all kinda problems?
Comment #7
jhedstromRe-roll of #1 just to see where this is still an issue.
Comment #9
jhedstromNot bad, down to only 1 instance where this happens!
Comment #17
avpadernoComment #18
avpadernoComment #20
avpadernoI am not sure this issue is still relevant. Starting from Drupal 8.8.x, the
AccountProxyclass uses theDependencySerializationTraittrait, which was not used on previous versions.Drupal 8.8.x
Drupal 8.1.x
Using
DependencySerializationTraitshould resolve any issue, since it avoids the service container and any service are serialized. (SeeDependencySerializationTrait::__sleep().)It seems this issue should be closed as outdated.
The comments on the
AccountProxyclass should be updated/removed, but that should be object of a new issue.Comment #21
avpadernoComment #29
pameeela commentedPer #20 this is outdated. I will create a follow up task to update the comment but I don't know what specifically should be updated.