Skip to content

Fix deactivate button never rendering on the group Users tab - #2

Closed
OscarBeiro wants to merge 2 commits into
developfrom
fix/deactivate-button-selector
Closed

Fix deactivate button never rendering on the group Users tab#2
OscarBeiro wants to merge 2 commits into
developfrom
fix/deactivate-button-selector

Conversation

@OscarBeiro

Copy link
Copy Markdown
Contributor

Summary

  • Fixes a malformed jQuery selector (input[name^='item[Group_User]' — missing the closing ]) in inc/group.class.php that threw a JS syntax error and aborted the whole $(document).ready callback, so the "Deactivate" button never rendered next to active group members.
  • Adds a run-moregroups Claude Code skill (.claude/skills/run-moregroups/) with a Playwright driver that logs into a live GLPI 11 instance and exercises the full deactivate/reactivate flow — both the single-row buttons and both massive actions — to catch this class of bug going forward (invisible to php -l/phpcs/PHPStan since it's embedded JS in a PHP heredoc).

Test plan

  • Ran the new driver against a live GLPI 11.0.8 test instance (glpi 65000 stack): login → deactivate via single-row button → reactivate via single-row button → deactivate via massive action → activate via massive action, all 6 steps green, screenshots captured for each step.
  • Verified idempotency by running the driver twice back to back.
  • Verified each massive action reloads back onto the same group's Users tab (not some other page).
  • Manual click-through in a browser by a reviewer, per TESTING.md checks #5, #7, #10, #11.

🤖 Generated with Claude Code

https://claude.ai/code/session_011w4D3KeE6Z3BCX6nZgy1CX

OscarBeiro and others added 2 commits August 26, 2026 19:48
GLPI 11's core CheckCsrfListener already validates and consumes the
CSRF token for every POST request before a Symfony-routed controller
runs. The manual Session::validateCSRF() call added in 2.0.2 always
found the token already spent, so every activate/deactivate click was
rejected. Removed the redundant check; core already enforces it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsonuwXxLGnoCtfkviVBmC
The JS selector that injects the "Deactivate" button next to each active
member was malformed (input[name^='item[Group_User]' — missing the
closing ]), so jQuery threw a syntax error and the whole $(document).ready
callback aborted. No deactivate button ever appeared, making the plugin's
core deactivate flow unusable from the UI.

Also adds a run-moregroups Claude Code skill with a Playwright driver that
exercises the full deactivate/reactivate flow — both the single-row
buttons and both massive actions — against a live GLPI 11 instance, to
catch this class of bug (invisible to php -l/phpcs/PHPStan) going forward.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w4D3KeE6Z3BCX6nZgy1CX
@javierlago-ticgal javierlago-ticgal mentioned this pull request Sep 2, 2026
@javierlago-ticgal

Copy link
Copy Markdown
Contributor

Hola! Cerramos esta PR porque el fix del CSRF ya se aplicó en la PR#3 que hizo María (security_fixes), ya mergeada en main con la 2.0.3. Así que esto ya queda cubierto ahí, no hace falta seguir adelante con esta. Gracias igualmente por el curro!

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