We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01fe26b commit 4dba4e0Copy full SHA for 4dba4e0
1 file changed
library/Icinga/Web/Form/ConfigSectionForm.php
@@ -341,12 +341,19 @@ protected function addRequiredElements(): void
341
$this->addSectionNameElement();
342
343
$content = $this->getContent();
344
- $index = array_find_key($content, function ($element) {
345
- return $element->getName() === static::NAME_ELEMENT_NAME;
346
- });
347
- if ($index === false) {
+ $index = null;
+ foreach ($content as $key => $element) {
+ /** @var FormElement $element */
+ if ($element->getName() === static::NAME_ELEMENT_NAME) {
348
+ $index = $key;
349
+ break;
350
+ }
351
352
+
353
+ if ($index === null) {
354
throw new LogicException('Could not find section name element');
355
}
356
357
$element = $content[$index];
358
unset($content[$index]);
359
array_unshift($content, $element);
0 commit comments