Skip to content

Commit 29f9238

Browse files
committed
Fixed an error message when category was deselected in search options.
1 parent 0634251 commit 29f9238

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/Part.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2807,7 +2807,7 @@ public static function searchParts(
28072807

28082808
$keyword = trim($keyword);
28092809

2810-
$current_user->tryDo(PermissionManager::PARTS, PartPermission::SEARCH);#
2810+
$current_user->tryDo(PermissionManager::PARTS, PartPermission::SEARCH);
28112811

28122812
//Let the user only search properties, for which he has access
28132813
$part_name = $part_name
@@ -2866,6 +2866,8 @@ public static function searchParts(
28662866

28672867

28682868
$query = 'SELECT parts.* FROM parts';
2869+
2870+
$query .= ' LEFT JOIN categories ON parts.id_category=categories.id';
28692871
if ($footprint_name) {
28702872
$query .= ' LEFT JOIN footprints ON parts.id_footprint=footprints.id';
28712873
}
@@ -2875,9 +2877,6 @@ public static function searchParts(
28752877
if ($manufacturer_name) {
28762878
$query .= ' LEFT JOIN manufacturers ON parts.id_manufacturer=manufacturers.id';
28772879
}
2878-
if ($category_name) {
2879-
$query .= ' LEFT JOIN categories ON parts.id_category=categories.id';
2880-
}
28812880
if ($supplierpartnr || $supplier_name) {
28822881
$query .= ' LEFT JOIN orderdetails ON parts.id=orderdetails.part_id';
28832882
$query .= ' LEFT JOIN suppliers ON orderdetails.id_supplier=suppliers.id';

0 commit comments

Comments
 (0)