Skip to content

Commit 1d1eb93

Browse files
committed
fix(section): delete a section displays an error
1 parent eccb9ab commit 1d1eb93

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

front/section.form.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,34 @@
88
if ($plugin->isActivated("formcreator")) {
99
$section = new PluginFormcreatorSection();
1010

11-
// Add a new Section
1211
if (isset($_POST["add"])) {
12+
// Add a new Section
1313
Session::checkRight("entity", UPDATE);
1414
$section->add($_POST);
1515
Html::redirect($CFG_GLPI["root_doc"] . '/plugins/formcreator/front/form.form.php?id=' . $_POST['plugin_formcreator_forms_id']);
1616

17-
// Edit an existing Section
1817
} else if (isset($_POST["update"])) {
18+
// Edit an existing section
1919
Session::checkRight("entity", UPDATE);
2020
$section->update($_POST);
2121
Html::redirect($CFG_GLPI["root_doc"] . '/plugins/formcreator/front/form.form.php?id=' . $_POST['plugin_formcreator_forms_id']);
2222

23-
// Delete a Section
2423
} else if (isset($_POST["delete_section"])) {
24+
// Delete a Section
2525
Session::checkRight("entity", UPDATE);
2626
$section->delete($_POST);
27-
Html::redirect($CFG_GLPI["root_doc"] . '/plugins/formcreator/front/form.form.php?id=' . $_POST['plugin_formcreator_forms_id']);
27+
// Page refresh handled by Javascript
2828

29-
// Duplicate a Section
3029
} else if (isset($_POST["duplicate_section"])) {
30+
// Duplicate a Section
3131
Session::checkRight("entity", UPDATE);
3232
if ($section->getFromDB((int) $_POST['id'])) {
3333
$section->duplicate();
3434
}
35+
// Page refresh handled by Javascript
3536

36-
// Move a Section
3737
} else if (isset($_POST["move"])) {
38+
// Move a Section
3839
Session::checkRight("entity", UPDATE);
3940

4041
if ($section->getFromDB((int) $_POST['id'])) {
@@ -44,11 +45,10 @@
4445
$section->moveDown();
4546
}
4647
}
47-
4848
// Page refresh handled by Javascript
4949

50-
// Return to form list
5150
} else {
51+
// Return to form list
5252
Html::redirect($CFG_GLPI["root_doc"] . '/plugins/formcreator/front/form.php');
5353
}
5454

0 commit comments

Comments
 (0)