2
0
forked from Wavyzz/dolibarr

Add result message on extrafield deletion

This commit is contained in:
Laurent Destailleur
2023-09-19 16:42:50 +02:00
parent 4fa60709d5
commit bd4efca9e7
2 changed files with 7 additions and 2 deletions

View File

@@ -401,8 +401,12 @@ if ($action == 'update') {
// Delete attribute
if ($action == 'delete') {
if (GETPOSTISSET("attrname") && preg_match("/^\w[a-zA-Z0-9-_]*$/", GETPOST("attrname", 'aZ09'))) {
$result = $extrafields->delete(GETPOST("attrname", 'aZ09'), $elementtype);
$attributekey = GETPOST('attrname', 'aZ09');
$result = $extrafields->delete($attributekey, $elementtype);
if ($result >= 0) {
setEventMessages($langs->trans("ExtrafieldsDeleted", $attributekey), null, 'mesgs');
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} else {