View Issue Details

IDProjectCategoryView StatusLast Update
0030907FPCPackagespublic2016-11-11 10:50
ReporterAnusha DharmasenaAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86OSWindows XPOS VersionXP SP3
Product Version3.0.0Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0030907: Path deleted in jsonConf package is not reflected in the json file
DescriptionjsonConf 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 InformationReason:
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.
TagsNo tags attached.
Fixed in Revision34870
FPCOldBugId
FPCTarget
Attached Files

Activities

Michael Van Canneyt

2016-11-11 10:50

administrator   ~0095753

Fixed and changed testcase to test for this.
Thanks for reporting!

Issue History

Date Modified Username Field Change
2016-11-11 01:46 Anusha Dharmasena New Issue
2016-11-11 10:26 Michael Van Canneyt Assigned To => Michael Van Canneyt
2016-11-11 10:26 Michael Van Canneyt Status new => assigned
2016-11-11 10:50 Michael Van Canneyt Fixed in Revision => 34870
2016-11-11 10:50 Michael Van Canneyt Note Added: 0095753
2016-11-11 10:50 Michael Van Canneyt Status assigned => resolved
2016-11-11 10:50 Michael Van Canneyt Fixed in Version => 3.1.1
2016-11-11 10:50 Michael Van Canneyt Resolution open => fixed
2016-11-11 10:50 Michael Van Canneyt Target Version => 3.2.0