Skip to content

When viewing a graph, option to edit template may lead to incorrect URL #5573

Closed

Description

Incorrect URL for editing graph_templates. Perhaps typo.


<br>
<a class="iconLink" role="link" title="Edit Graph Template" href="//graph_templates.php?action=template_edit&amp;id=401"><img src="/images/template_edit.png"></a><br><a class="iconLink" href="/plugins/thold/thold.php?action=add&amp;usetemplate=1&amp;local_graph_id=4223" title="Создать порог"><i class="tholdEdit fas fa-wrench"></i></a><br><a class="iconLink" onclick="addQuickTree(4223, 0)" title="Add this graph to QuickTree" href="#"><i class="deviceUp fas fa-plus-circle"></i></a><br>					</td>				</tr>

Cacti version - 1.2.25

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'Graph tree'

  2. Select any graphic.

  3. Click link "Edit Graph Template"

Screenshots

изображение

Additional context

-- href="//graph_templates.php?action=template_edit&amp;id=401 ...
++ href="/graph_templates.php?action=template_edit&amp;id=401 ...

Activity

  1. TheWitness commented on Nov 16, 2023

    @TheWitness
    Member

    What is your url_path in config.php? I think it may be wrong.

  2. TheWitness commented on Nov 16, 2023

    @TheWitness
    Member

    It's normally $url_path = '/cacti/'. My guess is that yours is simply '/'.

  3. Vladyslav78956785786576 commented on Nov 16, 2023

    @Vladyslav78956785786576
    ContributorAuthor

    It's normally $url_path = '/cacti'. My guess is that yours is simply '/'.

    yes.
    $url_path = '/';

  4. TheWitness commented on Nov 16, 2023

    @TheWitness
    Member

    Change it to an empty string. What happens then?

  5. Vladyslav78956785786576 commented on Nov 16, 2023

    @Vladyslav78956785786576
    ContributorAuthor

    Change it to an empty string. What happens then?

    I did an additional Ctrl + F5 and everything worked!

  6. TheWitness commented on Nov 16, 2023

    @TheWitness
    Member

    Which page, and did you change the url_path? Does it work with the standard $url_path='/cacti/';?

  7. Vladyslav78956785786576 commented on Nov 16, 2023

    @Vladyslav78956785786576
    ContributorAuthor

    Which page, and did you change the url_path? Does it work with the standard $url_path='/cacti/';?

    My web server is configured to use the full URI - http://10.10.10.10/

  8. TheWitness commented on Nov 16, 2023

    @TheWitness
    Member

    So, $config['url_path'] should be the empty string '';

  9. cigamit commented on Nov 16, 2023

    @cigamit
    Member

    Actually, this a a bug, and url_path should not be an empty string.
    There is an extra slash on
    https://github.com/Cacti/cacti/blob/develop/graph.php#L171
    if url_path is set to /cacti/
    then the url ends up as /cacti//graph_templates.php?action=template_edit&id=1

    Also looks like line
    https://github.com/Cacti/cacti/blob/develop/graph.php#L444
    has the issue also

  10. added a commit that references this issue on Nov 16, 2023
  11. removed
    not a bugNot a bug as determined by dev
    unverifiedSome days we don't have a clue
    supportSupport related issue
    on Nov 16, 2023
  12. added a commit that references this issue on Nov 16, 2023
  13. added this to the 1.2.26 milestone on Nov 16, 2023
  14. TheWitness commented on Nov 16, 2023

    @TheWitness
    Member

    Closing. Thanks @cigamit !

  15. netniV commented on Nov 17, 2023

    @netniV
    Member

    Was the CHANGELOG updated for this issue?

  16. TheWitness commented on Nov 18, 2023

    @TheWitness
    Member

    It is there now.

  17. changed the title [-]Incorrect URL for editing graph template. Perhaps typo.[/-] [+]When viewing a graph, option to edit template may lead to incorrect URL[/+] on Dec 16, 2023
  18. locked and limited conversation to collaborators on Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourresolvedA fixed issuetype:bugNamespaced Cacti workflow label

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions