mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-08-03 23:21:44 +00:00
Fixed element14 barcode to part logic, when barcode not contain SKU
This commit is contained in:
parent
e11eff5e45
commit
bc6a4004b5
2 changed files with 3 additions and 2 deletions
|
|
@ -296,7 +296,8 @@ class Element14Provider implements InfoProviderInterface, URLHandlerInfoProvider
|
|||
{
|
||||
$tmp = $this->queryByTerm('id:' . $id);
|
||||
if (count($tmp) === 0) {
|
||||
throw new \RuntimeException('No part found with ID ' . $id);
|
||||
//Try to search by MPN, as some parts are not found by ID, but by MPN
|
||||
$tmp = $this->queryByTerm('any:' . $id);
|
||||
}
|
||||
|
||||
if (count($tmp) > 1) {
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ final readonly class BarcodeScanResultHandler
|
|||
];
|
||||
}
|
||||
|
||||
// Element14: can use supplierPartNumber directly
|
||||
// Element14: can use supplierPartNumber directly, as the Element14Provider will try to resolve it to a SKU number if necessary
|
||||
if ($vendor === 'element14') {
|
||||
return [
|
||||
'providerKey' => 'element14',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue