Rerun of function 'delete_image' when deleting item. Fixed.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 24 Jan 2022 08:07:55 +0000 (09:07 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 24 Jan 2022 08:07:55 +0000 (09:07 +0100)
inventory/manage/items.php

index d4904041b2e0c3752f2d5fdf1c1a9e7bc5345ab2..fe4e82b1d26214b04cfaf1d063c9834a59050d96 100644 (file)
@@ -56,7 +56,7 @@ function set_edit($stock_id)
        $_POST['del_image'] = 0;
 }
 
-function delete_image($stock_id)
+function del_image($stock_id)
 {
        foreach (array('jpg', 'png', 'gif') as $ext) {
                $filename = company_path().'/images/'.item_img_name($stock_id).".".$ext;
@@ -335,7 +335,7 @@ if (isset($_POST['delete']) && strlen($_POST['delete']) > 1)
 
                $stock_id = $_POST['NewStockID'];
                delete_item($stock_id);
-               delete_image($stock_id);
+               del_image($stock_id);
                display_notification(_("Selected item has been deleted."));
                $_POST['stock_id'] = '';
                clear_data();