Commit 27e203c
committed
Fix role permissions update silently failing with many maps
getFormParams() submitted every checkbox unconditionally — checked as "1"
and unchecked as "". With 328 maps x 3 permission checkboxes = 984 POST
vars, plus the other form fields, PHP's default max_input_vars=1000 limit
is exceeded. PHP silently truncates $_POST at that point. The submit button
(_submit) is rendered after all permission checkboxes and gets dropped,
causing submitted() to return false and is_action() to return false —
resulting in the form appearing to do nothing with no error shown.
Fix by not submitting unchecked checkboxes at all, matching standard HTML
form behaviour. get_checkbox() already returns false for both absent keys
and empty strings, and updateRolePerms() deletes all existing permissions
before re-inserting the checked ones, so the behaviour is identical.1 parent e6430eb commit 27e203c
2 files changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
199 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| |||
0 commit comments