Using Revert Tab in Data Table panel
I was working in the Data Table panel of a Data Package, I deleted a Selected
Column, and then I did Revert Tab, but it didn’t revert to my original data
table. Here is what it did. Initially, I had 6 columns. Let’s say the column
names were A, B, C, D, E, F. I deleted column A. After I did Revert Tab, I had
5 columns with column headers B, C, D, E, F (in that order) containing data from
the original columns A, B, C, D, E, respectively. So, in the end, after doing
Revert Tab, I got the data from column A back (the column I had deleted), but
the column header A was replaced by column header B (followed by column headers
C, D, E, F), and I lost data from column F.
#2 Updated by Saurabh Garg over 14 years ago
When the data is modified, the version of the data in the memory is modified.
And when the user selects 'revert tab', the data is re-read from the file.
But when a column is deleted, the version of the data in the memory is modified
AND the datapackage information is modified. So the attribute representing the
column in the attribute list in the datapackage is removed. And when the user
selects revert tab, the data is re-read from the disk. BUT the datapackage
information is not read from the disk. This is because there might be other
changes made using the tree editor or the 'Documentation' menu. So if we re-
read the file from the disk, we will lose the other changes also.
I fixed this by reading the document from the disk and just replacing the
entity part of the document. So only the entity and attribute information is
reloaded. This solution might also fail if the document is no longer avaiable
for some reason - for example the network went down or the file was deleted.
But otherwise, this seems to work fine.
Veronique can also check to see if it works fine for her and then I will close
#3 Updated by Saurabh Garg almost 14 years ago
Closing the bug. Renamed Revert Tab to Revert Entity to saved version.
Works if user modifies/deletes rows/columns in an entity. The modified entity
is replaced with the entity that was saved initially. If changes were made on a
newly created entity which has not been saved yet, the old entity data is lost.