Path deleted in jsonConf package is not reflected in the json file
Original Reporter info from Mantis: nushydude
-
Reporter name: Anusha Dharmasena
Original Reporter info from Mantis: nushydude
- Reporter name: Anusha Dharmasena
Description:
jsonConf package has a method called DeletePath which can delete a specific attribute (along with its children). This works property in memory, i.e. the correct node gets deleted. However, the change is not saved to the json file.
Additional information:
Reason:
DeletePath method does not set the 'FModified' flag to true.
Because of this, the Flush method does not update the file as it thinks that no changes have been made to the original json file.
Fix:
Add the following line immediately after Node.Delete(L) line in TJSONConfig.DeletePath(...) method.
FModified:= True;
Workaround:
Write a dummy entry to the json file, which sets FModified to true, and then call DeletePath for the actual path you want to delete and the dummy entry. This causes the file to be updated, and then it works.
Mantis conversion info:
- Mantis ID: 30907
- OS: Windows XP
- OS Build: XP SP3
- Platform: x86
- Version: 3.0.0
- Fixed in version: 3.1.1
- Fixed in revision: 34870 (#66b07b04)
- Target version: 3.2.0