[BUG] 6.6.4 +CachedUpdates + Filter Empty + Change in Filter
Posted: 27.05.2009, 20:11
I found a problem in ZAbstractRODataset.pas.
If I have in a TZQuery:
If a delete a record and change filter from empty to something then all changes are lost.
The problem is here:
if FSortedFields is empty then is called InternalRefresh and all changes(insert, delete, etc) are lost.
I don't know if InternalRefresh is suposed to keep the changes or if FSortedFields is suposed to be get a value before this point to avoid this problem.
So if someone can help with a patch would be nice.
This is the full procedure on ZAbstractRODataset.pas.
Thank you in advance.
If I have in a TZQuery:
Code: Select all
CachedUpdates = true
Filter = ""
The problem is here:
Code: Select all
if Active then
{InternalSort;}
{bangfauzan modification}
if (FSortedFields = '') then
Self.InternalRefresh
else
InternalSort;
{end of bangfauzan modification}
end;
I don't know if InternalRefresh is suposed to keep the changes or if FSortedFields is suposed to be get a value before this point to avoid this problem.
So if someone can help with a patch would be nice.
This is the full procedure on ZAbstractRODataset.pas.
Code: Select all
procedure TZAbstractRODataset.SetSortedFields({const} Value: string); {bangfauzan modification}
begin
Value:=Trim(Value); {bangfauzan addition}
if (FSortedFields <> Value) or (FIndexFieldNames <> Value)then {bangfauzan modification}
begin
FIndexFieldNames:=Value;
FSortType := GetSortType; {bangfauzan addition}
{removing ASC or DESC behind space}
if (FSortType <> stIgnored) then begin {pawelsel modification}
Value:=StringReplace(Value,' Desc','',[rfReplaceAll,rfIgnoreCase]);
Value:=StringReplace(Value,' Asc','',[rfReplaceAll,rfIgnoreCase]);
end;
FSortedFields := Value;
if Active then
{InternalSort;}
{bangfauzan modification}
if (FSortedFields = '') then
Self.InternalRefresh
else
InternalSort;
{end of bangfauzan modification}
end;
end;