Skip to content

Commit e4639d2

Browse files
committed
fix: query eliminazione categorie
1 parent 6c1e156 commit e4639d2

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

modules/categorie/actions.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,7 @@
143143
$id = $id_record;
144144
}
145145

146-
$query = 'SELECT * FROM `mg_articoli` WHERE (`id_categoria` = :id OR `id_sottocategoria` = :id OR `id_sottocategoria` IN (SELECT `id` FROM `zz_categorie` WHERE `parent` = :id)) AND `deleted_at` IS NULL';
147-
$params = [
148-
':id' => $id,
149-
];
150-
151-
if ($dbo->fetchNum($query, $params) == 0) {
146+
if ($dbo->fetchNum('SELECT * FROM `mg_articoli` WHERE (`id_categoria`='.prepare($id).' OR `id_sottocategoria`='.prepare($id).' OR `id_sottocategoria` IN (SELECT `id` FROM `zz_categorie` WHERE `parent`='.prepare($id).')) AND `deleted_at` IS NULL') == 0) {
152147
$dbo->delete('zz_categorie', ['id' => $id]);
153148

154149
flash()->info(tr('Tipologia di _TYPE_ eliminata con successo!', [

0 commit comments

Comments
 (0)