Reviewed & tested by the community
Project:
Facets
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Aug 2024 at 11:23 UTC
Updated:
23 May 2026 at 17:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
s.messaris commentedHere are 2 patches, one for 2.0.x, and one for 2.0.7.
Comment #3
pbabin commentedAll credit goes to @s.messaris . . . . 2.0.8 came out today and the patch for 2.0.7 doesn't work anymore. Copied and pasted the proposed changes and created a 2.0.8 patch.
Thank you @s.messaris for getting a handle on the "session has not been set" issue.
Comment #4
elc commentedPlease note that MockArraySessionStorage is only added to TESTS for KernelTestBase, and BrowserTestBase (and drush but that doesn't seem relevant here).
It should not be added to normal operation code.
I would suspect this issue is more to do with session not being specifically saved and added to the response.
Comment #5
pbabin commented@ELC - I greatly appreciate you chiming in on this. I'm still "relatively" new to Drupal so getting feedback like this is extremely helpful.
I'm curious as to why an earlier approach for pre 2.0.8 isn't also under your rubric as the patch I submitted was just a copy of previous work. Is it safe to assume that this entire approach isn't recommended?
I came this way from Facets with AJAX not working in most of situations where Patch 237 addressed our issue with the session not being set and this comment directs individuals over to this issue as a proposed solution for the exact issue.
Since 2.0.8 came out, the patch 237 no longer works and the patch I proposed is not recommended so we are still stuck with facets that are completely broken because we are getting the "session has not been set" error coming up.
Any recommendations on how to address this issue in a more Drupal appropriate way is greatly appreciated.
Comment #6
elc commentedMy apologies, I missed that the previous patches were also adding test classes into running code.
The issue for me is actually a combination of these:
Unfortunately, they do not apply cleanly because they are all changing the same code. I added a custom patch to 3466566 to apply after 3052574.
I've had to patch all of them in to get my situation working. It would be ideal if all of this was fixed as one. There is a META issue #3075378: [META] Overview of Facets + Ajax issues for the known issues of Facets + Ajax, of which there are a few. Doesn't look like 3466566 has been made part of that yet. This Ajax issue has been hanging around for a very long time.
The session issue is addressed in #3052574-254: Facets with AJAX not working in most of situations, so closing this as duplicate.
Comment #7
cb_govcms commented#3052574: Facets with AJAX not working in most of situations has an elaborate fix for a different issue that happens to also resolve this - but that issue has been open for 5 years and may not land any time soon. I'm attaching a patch for this issue that just resolves the Session error introduced in Core 10.3
Comment #8
tfranz commentedI tested the patch #7 with 2.0.9 and it solves the Session error.
Comment #9
drupixSame for me, the patch #7 with 2.0.9 solves the Session error.
Comment #10
treckstar commentedCan confirm that the patch in #3 for 2.0.8 worked for me in 2.0.9.
Thank you!
Comment #11
prudloff commentedSeveral people confirmed the patch fixes their problem.
(It also fixed it for us.)
Comment #12
w01f commentedAlso confirming patch #3 appears to solve issue on 10.4.2.
Comment #13
ludo.rPatch #3 solves the issue (however patch #7 seems a lot simpler/cleaner but I didn't test it).
Comment #14
trebormcPatch #7 solves the issue