mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-18 21:28:28 +01:00
Use MPN instead of part name for auto product URLs if available
Implements issue #93
This commit is contained in:
@@ -75,7 +75,12 @@ trait ManufacturerTrait
|
||||
}
|
||||
|
||||
if (null !== $this->getManufacturer()) {
|
||||
return $this->getManufacturer()->getAutoProductUrl($this->name);
|
||||
//If possible use the MPN to resolve the auto product URL, otherwise use the parts name
|
||||
$mpn = $this->getManufacturerProductNumber();
|
||||
if (empty($mpn)) {
|
||||
$mpn = $this->getName();
|
||||
}
|
||||
return $this->getManufacturer()->getAutoProductUrl($mpn);
|
||||
}
|
||||
|
||||
return ''; // no url is available
|
||||
|
||||
Reference in New Issue
Block a user