# 5.4 Config not saving correctly

**URL:** <https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [May 17, 2024, 8:55am UTC](https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118 "2024-05-17T08:55:26Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Hyaniner](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hyaniner/32/1194580_2.png) [@Hyaniner](https://forums.unrealengine.com/u/Hyaniner)\
**Post date:** [May 22, 2024, 8:34am UTC](https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118/6 "2024-05-22T08:34:48Z")

</div>

In UCLASS(config = SomeName), I added the word “Editor” to “SomeName”, then SaveConfig() worked. Maybe if you add “User”, it will work.

Within my debugging, I found this.

[https://github.com/EpicGames/UnrealEngine/blob/16dc333db3d6439c7f2886cf89db8907846c0e8a/Engine/Source/Runtime/Core/Private/Misc/ConfigContext.cpp#L403-L423](https://github.com/EpicGames/UnrealEngine/blob/16dc333db3d6439c7f2886cf89db8907846c0e8a/Engine/Source/Runtime/Core/Private/Misc/ConfigContext.cpp#L403-L423)

```cpp

		// check if the config file wants to save all sections
		bool bLocalSaveAllSections = false;
		// Do not report the read of SectionsToSave. Some ConfigFiles are reallocated without it, and reporting
		// logs that the section disappeared. But this log is spurious since if the only reason it was read was
		// for the internal save before the FConfigFile is made publicly available.
		const FConfigSection* SectionsToSaveSection = ConfigFile->FindSection(SectionsToSaveString);
		if (SectionsToSaveSection)
		{
			const FConfigValue* Value = SectionsToSaveSection->Find(SaveAllSectionsKey);
			if (Value)
			{
				const FString& ValueStr = UE::ConfigCacheIni::Private::FAccessor::GetValueForWriting(*Value);
				bLocalSaveAllSections = FCString::ToBool(*ValueStr);
			}
		}

		// we can always save all sections of a User config file, Editor* (not Editor.ini tho, that is already handled in the normal method)
		bool bIsUserFile = BaseIniName.Contains(TEXT("User"));
		bool bIsEditorSettingsFile = BaseIniName.Contains(TEXT("Editor")) && BaseIniName != TEXT("Editor");

		ConfigFile->bCanSaveAllSections = bLocalSaveAllSections || bIsUserFile || bIsEditorSettingsFile;

```

---

_[View the full topic](https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118)._
