Skip selectmenu init on criticality select if Cacti core already applied select2 - #247
Open
TheWitness wants to merge 3 commits into
Open
TheWitness wants to merge 3 commits into
TheWitness wants to merge 3 commits into
Conversation
…lect2 already did Cacti core is converting its global select-enhancement catch-all from jQuery UI selectmenu to select2. If core's catch-all already turned the dynamically-inserted #criticality select into a select2, skip re-applying selectmenu to it here too, so it doesn't render twice.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The Select2 branch omits the change handler that calls applyFilter(), preventing filtered host lists from reloading.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
This PR prevents layering jQuery UI selectmenu over Cacti core’s existing Select2 enhancement.
Changes:
- Detects prior Select2 initialization.
- Skips
selectmenusetup when Select2 is present.
| File | Summary |
|---|---|
setup.php |
Guards criticality select widget initialization. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
xmacan
approved these changes
Sep 22, 2026
xmacan
previously approved these changes
Sep 22, 2026
Copilot review caught this: the select2-hidden-accessible branch skipped selectmenu's change:applyFilter() callback entirely, so choosing a criticality no longer reloaded the filtered device list once core had already converted the select to select2. Bind change->applyFilter() directly in that branch instead. Also regenerate locales/po/cacti.pot (and the merged .po/.mo files) via locales/build_gettext.sh - setup.php's line numbers shifted.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Resolve the compatibility metadata concerns and revert unnecessary generated locale churn.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (10)
不要将最低兼容版本提升至 Cacti 1.2.32 · New 还原生成的 PO 文件变更 · New 还原生成的 PO 文件变更 · New 还原生成的 PO 文件变更 · New 还原生成的 PO 文件变更 · New 还原生成的 PO 文件变更 · New 还原生成的 PO 文件变更 · New 还原生成的 PO 文件变更 · New 还原生成的 PO 文件变更 · New 还原生成的 PO 文件变更 · New
Resolved since last review (1)
| email = | ||
| homepage = http://www.cacti.net | ||
| compat = 1.2.15 | ||
| compat = 1.2.32 |
| "Project-Id-Version: \n" | ||
| "Report-Msgid-Bugs-To: developers@cacti.net\n" | ||
| "POT-Creation-Date: 2026-09-21 13:14-0400\n" | ||
| "POT-Creation-Date: 2026-09-22 10:12-0400\n" |
| "Project-Id-Version: Cacti\n" | ||
| "Report-Msgid-Bugs-To: developers@cacti.net\n" | ||
| "POT-Creation-Date: 2026-09-21 13:14-0400\n" | ||
| "POT-Creation-Date: 2026-09-22 10:12-0400\n" |
| "Project-Id-Version: \n" | ||
| "Report-Msgid-Bugs-To: developers@cacti.net\n" | ||
| "POT-Creation-Date: 2026-09-21 13:14-0400\n" | ||
| "POT-Creation-Date: 2026-09-22 10:12-0400\n" |
| "Project-Id-Version: \n" | ||
| "Report-Msgid-Bugs-To: developers@cacti.net\n" | ||
| "POT-Creation-Date: 2026-09-21 13:14-0400\n" | ||
| "POT-Creation-Date: 2026-09-22 10:12-0400\n" |
| "Project-Id-Version: \n" | ||
| "Report-Msgid-Bugs-To: developers@cacti.net\n" | ||
| "POT-Creation-Date: 2026-09-21 13:14-0400\n" | ||
| "POT-Creation-Date: 2026-09-22 10:12-0400\n" |
| "Project-Id-Version: \n" | ||
| "Report-Msgid-Bugs-To: developers@cacti.net\n" | ||
| "POT-Creation-Date: 2026-09-21 13:14-0400\n" | ||
| "POT-Creation-Date: 2026-09-22 10:12-0400\n" |
| "Project-Id-Version: \n" | ||
| "Report-Msgid-Bugs-To: developers@cacti.net\n" | ||
| "POT-Creation-Date: 2026-09-21 13:14-0400\n" | ||
| "POT-Creation-Date: 2026-09-22 10:12-0400\n" |
| "Project-Id-Version: monitor on cacti 1.1.34\n" | ||
| "Report-Msgid-Bugs-To: developers@cacti.net\n" | ||
| "POT-Creation-Date: 2026-09-21 13:14-0400\n" | ||
| "POT-Creation-Date: 2026-09-22 10:12-0400\n" |
| "Project-Id-Version: \n" | ||
| "Report-Msgid-Bugs-To: developers@cacti.net\n" | ||
| "POT-Creation-Date: 2026-09-21 13:14-0400\n" | ||
| "POT-Creation-Date: 2026-09-22 10:12-0400\n" |
browniebraun
approved these changes
Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Cacti core is converting its global select-enhancement catch-all from jQuery UI selectmenu to select2. Guard the dynamically-inserted #criticality select's own selectmenu init so it isn't layered on top of a select2 widget core already applied.