graphs_view.php broken in dual pane tree view

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

I'm working on it.. ;)

Will be reviewing this issue this weekend.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
jmjones
Posts: 18
Joined: Wed Feb 09, 2005 12:19 pm

A better solution

Post by jmjones »

I have been battling this issue for quite some time. I have created a kindof make shift patch, and now I have created a patch that allows "no loss" in functionality. Here it is. In top_graph_header.php you will see the following chunk of code

/* setup tree selection defaults if the user has not been here before */
if ((read_graph_config_option("default_tree_view_mode") == "2") && ($_REQUEST["action"] == "tree") && (!isset($_SESSION["sess_has_viewed_graphs"]))) {
$_SESSION["sess_has_viewed_graphs"] = true;

$first_branch = find_first_folder_url();

if (!empty($first_branch)) {
header("Location: $first_branch");
}
}


This is where the infinite redirection loop is on some server setups. Here is my patch. It uses a javascript redirect instead of a server side redirect. This slows the server down just long enough to not get "confused".

Comment out the above code and add this code right underneath it.

/* setup tree selection defaults if the user has not been here before */
if ((read_graph_config_option("default_tree_view_mode") == "2") && ($_REQUEST["action"] == "tree") && (!isset($_SESSION["sess_has_viewed_graphs"]))) {
$_SESSION["sess_has_viewed_graphs"] = true;

$first_branch = find_first_folder_url();
if (!empty($first_branch)) {
if(!empty($_REQUEST["ret"])){
$mystring = "&ret=yes";
$first_branch = $first_branch . $mystring;
header("Location: $first_branch");
}
//print "The first branch was not empty" .$first_branch;
print "<script language=\"javascript\">window.location.href=\"$first_branch\"</script>" ;
}
}

It should look like this when you are done.

/* setup tree selection defaults if the user has not been here before */
if ((read_graph_config_option("default_tree_view_mode") == "2") && ($_REQUEST["action"] == "tree") && (!isset($_SESSION["sess_has_viewed_graphs"]))) {
$_SESSION["sess_has_viewed_graphs"] = true;

$first_branch = find_first_folder_url();
if (!empty($first_branch)) {
if(!empty($_REQUEST["ret"])){
$mystring = "&ret=yes";
$first_branch = $first_branch . $mystring;
header("Location: $first_branch");
}
//print "The first branch was not empty" .$first_branch;
print "<script language=\"javascript\">window.location.href=\"$first_branch\"</script>" ;
}
}
/* setup tree selection defaults if the user has not been here before */
/*if ((read_graph_config_option("default_tree_view_mode") == "2") && ($_REQUEST["action"] == "tree") && (!isset($_SESSION["sess_has_viewed_graphs"]))) {
$_SESSION["sess_has_viewed_graphs"] = true;

$first_branch = find_first_folder_url();

if (!empty($first_branch)) {
header("Location: $first_branch");
}
}
*/

I have attached my copy of the file for download as well
Attachments
top_graph_header.zip
rename the original to top_graph_header1.php and extract this file to your includes directory
(3.02 KiB) Downloaded 124 times
dvincent
Posts: 5
Joined: Thu Apr 27, 2006 7:46 am

Problem with viewing graph tabs in tree view and 302 log err

Post by dvincent »

rony wrote:I'm working on it.. ;)

Will be reviewing this issue this weekend.

do you know if this problem has been addressed? I implemented the fix below and it seems to work, but with a small delay. where you able to determine the cause?

Dave
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests