Skip to content

Update ChangeLog and Autocomplete rows#190

Merged
TheWitness merged 1 commit intodevelopfrom
changelog_editor
Feb 9, 2026
Merged

Update ChangeLog and Autocomplete rows#190
TheWitness merged 1 commit intodevelopfrom
changelog_editor

Conversation

@TheWitness
Copy link
Member

No description provided.

@TheWitness TheWitness merged commit d96c5f0 into develop Feb 9, 2026
8 checks passed
@TheWitness TheWitness deleted the changelog_editor branch February 9, 2026 20:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the plugin’s changelog and adjusts the datasource autocomplete query to cap/default the configured autocomplete row limit.

Changes:

  • Add validation/defaulting logic for autocomplete_rows before applying it to the datasource autocomplete SQL LIMIT.
  • Update CHANGELOG.md with additional issue/feature entries for the 1.4 section.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lib/editor.inc.php Introduces $rows config handling and uses it for datasource autocomplete query limiting.
CHANGELOG.md Adds new entries to document recently addressed issues/features.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

* feature#178: Support Setting KEYSTYLE DEFAULT via the UI
* feature: Add 3 missing plugins from upstream weathermap
* feature: Add a Debug option from the main Cacti Weathermap settings page
* feature: Default the autocomplete rows to 100 if the user has set too high
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog entry grammar is unclear: “if the user has set too high” is missing an object. Consider rewording to “...if the user has set it too high” (or similar) to keep entries readable and consistent.

Suggested change
* feature: Default the autocomplete rows to 100 if the user has set too high
* feature: Default the autocomplete rows to 100 if the user has set it too high

Copilot uses AI. Check for mistakes.
Comment on lines +110 to +114
$rows = read_config_option('autocomplete_rows');

if (empty($rows) || $rows > 100 || $rows < 0) {
$rows = 100;
}
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$rows comes from read_config_option() and is used directly in the SQL LIMIT. The current checks don’t ensure it’s an integer (e.g., a non-numeric string would pass the comparisons and produce an invalid LIMIT, and direct interpolation can become a SQL-injection footgun if this option is ever corrupted). Consider validating/casting to int (e.g., FILTER_VALIDATE_INT or (int)) and clamping to a safe range (1..100). Also, display_graphs() in this same file still uses read_config_option('autocomplete_rows') directly for LIMIT, so the cap/default behavior is inconsistent between the two autocompletes.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants