Skip to content

Commit

Permalink
Fixing #5776 - Undefined key 'description'
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWitness committed Jun 29, 2024
1 parent 8a58c8f commit f364ec3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Cacti CHANGELOG
-issue#5573: Incorrect URL for editing graph template
-issue#5639: Add tooltip info about IPv6 address
-issue#5680: Fix Spikekill not following correct time in schedule
-issue#5776: Undefined array key "description" in file settings.php
-feature#412: Import Export for Graph and Tree rules
-feature#1214: Move Tree Create/Remove/Modify Functions to lib/api_tree.php
-feature#1442: Add validation to GUI inputs
Expand Down
35 changes: 30 additions & 5 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1218,12 +1218,37 @@ function settings_search() {
foreach($page as $field_name => $field_array) {
if ($field_array['method'] == 'spacer') {
$last_spacer = $field_name;
} elseif (stristr($field_array['friendly_name'], $filter) !== false || stristr($field_array['description'], $filter) !== false) {
$tabs[] = $tab;
$response['rows'][] = $field_name;
} elseif ($field_array['method'] != 'hidden') {
$friendly_key = false;
$description_key = false;

if ($last_spacer != '') {
$spacers[] = $last_spacer;
if (isset($field_array['friendly_name'])) {
if (stristr($field_array['friendly_name'], $filter) !== false) {
$friendly_key = true;
} else {
$friendly_key = false;
}
} else {
$friendly_key = false;
}

if (isset($field_array['description'])) {
if (stristr($field_array['description'], $filter) !== false) {
$description_key = true;
} else {
$description_key = false;
}
} else {
$description_key = false;
}

if ($friendly_key !== false || $description_key !== false) {
$tabs[] = $tab;
$response['rows'][] = $field_name;

if ($last_spacer != '') {
$spacers[] = $last_spacer;
}
}
}
}
Expand Down

0 comments on commit f364ec3

Please sign in to comment.