Validate invalid fields for hidden system profiles (#11455)

* Fix issue that for invisible system profiles, invalid fields are not removed

* Fix wrong note field
This commit is contained in:
Noisyfox
2025-11-24 20:11:42 +08:00
committed by GitHub
parent f57d0d1442
commit 4c1b6445d3
2 changed files with 9 additions and 1 deletions

View File

@@ -85,7 +85,7 @@
"min_layer_height": [
"0.08"
],
"notes": "optimized Eryone ER20 Klipper configuration with E3D Hotend, BMG directdrive, printable height limited to 190 because of the top of the directdrive and Z-Sync mod",
"printer_notes": "optimized Eryone ER20 Klipper configuration with E3D Hotend, BMG directdrive, printable height limited to 190 because of the top of the directdrive and Z-Sync mod",
"nozzle_diameter": [
"0.4"
],

View File

@@ -3891,6 +3891,14 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_vendor_configs_
config.apply(config_src);
extend_default_config_length(config, true, *default_config);
if (instantiation == "false" && "Template" != vendor_name) {
// Report configuration fields, which are misplaced into a wrong group.
std::string incorrect_keys = Preset::remove_invalid_keys(config, *default_config);
if (!incorrect_keys.empty()) {
++m_errors;
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": The config " << subfile << " contains incorrect keys: " << incorrect_keys
<< ", which were removed";
}
config_maps.emplace(preset_name, std::move(config));
if ((presets_collection->type() == Preset::TYPE_FILAMENT) && (!filament_id.empty()))
filament_id_maps.emplace(preset_name, filament_id);