View Issue Details

IDProjectCategoryView StatusLast Update
0009323mantisbtbugtrackerpublic2013-11-02 04:45
Reporterpolzin Assigned Tojreese  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.1.2 
Target Version1.1.3Fixed in Version1.1.3 
Summary0009323: Browser caching broken since 1.1.2
Description

Since I upgraded from 1.1.1 to 1.1.2 browser caching does not work any longer.
You can try out at this bugtracker and the demo bugtracker http://www.futureware.biz/mantisdemo/bug_report_advanced_page.php, which is currently 1.1.1.

  1. Go to Report Issue (the demo has disabled caching otherwise)
  2. Scroll down a little, enter some summary
  3. Click on "Docs" in the top.
  4. Use browser "back"

In 1.1.1 the page is immediately displayed and the scroll-position and the entered text is preserved.

In 1.2.0a (and in 1.1.2 at my site) the page is reloaded, the scroll-position and entered text is gone.

I believe, the reason is that in 1.1.2 core.php requires session_api.php. And session_init() stops caching. To prevent that, one can use session_cache_limiter, see patch and links.

http://www.php.net/manual/en/function.session-start.php#70033
http://www.php.net/manual/en/function.session-cache-limiter.php#82174

BTW: I noticed that sessions_api.php has no "?>" at the end of the file. I am not a php programmer and I am unsure if this is right, as some *_api.php have it, other haven't.

Tagspatch
Attached Files
session.patch (515 bytes)   
Index: core/session_api.php
===================================================================
RCS file: /cvs/TPS/mantis/core/session_api.php,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 session_api.php
--- core/session_api.php	2 Jun 2008 17:23:29 -0000	1.1.1.1
+++ core/session_api.php	1 Jul 2008 10:02:45 -0000
@@ -49,6 +49,7 @@
  */
 class MantisPHPSession extends MantisSession {
 	function __construct() {
+		session_cache_limiter('private_no_expire');
 		session_start();
 		$this->id = session_id();
 	}
session.patch (515 bytes)   
bug_report_page.patch (1,828 bytes)   
Index: bug_report_page.php
===================================================================
--- bug_report_page.php
+++ bug_report_page.php
@@ -106,12 +106,43 @@
 	html_page_top1( lang_get( 'report_bug_link' ) );
 	html_page_top2();
 
-	print_recently_visited();
-?>
-
+	print_recently_visited();
+	
+	// array with language dependent error messages 
+	// used for example in javascript error messages
+	$MANTIS_ERROR = lang_get('MANTIS_ERROR');
+?>
+<?php if ( ON == config_get( 'use_javascript' ) ) { ?>
+<script type="text/javascript" language="JavaScript">
+<!--
+  function checkReportBugForm(theForm)
+  {
+    if (theForm.category.value=='')
+    {
+      theForm.category.focus();
+      alert('<?php echo sprintf(addslashes($MANTIS_ERROR[ERROR_EMPTY_FIELD]),lang_get( 'category' ))?>');
+      return false;
+    }
+    if (theForm.summary.value=='')
+    {
+      theForm.summary.focus();
+      alert('<?php echo sprintf(addslashes($MANTIS_ERROR[ERROR_EMPTY_FIELD]),lang_get( 'summary' ))?>');
+      return false;
+    }
+    if (theForm.description.value=='')
+    {
+      theForm.description.focus();
+      alert('<?php echo sprintf(addslashes($MANTIS_ERROR[ERROR_EMPTY_FIELD]),lang_get( 'description' ))?>');
+      return false;
+    }
+    return true;
+  } 
+// -->
+</script>
+<?php } ?>
 <br />
 <div align="center">
-<form name="report_bug_form" method="post" <?php if ( file_allow_bug_upload() ) { echo 'enctype="multipart/form-data"'; } ?> action="bug_report.php">
+<form name="report_bug_form" method="post" <?php if ( file_allow_bug_upload() ) { echo 'enctype="multipart/form-data"'; } ?> action="bug_report.php" <?php if ( ON == config_get( 'use_javascript' ) ) { ?>onsubmit="return checkReportBugForm(this);"<?php } ?>>
 <table class="width75" cellspacing="1">
 
 
bug_report_page.patch (1,828 bytes)   

Relationships

has duplicate 0009366 closedryandesign Page content in 'Report Issue' is forgotten when user clicks [Back] button in browser 
has duplicate 0006736 closedjreese Mantis - application error #11 
has duplicate 0009569 closedjreese Pages will not refresh in IE6 
has duplicate 0009631 closedryandesign Loss of data on back.. 
has duplicate 0009554 closedjreese Within a proxy enviroment users get the screens of other users 
has duplicate 0009655 closedryandesign Forms > Informations not saved 
has duplicate 0009689 closedgiallu Missing needed fields clear forces error and when back on mask, every fields are cleared 
has duplicate 0009729 closedjreese Report Issue: Back results in empty form when a required field was missing 
has duplicate 0008161 closedjreese While reporting issue, if you forget a field, all fields are emptied 
related to 0009576 closedjreese Problem in downloading file 
related to 0009813 acknowledged Redesign forms in Mantis to not need the Back Button for mistakes. 
related to 0012492 closedatrol Complete input get lost when timeout or not filling all required fields (when using ssl/https) 
related to 0016570 closedgrangeway Page content in 'Report Issue' is forgotten when user clicks [Back] button in browser 

Activities

polzin

polzin

2008-07-01 06:49

reporter   ~0018256

Sorry, this patch introduces other problems, e.g., project switching does not work any longer. :-(

polzin

polzin

2008-07-01 06:55

reporter   ~0018257

I tested with firefox 2.0.14 and 3.0.

polzin

polzin

2008-07-01 07:22

reporter   ~0018258

Perhaps the problem is not only a "minor" problem, because the handling of errors (e.g. Required field "XXX" is missing. Please use the "Back" button in your web browser to return to the previous page.) depends on it.

ryandesign

ryandesign

2008-07-01 17:06

reporter   ~0018264

Regarding "BTW: I noticed that sessions_api.php has no "?>" at the end of the file. I am not a php programmer and I am unsure if this is right, as some *_api.php have it, other haven't.": PHP adds "?>" at the end of the file if it's not there. Some programmers even advocate omitting "?>" at the end of files, since it guarantees that you can't have stray whitespace after the "?>" which could otherwise cause problems.

polzin

polzin

2008-07-08 09:42

reporter   ~0018342

Any update on this?

jreese

jreese

2008-07-08 10:36

reporter   ~0018343

It's being investigated, and will make it's way in as soon as the problem/fix is verified and tested.

baamster

baamster

2008-07-24 03:03

reporter   ~0018655

Is there any news yet about this issue? Seems a very significant one (since usability has degraded a lot.... :().

Marnix

Marnix

2008-07-28 17:57

reporter   ~0018882

50 US if this issue is fixed before the end of August.

jreese

jreese

2008-07-30 08:41

reporter   ~0018919

Issue resolved in SVN: 1.1.x in r5457 and r5460; trunk in r5458, r5459, and r5461.

This fixes the sessions issue, resolves problems with Firefox 3 caching disabled button states, and resolves the issues when trying to switch projects from a cached page.

polzin

polzin

2008-07-30 09:24

reporter   ~0018924

Thanks, jreese. Is there a ETA for 1.1.3 to be released?

GESHH

GESHH

2008-07-31 04:58

reporter   ~0018950

Last edited: 2008-07-31 05:17

Did you test it with IE6?
I've got some problems with it. Firefox 3 is fine.
I inserted the diff from r5457 and r5460 into 1.1.2.
It enabled caching, but changing the project is impossible in IE6 on page: bug_report_advanced_page.php.
I changed the
session_cache_limiter( 'private_no_expire' );
to
session_cache_limiter( '' );
Now it works fine.
edit: after restart of IE6 caching is lost again, so no luck :-(

jreese

jreese

2008-07-31 08:57

reporter   ~0018956

polzin: no ETA that I know of, but I'd like to see it hit soon...

GESHH: I only have access to Linux machines, so I've tested on Opera and Firefox 3. I'll get IEs4Linux set back up on my workstation and see what I can figure out...

jreese

jreese

2008-07-31 13:20

reporter   ~0018961

GESHH: I've set up IE6 through Wine on Linux, but I cannot reproduce your problem. I can change the project from the report page just fine, and caching works. Can you try with the latest rode from SVN, clearing your history/cache in IE, and see if you still have troubles?

polzin

polzin

2008-08-07 13:45

reporter   ~0019089

I tested with the two patches and the current PATCHES_1_1 SVN (rv5503), with win firefox 3.0 and with linux firefox 1.5.
In all combinations it did not work:

View Issues -> Use drop down menu to change the project -> Releasing the drop down menu triggers the reload -> Project has not changed.

The very first time at a page, it appeared the I could change the project once. But any further change did not work.

ghohm

ghohm

2008-08-14 09:58

reporter   ~0019155

Last edited: 2008-08-14 09:59

Someone working on it?!

djcarr

djcarr

2008-08-14 19:32

reporter   ~0019157

Just another confirmation of seeing the original "loss of all data when going back to Report a Problem screen" issue on 1.1.2 (after upgrading from 1.1.1). FF3 on WinXPSP2

ghohm

ghohm

2008-08-15 05:45

reporter   ~0019164

DJCARR I fixed this data caching problem, with this 2 fixes:

http://mantisbt.svn.sourceforge.net/viewvc/mantisbt/trunk/mantisbt/core/session_api.php?r1=5458&r2=5457&pathrev=5458

http://mantisbt.svn.sourceforge.net/viewvc/mantisbt/trunk/mantisbt/core.php?r1=5461&r2=5460&pathrev=5461

I didn't apply this one because our users use only ie6 (I know ... it's bad! ;-):

http://mantisbt.svn.sourceforge.net/viewvc/mantisbt?view=rev&revision=5459

I hope this help!

hans

hans

2008-08-25 08:56

reporter   ~0019218

Another confirmation from me. I also have totall loss of data when going back to Report a Problem screen" issue on 1.1.2

@ghohm: I was unable to fix this bug with the patches your mentioned.

I wrote a different patch:
http://www.mantisbt.org/bugs/file_download.php?file_id=1962&type=bug
And added this file to this bug rapport.

This patch adds Javascript notifications when required fields are missing. This way, you do not have to trust the browser back history.

ghohm

ghohm

2008-08-26 06:08

reporter   ~0019231

Freaky!

Just in case ...

My Mantis configuration:

  • Apache 2.0.63

  • PHP 4.4.7

  • MySQL 5.0.51a

Our users use Internet Explorer 6.0.2900.2180 and I use Firefox 3.0.1 in testing.

polzin

polzin

2008-09-01 12:06

reporter   ~0019278

@hans: The javascript patch is a good idea! Why enter a new page to ask the user to go back? :-)

Unfortunately, it does not work for

  • Other forms (e.g. if "resolve issue" requires a "fixed in version")
  • Custom validation inserted by custom_function_override_issue_update_validate

This would need an AJAX-like query, if the form was okay. Cool, but I guess to difficult.

MPA

MPA

2008-09-07 16:30

reporter   ~0019328

Can anyone tell me which program I have to use to install or use the patch file?
Thanks in advance.

hans

hans

2008-09-08 04:02

reporter   ~0019330

@polzin: True, it doesn't work for other forms and custom validations. It even doesn't work for the advanced issue rapport page, and for custom fields. I have made another patch for the advanced issue rapport page. It suits for my situation. Everyone can use my submitted patch to make it work for their situation.

Perhaps I could make another patch wich will work for simple and advanced rapport page. To support custom fields shoudln't be too big a problem. I can check in $t_related_custom_field_ids for $t_def['require_report'], and place a valid check according to the fieldtype.

I have to look into other forms and custom calidations to know if ajax is required or not. Perhaps when I have spare time at home ;-)

polzin

polzin

2008-09-24 09:16

reporter   ~0019437

Last edited: 2008-09-24 09:18

@jreese: Please raise priority of this issue, as it is still not solved.

The suggested patches and the 1_1_0 BRANCH -r 5584 in SVN have all the same bug: Selecting a different project does not work. (See my note 0009323:0019089).

I would even be happy with a workaround that removes the session handling completely.

jreese

jreese

2008-09-24 10:00

reporter   ~0019438

This has been completely fixed in 1.1.x and 1.2.x, with appropriate caching now implemented for all major browsers. Appropriate SVN commits: r5584 and r5587 for 1.1.x, and r5585 and r5586 for trunk 1.2.x. This is tested against IE6, IE7, IE8, Firefox 3.0, and Opera 9.5.

Please check out the latest from BRANCH_1_1_0 or trunk to get the fixes.

@polzin, removal of sessions is not an option, as they are required to secure against Cross-Site Request Forgery attacks.

polzin

polzin

2008-09-24 12:08

reporter   ~0019444

I checked with 1.1 -r 5587 and selecting a project still does not work. (firefox 3.0.1 Windows) (It works with IE6).

jreese

jreese

2008-09-24 13:53

reporter   ~0019446

I don't see this issue when using FF 3.0.1 on Linux. I can go to the Report Issue page, and try changing projects, and it works perfectly fine. Have you tried clearing your history and cache, and then trying again?

ghohm

ghohm

2008-09-25 09:16

reporter   ~0019455

In 1.1.x, there is only core.php to change?

http://mantisbt.svn.sourceforge.net/viewvc/mantisbt/branches/BRANCH_1_1_0/mantisbt/core.php?r1=5587&r2=5586&pathrev=5587

jreese

jreese

2008-09-25 09:25

reporter   ~0019456

@ghohm, assuming you've already applied the previous patches mentioned earlier in the bug report, yes, you should only need to apply the latest fixes to core.php.

monotek

monotek

2008-09-25 12:43

reporter   ~0019460

So you only need session_api.php & core.php from cvs?

jreese

jreese

2008-09-25 12:52

reporter   ~0019461

@monotek, from SVN BRANCH_1_1_0, yes. CVS is long out of date.

monotek

monotek

2008-09-25 13:02

reporter   ~0019462

thats what i meant ;-)

thanks.

jreese

jreese

2008-10-02 11:09

reporter   ~0019487

Re-closing.

polzin

polzin

2008-10-14 10:12

reporter   ~0019551

I am very sorry: The note:19089 problem was due to a local config_inc g_bypass_headers=ON.

Thus, everything is fixed with -r 5584.

(With -r 5666 I get a "Invalid form security token. Did you submit the form twice by accident?" but this is probably a different issue that will be solved until 1.1.3 will be released.)

Related Changesets

MantisBT: master-1.1.x fab2a761

2008-07-30 07:59

jreese


Details Diff
Fix 0009323: PHP sessions prevented browser caching.

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/branches/BRANCH_1_1_0@5457 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0009323
mod - core/session_api.php Diff File

MantisBT: master 70cac855

2008-07-30 08:00

jreese


Details Diff
Fix 0009323: PHP sessions prevented browser caching.

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@5458 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0009323
mod - core/session_api.php Diff File

MantisBT: master-1.1.x 50b84696

2008-09-23 19:14

jreese


Details Diff
Fix bug 0009323: form contents not cached in Internet Explorer

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/branches/BRANCH_1_1_0@5584 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0009323
mod - core.php Diff File

MantisBT: master 1b9050b2

2008-09-23 19:17

jreese


Details Diff
Fix bug 0009323: form contents not cached in Internet Explorer

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@5585 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0009323
mod - core.php Diff File

MantisBT: master c6821f71

2008-11-13 13:39

jreese


Details Diff
Fix 0009754 by reverting part of issue 0009323: IE6/7 cache too much cousing 2800 errors. Affected Issues
0009323, 0009754
mod - core.php Diff File

MantisBT: master-1.1.x 4ee424e1

2008-11-13 13:39

jreese


Details Diff
Fix 0009754 by reverting part of issue 0009323: IE6/7 cache too much cousing 2800 errors. Affected Issues
0009323, 0009754
mod - core.php Diff File

MantisBT: master 14d3d357

2008-11-24 09:11

jreese


Details Diff
Revert <a class="text" href="/?p=mantisbt.git;a=object;h=c6821f71">c6821f71</a>, fix 0009754, 0009869, 0009323 by adding Last-Modified headers to match Expires.

Commit has been tested on:
FF 2.0.14
FF 3.0.4
IE 8.0.6001.18241
IE 6.0.2900.5122
GC 0.4.154.23
Opera 9.51.10081
Affected Issues
0009323, 0009754, 0009869
mod - core.php Diff File

MantisBT: master-1.1.x 161a677e

2008-11-24 09:11

jreese


Details Diff
Revert <a class="text" href="/?p=mantisbt.git;a=object;h=4ee424e1">4ee424e1</a>, fix 0009754, 0009869, 0009323 by adding Last-Modified headers to match Expires.

Commit has been tested on:
FF 2.0.14
FF 3.0.4
IE 8.0.6001.18241
IE 6.0.2900.5122
GC 0.4.154.23
Opera 9.51.10081
Affected Issues
0009323, 0009754, 0009869, 0009892
mod - core.php Diff File