Skip to content

Role no longer be created or updated when RoleForm has too many elements #5468

@moreamazingnick

Description

@moreamazingnick

Describe the bug

I have many modules in use and many modules provide many permissions
As soon as the Form hits a threshold which can be triggered by providing permissions like that but in a bigger context, storing the form with the Administrative Access switch on is no longer working.

$this->providePermission('strange/40', $this->translate('somemessage'));

To Reproduce

  1. Create an IcingaWeb2 Instance with icingadb. it is not that important but raises the amount of form elements.
    You can see the modules in the testsetup in the screenshot below

  2. Create a directory with any name, I used "strange"

  3. Create a configuration.php with the following content:

<?php

/** @var \Icinga\Application\Modules\Module $this */

$counter = 400;

while ($counter > 0) {
    $this->providePermission('strange/text_'.$counter, $this->translate('somepermission'));
    $counter--;
}
?>
  1. Create a new Role with Administrative Access switched on
  2. Try to store the Role
  3. No error message no anything, just a reload of the form
  4. Play with the counter (<280 was still ok) (> 290 breaks the form save function)

Expected behavior

Form should save

Screenshots

Image

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Icinga Web 2 version and modules (System - About): 2.12.6
  • Web browser used: Chrome
  • PHP version used (php --version): 8.3
  • Server operating system and version: Fedora 42 / Ubuntu 24.04

Additional context

The Button "Administrative Access" creates additional form elements which causes the form to crash earlier
If you set the counter to 500 It won't let you save anything at all.
If you don't use the Administrative access switch the thresholds are:
(<420 was still ok) (> 430 breaks the form save function completely)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions