Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There seems to be an issue when anonymous page caching is enabled.
Duplication steps:
Enabled anonymous caching.
Refresh any page as an anonymous user.
PHP Fatal error: Call to undefined function drupal_session_started() in /Library/WebServer/Documents/achieve-client/profiles/openatrium/modules/contrib/og_session_context/og_session_context.module on line 108
Comments
Comment #2
mpotter CreditAttribution: mpotter commentedThat sounds more like a site-specific configuration problem, maybe an issue with APC or something. drupal_session_started() is a core function in Drupal and should always be available.
Can anybody else reproduce this?
Comment #3
shawn_smiley CreditAttribution: shawn_smiley commentedGood morning mpotter,
Here is some additional information and context for this issue. Though I agree that this is an extremely odd error that shouldn't be possible.
This error is occurring on our Pantheon hosting Open Atrium 2 site. The errors started occurring after we upgraded OA2 from 2.43 to 2.44.
Here is the callstack logged by Pantheon when the error occurs:
We have had Pantheon completely restart our application containers thinking that it was a problem with the PHP 5.5 OpCache. But that did not resolve the issue.
Disabling Anonymous Page Caching does make the error go away though.
Comment #5
mpotter CreditAttribution: mpotter commentedHmm, I might have found this. There was a recent change to og_session_context and it looks like Drupal can call the hook_exit before the session.inc stuff is bootstrapped. Try the commit given in bd21d6a (or pull the -dev version of this module) and let me know if that fixes it. Then I'll roll a new release to get this into v2.45 in a few days.
Comment #6
Tristanwellz CreditAttribution: Tristanwellz commentedHI Mpotter,
Thanks for pushing a fix so quickly. I updated our module and tested it in local environment and everything looks good.
Thanks,
Comment #7
dpoletto CreditAttribution: dpoletto commentedHi @mpotter!
Today observing - as maintenance practice - PHP error logs of a recently upgraded OA 2.45 site (from 2.44) I noticed that, since about (*) mid September (when the site was upgraded from 2.43 to 2.44 by me), various PHP Fatal Errors were reported (and currently the site continue to generate)...AFAIK...every time a user performs a site logout.
Here the error:
So I checked and I found the reference to above reported Commit bd21d6a for og_session_context and, cross-checking my OA 2.45, I noticed that its Session Context module still reports 7.x-1.0-beta3 version (so of mid August and shared with OA 2.44 at most) and so it hasn't that commit committed...at least this is what I see on my site.
Here its code:
Could you confirm the latest Commit subject of this thread has really been committed into OA 2.45?
Am I wrong and my site has something strange or what?
Thanks for watching.
Edit (*): ...when I enabled "Cache pages for anonymous users"...in the end I can live without it (disabled) but the issue will remain.
Comment #8
dpoletto CreditAttribution: dpoletto commentedBelow, just as reference, og_session_context.module versions provided with OA 2.2x, 2.3x and 2.4x versions, up to latest OA 2.45:
Comment #9
rabithk CreditAttribution: rabithk commentedI have the same issue in "openatrium-7.x-2.45" also . If I clear the performance cache , this work , but if I load the anonymous page again and again , I am getting the same error . Any issue fix for this?
Comment #10
mpotter CreditAttribution: mpotter commentedThe fix is to use the -dev version of the og_session_context module. We'll get a release of this put into the next Atrium update.
Comment #11
rabithk CreditAttribution: rabithk commentedyou mean to say I can update only "og_session_context" 7.x-1.x-dev inside the "openatrium-7.x-2.45" core ?
Comment #12
dpoletto CreditAttribution: dpoletto commentedThanks Mike for clarifying.
Comment #13
mpotter CreditAttribution: mpotter commentedrabithk: yes, if you absolutely need this fix before the next release. Or, you can just apply the patch shown here http://cgit.drupalcode.org/og_session_context/commit/?id=bd21d6ab167af09... to og_session_context.
The issue was fixed, but we just forgot to tag a new release of that module and get it into Atrium.
Comment #14
mpotter CreditAttribution: mpotter commentedOr, just disabled the "Cache pages for anonymous users" until the next release.
Comment #15
rabithk CreditAttribution: rabithk commentedThank you Mike . I will try with #13 ( applying patch or using new version of the module , - When I am comparing the dev and recommended version , there is no difference, the patch is already applied. ) , as I want to use cache for anonymous users.