Skip to content

Commit

Permalink
Fixed problem that MPN was not used as search field
Browse files Browse the repository at this point in the history
Fixes issue #277 and #276
  • Loading branch information
jbtronics committed Apr 22, 2023
1 parent ccaad1c commit 1eb9c38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Controller/PartListsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ private function searchRequestToFilter(Request $request): PartSearchFilter
$filter->setName($request->query->getBoolean('name', true));
$filter->setCategory($request->query->getBoolean('category', true));
$filter->setDescription($request->query->getBoolean('description', true));
$filter->setMpn($request->query->getBoolean('mpn', true));
$filter->setTags($request->query->getBoolean('tags', true));
$filter->setStorelocation($request->query->getBoolean('storelocation', true));
$filter->setComment($request->query->getBoolean('comment', true));
Expand All @@ -300,6 +301,7 @@ private function searchRequestToFilter(Request $request): PartSearchFilter
$filter->setManufacturer($request->query->getBoolean('manufacturer', false));
$filter->setFootprint($request->query->getBoolean('footprint', false));


$filter->setRegex($request->query->getBoolean('regex', false));

return $filter;
Expand Down
2 changes: 1 addition & 1 deletion src/DataTables/Filters/PartSearchFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected function getFieldsToSearch(): array
$fields_to_search[] = 'orderdetails.supplierpartnr';
}
if($this->mpn) {
$fields_to_search[] = 'part.manufacturer_product_url';
$fields_to_search[] = 'part.manufacturer_product_number';
}
if($this->supplier) {
$fields_to_search[] = 'suppliers.name';
Expand Down

0 comments on commit 1eb9c38

Please sign in to comment.