mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-03 13:59:35 +00:00
Fix settings crash when upgrading: make datasheetAsPdf nullable
The settings bundle stores values in the database. When upgrading from a version without datasheetAsPdf, the stored JSON lacks this key, causing a TypeError when assigning null to a non-nullable bool. Making it nullable with a fallback in KiCadHelper fixes the upgrade path.
This commit is contained in:
parent
67c0b02248
commit
9de176e455
2 changed files with 2 additions and 2 deletions
|
|
@ -58,7 +58,7 @@ class KiCadHelper
|
||||||
KiCadEDASettings $kiCadEDASettings,
|
KiCadEDASettings $kiCadEDASettings,
|
||||||
) {
|
) {
|
||||||
$this->category_depth = $kiCadEDASettings->categoryDepth;
|
$this->category_depth = $kiCadEDASettings->categoryDepth;
|
||||||
$this->datasheetAsPdf = $kiCadEDASettings->datasheetAsPdf;
|
$this->datasheetAsPdf = $kiCadEDASettings->datasheetAsPdf ?? true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -47,5 +47,5 @@ class KiCadEDASettings
|
||||||
#[SettingsParameter(label: new TM("settings.misc.kicad_eda.datasheet_link"),
|
#[SettingsParameter(label: new TM("settings.misc.kicad_eda.datasheet_link"),
|
||||||
description: new TM("settings.misc.kicad_eda.datasheet_link.help"),
|
description: new TM("settings.misc.kicad_eda.datasheet_link.help"),
|
||||||
envVar: "bool:EDA_KICAD_DATASHEET_AS_PDF", envVarMode: EnvVarMode::OVERWRITE)]
|
envVar: "bool:EDA_KICAD_DATASHEET_AS_PDF", envVarMode: EnvVarMode::OVERWRITE)]
|
||||||
public bool $datasheetAsPdf = true;
|
public ?bool $datasheetAsPdf = true;
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue