Describe the bug
In certain cases, where for example, you database has been corrupted due to a bug, it is possible to create a graph with a graph id of 0. When you go to delete that corrupt graph, you also delete all your Graph Templates.
To Reproduce
Create a graph manually with a id in the graph_local table of 0, then delete it.
Expected behavior
Cacti should remove the local graph id, but not any templates.
Describe the bug
In certain cases, where for example, you database has been corrupted due to a bug, it is possible to create a graph with a graph id of 0. When you go to delete that corrupt graph, you also delete all your Graph Templates.
To Reproduce
Create a graph manually with a id in the graph_local table of 0, then delete it.
Expected behavior
Cacti should remove the local graph id, but not any templates.