[Vtigercrm-developers] [patch] Login, then "browser back" causes "mixed" screen

Kristof Kovacs kristof.kovacs at onlineprojects.hu
Wed Sep 17 15:29:17 PDT 2008


Hello Zenk,

> Hello Kristof,
> oh yes i can reproduce it with all of my browsers. After logging there
> is indeed this mixed screen.

A reproducible bug is a hundred times better than a random one. :o)

> But i?m sorry that i can?t reproduce the diff you provided. I am  
> used to
> the way a diff is provided like this (this is the way drupal and  
> joomla
> diffs are provided)

Oh, I see where the misunderstanding comes from. We use "git" as  
source control (even to access an svn repository), while you use  
"svn", and git's diff puts a little more information in the patches  
(but leaves nothing out). Also, this diff contains only lines that  
were added, this is why you don't see the "changed" lines. Please let  
me explain those bits:

> So besides the filename in which the changes have to be made, here i
> have the functionname, the lines above and below the line that is
> changed AND the whole row that must be changed. In the way you provide
> your diff i can not reproduce the patch because:

I'll copy here my original patch too, just to help me:

-----------------
diff --git a/index.php b/index.php
index ae23b93..3781a08 100644
--- a/index.php
+++ b/index.php
@@ -192,6 +192,11 @@ if(isset($_SESSION["authenticated_user_id"]) &&  
(isset($_SESSION["app_unique_key
         $use_current_login = true;
}

+// Prevent loading Login again if there is an authenticated user in  
the session.
+if (isset($_SESSION['authenticated_user_id']) && $module == 'Users'  
&& $action == 'Login') {
+        header("Location: index.php?action=$default_action&module= 
$default_module");
+}
+
if($use_current_login)
{
-----------------

> 1.(isset($_SESSION["app_unique_key  <<< suddenly ends without any  
> closing, what?s the reason for this?

The reason is that this is the line that "patch" uses to locate the  
place of the diff. Besides the "line number based" identification ("@@  
-192,6 +192,11 @@"), my version of diff puts a contextual  
identification there, too. True, it truncates it. I never noticed this  
before, since I use "patch -p1 <filename" to apply patches, never  
apply them manually.

> 2. it says
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> WHAT has to be changed and WHERE do i put the 5 lines that have to  
> be added.

It's just a statistic that the "git diff" puts there. :) Feel free to  
ignore it. :)
Just as an example, this is how the statistics for a more complex  
commit look like:

include/RelatedListView.php         |    6 +-----
include/utils/ListViewUtils.php     |   15 ++++++++++-----
include/utils/utils.php             |    2 +-
modules/Calendar/calendarLayout.php |    3 +--
4 files changed, 13 insertions(+), 13 deletions(-)

Here one can see which files has changed, how much text were added,  
how much removed, how much "chunks" of code changed. When one browses  
through commits (happens more often with git than with svn, since svn  
is almost always linear, while git is not), it helps visually  
distinguish between small a bug commits, big code additions and  
rewrites, etc...

> Best Regards
> Torsten Zenk


Have a nice day!

Kristóf

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20080918/0aaea194/attachment-0003.html 


More information about the vtigercrm-developers mailing list