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

Disabled Top/Bottom external links should not be displayed #2830

Closed
YongBoLiu opened this issue Jul 18, 2019 · 2 comments
Closed

Disabled Top/Bottom external links should not be displayed #2830

YongBoLiu opened this issue Jul 18, 2019 · 2 comments
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@YongBoLiu
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.
The FRONTTOP/ FRONT external links always show up, even it be disabled.

To Reproduce
Steps to reproduce the behavior:

  1. Go to console->utilities->External Links. Add a link with 'Top of console page' style.
  2. Then disable it.
  3. Navigate to Clog page, then navigate back the console page.
  4. The external link still show up.

Expected behavior
A clear and concise description of what you expected to happen.
If FRONTTOP/ FRONT external links disabled, it don't need to be show.

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

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [firefox]
  • Version []

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.
cacti 1.2.4/1.2.5

diff -u -N rtm/cacti/index.php rtm/cacti/index.php
--- rtm/cacti/index.php	2019-06-08 13:01:40.000000000 +0800
+++ rtm/cacti/index.php	2019-07-18 16:38:13.000000981 +0800
@@ -30,7 +30,7 @@
 function render_external_links($style = 'FRONT') {
 	global $config;
 
-	$consoles = db_fetch_assoc_prepared('SELECT id, contentfile FROM external_links WHERE style = ?', array($style));
+	$consoles = db_fetch_assoc_prepared('SELECT id, contentfile FROM external_links WHERE enabled = "on" AND style = ?', array($style));
 	if (cacti_sizeof($consoles)) {
 		foreach($consoles as $page) {
 			if (is_realm_allowed($page['id']+10000)) {
@netniV
Copy link
Member

netniV commented Jul 18, 2019

Could there be times where an admin wants to keep the link but temporarily disable it? Should there be a separate option to hide on disabled?

@netniV netniV added the enhancement General tag for an enhancement label Jul 18, 2019
@YongBoLiu
Copy link
Contributor Author

Yes, sometimes admin wants to keep the link but temporarily disable it. So, we just need to show it when it is enabled. Or I can't see what does 'disable' action option mean.

cigamit added a commit that referenced this issue Jul 19, 2019
Disabled Top/Bottom external links should not be displayed
@cigamit cigamit added bug Undesired behaviour resolved A fixed issue and removed enhancement General tag for an enhancement labels Jul 19, 2019
@cigamit cigamit added this to the v1.2.6 milestone Jul 19, 2019
@cigamit cigamit closed this as completed Jul 23, 2019
@github-actions github-actions bot locked 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
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants