Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph links do not contain URL path causing links to fail #2693

Closed
YongBoLiu opened this issue May 20, 2019 · 0 comments
Closed

Graph links do not contain URL path causing links to fail #2693

YongBoLiu opened this issue May 20, 2019 · 0 comments

Comments

@YongBoLiu
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.
There are two relative href calls in graph.php as below, this makes graph.php does not work when called from plugins.
$.get('graph.php?action=xxxxxxxxxx');

The error is 404, NOT Found. The apache log is below.
[Mon May 20 15:37:43.709666 2019] [:error] [pid 16192] [client 9.119.131.226:39128] script '/var/www/html/cacti/plugins/gridblstat/graph.php' not found or unable to stat.

To Reproduce
Steps to reproduce the behavior:

  1. Call html_graph_area() in a plugin, such as gridbstat
  2. Click on the graph icon beside the graph, this will navigate to graph.php from the plugin.
  3. It shows, 'Error: 404 NOT FOUND', the request URL was not found.

Expected behavior
A clear and concise description of what you expected to happen.

Change the relative href to absolute href as we did in other lines in the file graph.php.
This will make the graph.php more stronger and it will works well when call from plugins.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

diff -u -N rtm/cacti/graph.php rtm/cacti/graph.php
--- rtm/cacti/graph.php	2019-02-28 10:52:54.000000322 +0800
+++ rtm/cacti/graph.php	2019-05-20 15:42:48.000000377 +0800
@@ -224,7 +224,7 @@
 			rra_id=$(this).attr('rra_id');
 			graph_start=$(this).attr('graph_start');
 			graph_end=$(this).attr('graph_end');
-			$.get('graph.php?action=zoom&header=false&local_graph_id='+graph_id+'&rra_id='+rra_id+'&graph_start='+graph_start+'&graph_end='+graph_end)
+			$.get(urlPath+'graph.php?action=zoom&header=false&local_graph_id='+graph_id+'&rra_id='+rra_id+'&graph_start='+graph_start+'&graph_end='+graph_end)
 				.done(function(data) {
 					$('#main').html(data);
 					$('#breadcrumbs').append('<li><a id="nav_util" href="#"><?php print __('Utility View');?></a></li>');
@@ -389,7 +389,7 @@
 	}
 
 	function graphProperties() {
-		$.get('graph.php?action=properties&header=false&local_graph_id='+graph_id+'&rra_id=<?php print get_request_var('rra_id');?>&view_type=<?php print get_request_var('view_type');?>&graph_start='+$('#graph_start').val()+'&graph_end='+$('#graph_end').val())
+		$.get(urlPath+'graph.php?action=properties&header=false&local_graph_id='+graph_id+'&rra_id=<?php print get_request_var('rra_id');?>&view_type=<?php print get_request_var('view_type');?>&graph_start='+$('#graph_start').val()+'&graph_end='+$('#graph_end').val())
 			.done(function(data) {
 				$('#data').html(data);
 			})
@netniV netniV changed the title relative href in graph.php makes graph.php does not work when called from plugins Graph links do not contain proper URL path causing links to fail May 20, 2019
@netniV netniV closed this as completed in 687884d May 20, 2019
@netniV netniV changed the title Graph links do not contain proper URL path causing links to fail Graph links do not contain URL path causing links to fail Jun 2, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant