Skip to content

Skip selectmenu init on criticality select if Cacti core already applied select2 - #247

Open
TheWitness wants to merge 3 commits into
developfrom
fix/select2-selectmenu-conflict
Open

TheWitness wants to merge 3 commits into
developfrom
fix/select2-selectmenu-conflict

Conversation

@TheWitness

Copy link
Copy Markdown
Member

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.

…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.
Copilot AI lite review requested due to automatic review settings September 22, 2026 13:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Medium severity

Open (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 selectmenu setup 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.

Comment thread setup.php
xmacan
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Medium severity · 9 Low severity

Open (10)
Resolved since last review (1)

Comment thread INFO
email =
homepage = http://www.cacti.net
compat = 1.2.15
compat = 1.2.32
Comment thread locales/po/ar-SA.po
"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"
Comment thread locales/po/ka-GE.po
"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"
Comment thread locales/po/nl-NL.po
"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"
Comment thread locales/po/pt-BR.po
"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"
Comment thread locales/po/pt-PT.po
"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"
Comment thread locales/po/ru-RU.po
"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"
Comment thread locales/po/sv-SE.po
"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"
Comment thread locales/po/zh-CN.po
"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"
Comment thread locales/po/zh-TW.po
"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"
@TheWitness
TheWitness requested a review from xmacan September 22, 2026 18:38
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.

4 participants