Update ChangeLog and Autocomplete rows#190
Conversation
There was a problem hiding this comment.
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_rowsbefore applying it to the datasource autocomplete SQLLIMIT. - Update
CHANGELOG.mdwith 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 |
There was a problem hiding this comment.
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.
| * 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 |
| $rows = read_config_option('autocomplete_rows'); | ||
|
|
||
| if (empty($rows) || $rows > 100 || $rows < 0) { | ||
| $rows = 100; | ||
| } |
There was a problem hiding this comment.
$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.
No description provided.