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.
This issue happens with PHP 5.0.4, but not with PHP 4.3.11.
Whenever I change a setting from administer > (any module), "changes have been saved" messages and other notifications do not disappear.
I end up with dozens of notifications while changing settings and browsing through drupal modules. Other red error messages stack up as well (even if I fix what they want).
Logging out does not solve the problem.
Comment | File | Size | Author |
---|---|---|---|
#15 | bootstrap_14.patch | 718 bytes | Tiaan |
screenshot_1.jpg | 42.17 KB | PierreM-1 |
Comments
Comment #1
PierreM-1 CreditAttribution: PierreM-1 commentedI may have been unprecise.
Actually, logging out removes the notifications but the problem is still there.
Comment #2
jlangdale CreditAttribution: jlangdale commentedI upgraded from 4.5, PHP4 to 4.6 and PHP6 yesterday. I am having this same issue with status messages. Messages only go away after logging out.
http://www.langdale.ca:81/drupal
Running:
Darwin 7.9.0 (Mac OS X 10.3.9)
Apache 2.0.54
PHP 5.0.4
Drupal 4.6.0
MySQL 4.0.20 (Standard Darwin 7.3.0 PPC)
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedSame problem. Notifications will not go away unless I log out.
Doing a dump of the user variable, I get the following:
public $session = 'messages|a:1:{s:6:"status";a:3:{i:0;s:28:"The changes have been saved.";i:1;s:42:"The configuration options have been saved.";i:2;s:42:"The configuration options have been saved.";}}';
It looks like this never gets set back to an array.
Fedora Core 3
PHP5
Apache2
Comment #4
Robin Monks CreditAttribution: Robin Monks commentedThis patch should clear the header after each print-out without using a blank array(), which I believe could cause this:
It might be good for someone who was having this problem to try this patch and see if it does fix the problem.
Robin
Comment #5
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedI don't see how this patch will cure the problem (which I cannot reproduce).
According to the php docs session_unregister() shouldn#t be used with session variables. Oh. and we want attached patches not inlined ones.
Comment #6
kumo CreditAttribution: kumo commentedI've just encountered the same problem. I'm using PHP5.0.4 on Mac OS X Tiger.
I added 'php_value register_long_arrays 1' to Drupal's .htaccess and this cured the problem.
Can someone else try this and see if this works for them?
Comment #7
kumo CreditAttribution: kumo commentedI should have mentioned that I've no idea why the above works and whether it's a Drupal or PHP bug.
Comment #8
Robin Monks CreditAttribution: Robin Monks commentedAt any rate, I can't reproduce this. Perhaps it's fixed by another patch?
Robin
Comment #9
TheRoss CreditAttribution: TheRoss commentedI can duplicate this with Drupal 4.6 and PHP5 (on textdrive.com)
using my .htaccess to force it to use php4 eliminates the problem.
I can provide you with admin access if you would like to test it, contact me at ross@karchner.com
Comment #10
TheRoss CreditAttribution: TheRoss commentedHere is a PHPinfo of the PHP 5 install that is having this problem:
http://karchner.com/test.php
And the PHP 4 install that isn't
both are using FastCGI, as opposed to mod_php or CGI
Comment #11
TheRoss CreditAttribution: TheRoss commentedthe session_unregister fix worked for me.
Comment #12
danielgm CreditAttribution: danielgm commentedSetting register_long_arrays worked for me. Thanks!
Comment #13
wdtj CreditAttribution: wdtj commentedSetting register_long_arrays worked for me too. Thanks!
Comment #14
tayknight CreditAttribution: tayknight commentedThe .htaccess didn't work for me (PHP 5 at Dreamhost). The session_unregister did work. Thanks for the info.
Comment #15
Tiaan CreditAttribution: Tiaan commentedThis problem does appear to be a PHP 5 bug (tested with current v.5.0.4), but I have not been able to create an isolated PHP script to log it at http://bugs.php.net and get their opinion. However, the attached Drupal (v.4.6.0 or 4.6.2, likely also for 4.6.1) patch file is a work-around for this issue, and it neither requires enabling the register_long_arrays flag (that messes with the deprecated long $HTTP_*_VARS type predefined variables) nor does it use the session_unregister function (which shouldn't be used with session variables). The modified "bootstrap.inc" file has been tested under both PHP 4.3.9 and 5.0.4, and it seems to work just fine.
Perhaps someone who better understands PHP's reference handling can shed more light on this peculiar work-around. For those that might want to investigate this further, note that the conditional version checking in the modified function is essential for making this code work on both the older and newer PHP versions. The code segment that gets executed under version 5.0+ does not work correctly on PHP 4, but by pure coincidence emulates the PHP 5 bug symptoms under PHP 4. :) Hope this helps.
Comment #16
tayknight CreditAttribution: tayknight commentedTiian. Your patch also worked for me at Dreamhost.
Comment #17
lordslumber CreditAttribution: lordslumber commentedI was running a fresh install of drupal 4.6.2 on dreamhost with php running as a CGI with PHP version 5 checked, and getting the same bug. Tiaan's patch fixed the problem. Thanks!
Comment #18
jsaints CreditAttribution: jsaints commentedThe patch is nice, but I think there is something more serious we need to address here. According to my tests, this is not a PHP bug, but a Drupal bug.
I have two drupal 4.6 sites on the same server.
a patched version of 4.6.1 does not have this problem
version 4.6.2 freshly installed is problematic
What changed between the versions that is casing this problem? Can anyone else confirm?
Comment #19
wdtj CreditAttribution: wdtj commentedI was having the same bug. I tried regsiter_long_arrays, and that worked for a time but it came back, then tried register_globals, which worked but scared the jeebers out of me.
Applied the patch bootstrap_14_patch and it worked, after I remembered to set the *&^%^% SELinux context right.
I'm running Drupal 4.6.3 with Fedora 4 (PHP 5.0.4 & postgresql 8.0.3).
Comment #20
Dries CreditAttribution: Dries commentedThat bootstrap patch is rather ugly.
Comment #21
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedSome discussion revealed that this is possibly a bug in the xtemplate engine or xtemplate based themes. Can the people who have this problem report back?
Comment #22
agentrickardI had the same problem on 4.6.3 using PHPTemplate on a fresh install.
Forgive my impudence, but I thought Dries had closed this thread once before?
Has the solution discussed here http://drupal.org/node/33880 been replaced by a better one?
Comment #23
magico CreditAttribution: magico commented