From 4c1b6445d3e6bacaeb1495d0ab594d80ae7202a3 Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Mon, 24 Nov 2025 20:11:42 +0800 Subject: [PATCH] Validate invalid fields for hidden system profiles (#11455) * Fix issue that for invisible system profiles, invalid fields are not removed * Fix wrong note field --- .../machine/fdm_machine_eryone_ER20_Klipper_common.json | 2 +- src/libslic3r/PresetBundle.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/profiles/Eryone/machine/fdm_machine_eryone_ER20_Klipper_common.json b/resources/profiles/Eryone/machine/fdm_machine_eryone_ER20_Klipper_common.json index 97e74dd887..f62675d16e 100644 --- a/resources/profiles/Eryone/machine/fdm_machine_eryone_ER20_Klipper_common.json +++ b/resources/profiles/Eryone/machine/fdm_machine_eryone_ER20_Klipper_common.json @@ -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" ], diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index 27f2f93e47..c123cf53d0 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -3891,6 +3891,14 @@ std::pair 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);