Do not change EDA info of original category or footprint when cloning

Fixes #1341. We have to clone the eda info on duplicaion
This commit is contained in:
Jan Böhmer 2026-05-04 22:42:18 +02:00
parent 2a6f6f4ed5
commit 3ef4a83f4a
2 changed files with 18 additions and 0 deletions

View file

@ -208,6 +208,15 @@ class Category extends AbstractPartsContainingDBElement
$this->eda_info = new EDACategoryInfo();
}
public function __clone()
{
if ($this->id) {
//Clone EDA info to prevent changes to the original EDA info when changing the cloned category
$this->eda_info = clone $this->eda_info;
}
parent::__clone();
}
public function getPartnameHint(): string
{
return $this->partname_hint;

View file

@ -152,6 +152,15 @@ class Footprint extends AbstractPartsContainingDBElement
$this->eda_info = new EDAFootprintInfo();
}
public function __clone()
{
if ($this->id) {
//Clone EDA info to prevent changes to the original EDA info when changing the cloned category
$this->eda_info = clone $this->eda_info;
}
parent::__clone();
}
/****************************************
* Getters
****************************************/