Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Mar 2015 at 13:52 UTC
Updated:
11 Jul 2016 at 21:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
colinmccabe commentedComment #2
colinmccabe commentedComment #3
colinmccabe commentedComment #4
colinmccabe commentedComment #5
checker commentedLooks good.
Comment #6
brianV commented+1 to this patch as well, and it's very simple. Setting to RTBC
Comment #7
Peter Bowey commentedSee https://www.drupal.org/node/2638016
Logic: I found zero 'google' or 'drupal' solutions until this post @ https://www.drupal.org/node/2638016
I spent 36 hours searching :)
Then my post was closed as a duplicate, despite the fact that google placed it on the first page?
Comment #8
jackbravo commented@Peter Bowey your issue has better SEO and ranks better in google but usually the older issue is the one that sticks, and new ones are closed as duplicate. Only when an issue has clearly more activity (more information, patches, reviews, etc) it can be kept instead of the older one.
Comment #9
deminyI started using PHP 7.0.1 few days ago and since then I noticed PHP notice "Warning: session_destroy(): Session object destruction failed in drupal_session_commit() (line 314 of ....../includes/session.inc)."
I tried truncating the session table and some other attempts but none worked. Finally I started looking at PHP documentation, and, as mentioned by the original post, the customized function _drupal_session_destroy() was not returning a boolean value back as should.
Finally I made a patch quite similar to the original post. I'm not seeing the error being reported on my production server since then.
Highly suggest to get the patch included in next Drupal release. Thanks.
Comment #10
brianV commentedChanging this back to 'Needs Work' as #2638016: Drupal 7.51 + PHP 7 (release) user_logout() session_destroy() expects true/false return highlights other areas we need to return a Boolean
Comment #11
checker commentedComment #12
checker commentedComment #14
Neo13 commentedThe patch is working for me.
Comment #15
jackbravo commentedHere is a new patch. It is a re-roll of patch on #11 because it was no longer applying. But also we now return false in some situations (when the old code returned null) because it seemed like the correct thing to do since NULL == FALSE and those situations were actually result of not being able to save the session.
Comment #17
jackbravo commentedSeems like there was an error on the automatic testing. Settings to needs review to try again.
Comment #18
sylus commentedThe last patch broke Drupal for me so seems something is wrong with the logic and not the testbot?
The patch in #2460833-2: _drupal_session_destroy() should return boolean resolved specific php 7 issue for me ^_^
Comment #19
David_Rothstein commentedLet's up this to major (at least) since it's the main thing which prevents tests passing on PHP 7. See #2656548: Fully support PHP 7.0 in Drupal 7.
Comment #20
jackbravo commented@David_Rothstein, how can we run the tests again? Seems like last time there was an error on the testing bot, not in the patch itself....
Comment #21
jackbravo commentedOk, I see the error..... There was a syntax error in there.
Comment #23
mustanggb commentedTest results showing no session_destroy() failures, setting status for committer consideration.
Comment #24
jackbravo commentedUpon further reviewing this patch I found that some return statements were changed on functions that are not part of the session_handlers. The session_handlers functions can be recognized because the start with _ and because they are explicitly declared here:
Inside the `drupal_session_initialize` function. Only those functions need to return TRUE or FALSE in PHP 7, so I removed the changes to the other functions in this new patch.
Comment #25
twistor commentedAs per #24, and the issue title. These patches are changing too much.
The session callbacks that need to return a boolean are:
This means the only thing that needs to be fixed, as the title says, is _drupal_session_destroy().
Uploading new patch, since #24 missed some extra changes.
Comment #28
twistor commentedComment #29
alan d. commentedWhat @twistor said, just the two return statements, see http://php.net/manual/en/function.session-set-save-handler.php
I have no idea what return FALSE will do, but drupal_save_session() is just static internal flag. Based on other code in core;
As it is used for impersonating users, etc,
So it isn't actually an error / failure here, I believe.
Comment #30
alan d. commentedComment #32
mrharolda commentedLooks like all errors aren't related to this patch ...
Comment #33
Paulset commentedIs there a solution for this error?
Comment #34
perignon commentedFor now I am allowing PHP 7 to fail till I can take a better look at this. Putting out other fires associated with D7.43.
Comment #35
mustanggb commentedAs per #32, this lighterweight version does the originally intended job.
Comment #36
perignon commentedI am writing a module right now that runs tests using the drupalLogout() in DrupalWebTestCase, previously this was of course throwing exceptions for PHP 7. I just added this script to my Travis CI tests and was able to get a pass.
https://travis-ci.org/taz77/drupal-facebook_tracking_pixel/jobs/112011755
+1 RTBC
Comment #37
perignon commentedAlthough oddly enough I started getting failures in PHP 5.6 after applying this patch in my tests for my module, investigating.
I just added 5.6 testing to the patch to see what happens here and requeued the other tests.
Comment #38
perignon commentedI really do not understand how/why the patch is failing testing.
My failure seems to be with an assertion in the module I am writing. I don't think it's associated with this patch at all.
Comment #39
anybodyWonderful. This should be part of the next stable core release. Confirming RTBC and thank you very much for your work!
Comment #40
damienmckennaComment #41
joelstein commentedWorks for me with PHP 7. Let's get it committed!
Comment #42
alan d. commentedTests still appear completely unrelated.
Been running this on at least 5 clients sites (PHP 7 on UNIX) without issue for months now :)
Comment #43
W.M. commentedTested patch #30, works flawlessly. Please get it committed.
Comment #44
ogursoy commentedWorkss with php7 !!! Comitte Please.
Comment #45
neurer commentedPatch at #30 fixes this on two Drupal 7.43/PHP 7.0.x setups for me. Thank you very much. Please commit.
Comment #46
Crell commentedComment #47
W.M. commentedCommit please. There is still (and will be forever) some Drupal 7 people here.
Comment #48
Rodeo.be commentedCommit please :-) Still a lot of Drupal7 users here
Comment #49
fabianx commented+1 to RTBC
Assigning to maintainer.
Comment #50
perignon commentedRooting for a commit!
Comment #51
vcouver commentedThank you Alan.
I had the same problem since the new installation of Ubuntu 16.04 and PHP 7.0.4-7 and MySQL 5.7.12-0 ( But not with Ubuntu 15.10 was with PHP 5.6.11 and MySQL 5.6.30 )
It's now resolved with Ubuntu 16.04.! Thank you so much!
Comment #52
David_Rothstein commentedThe patch looks good -- this definitely looks on track to be committed and included in the next release.
For those interested in PHP 7, note that there are several other issues that still need reviews - see #2656548: Fully support PHP 7.0 in Drupal 7 for details. Hopefully we can get those all into the next release so that all Drupal core tests pass on PHP 7.
Comment #53
stefan.r commentedComment #54
perignon commentedWoot!
Comment #55
stefan.r commentedComment #56
stefan.r commentedComment #57
David_Rothstein commentedCommitted to 7.x - thanks!
Comment #59
W.M. commentedThank you very much.