Skip to content

fix: don't skip user presets when parent preset is not found#10875

Open
BenJule wants to merge 1 commit into
bambulab:masterfrom
BenJule:upstream/fix-preset-parent-not-found
Open

fix: don't skip user presets when parent preset is not found#10875
BenJule wants to merge 1 commit into
bambulab:masterfrom
BenJule:upstream/fix-preset-parent-not-found

Conversation

@BenJule
Copy link
Copy Markdown

@BenJule BenJule commented May 22, 2026

Summary

Fixes #10869

Root Cause

In PresetCollection::load_presets() (src/libslic3r/Preset.cpp), when a user preset has an inherits field that points to a system preset that no longer exists (e.g. because it was renamed or removed in a system update), the preset is silently skipped:

// BEFORE – buggy
if ((inherits_config2 && !inherits_config2->value.empty())) {
    BOOST_LOG_TRIVIAL(error) << "can not find parent ...";
    continue;  // ← preset disappears from the UI entirely
}

From the user's perspective the preset appears to be gone after restarting the application, even though the file is still on disk. This explains why the workaround of recreating the User directory helps — it forces the user to re-create presets under the current system-preset names, so the parent is always found.

The bug can be triggered whenever:

  • A system-preset name changes between releases (version bump, printer variant rename, etc.)
  • The user's inherits reference still points to the old name

Fix

Instead of continue-ing (dropping the preset), fall back to the built-in default config and emit a warning log entry. The user's saved values are applied on top of the default, so their settings are preserved as well as possible. The preset is now visible in the UI and the user can correct any values that used to derive from the missing parent.

// AFTER – fixed
if ((inherits_config2 && !inherits_config2->value.empty())) {
    BOOST_LOG_TRIVIAL(warning) << "Parent preset not found; loading with default config as fallback.";
    // fall through to default config path — do NOT skip
}
preset.config = default_preset.config;
preset.config.apply(std::move(config));
extend_default_config_length(preset.config, {}, true, default_preset.config);

Behaviour change

Scenario Before After
Parent preset found ✅ loaded correctly ✅ unchanged
Parent preset not found ❌ preset silently dropped ✅ preset loaded with default base + user diffs, warning in log

Notes

The fallback may produce subtly different values for settings that were inherited (not explicitly saved) from the missing parent. This is a known trade-off: a preset with potentially imperfect settings is always preferable to a silently deleted preset.

When loading user presets, if the 'inherits' parent preset cannot be
found (e.g. because a system preset was renamed or removed by an app
update), the preset was silently skipped with a 'continue'. From the
user's perspective the preset appeared to vanish after restarting.

Instead, fall back to the built-in default config and emit a warning.
The user's saved values are still applied on top of the default, so
their settings are preserved as well as possible. The preset appears in
the list and the user can correct any values that depended on the now-
missing parent.

Fixes bambulab#10869.
@BenJule BenJule mentioned this pull request May 22, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Print profile is not saved

1 participant