Updated: Comment #0

Problem/Motivation

Current user service going to be refactored and should be properly injected into services according #2180109-96: Change the current_user service to a proxy
Forum manager serialized with all its services and static caches

Proposed resolution

Extend forum manager from DependencySerialization and clean-up static cache like #2081585-70: [META] Modernize the History module
Update methods to accept user account as required argument.

Remaining tasks

file patch

User interface changes

no

API changes

tbd

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost’s picture

Issue tags: +Novice

suppose this could be simply grep'ed

larowlan’s picture

When is forum manager serialized?

andypost’s picture

everytime when used in ajax forms

larowlan’s picture

Assigned: Unassigned » larowlan

working on this

larowlan’s picture

Assigned: larowlan » Unassigned
Status: Active » Needs review
Issue tags: -Novice
FileSize
5.57 KB

Something like so?

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Sure, also spotted.

+++ b/core/modules/forum/lib/Drupal/forum/ForumManager.php
@@ -135,13 +137,12 @@ public function __construct(ConfigFactoryInterface $config_factory, EntityManage
     global $forum_topic_list_header;

this one is confusing, but out o scope

larowlan’s picture

Dries’s picture

This patch looks good but what is the __sleep() and __wakeup() for?

larowlan’s picture

If an object is serialized, php calls wakeup function before unserializing. The sleep function is called before serializing. If forum manager is injected into a form, and that form uses caching (eg ajax) then forum manager gets serialized. This ensures it does so without keeping stale values.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

forum-mgr-serialization-2201659.1.patch no longer applies.

error: patch failed: core/modules/forum/lib/Drupal/forum/Controller/ForumController.php:82
error: core/modules/forum/lib/Drupal/forum/Controller/ForumController.php: patch does not apply
error: patch failed: core/modules/forum/lib/Drupal/forum/ForumManager.php:135
error: core/modules/forum/lib/Drupal/forum/ForumManager.php: patch does not apply
error: patch failed: core/modules/forum/lib/Drupal/forum/ForumManagerInterface.php:19
error: core/modules/forum/lib/Drupal/forum/ForumManagerInterface.php: patch does not apply

akozma’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
5.65 KB

Rerolled.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

back to rtbc

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed f099e8c and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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