View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0036164||Lazarus||Database Components||public||2019-10-11 18:37||2020-03-16 20:57|
|Reporter||Anderson||Assigned To||Juha Manninen|
|Summary||0036164: TDBEdit.Modified is not setting|
|Description||The "Modified" property is not setting to true after making a change to an TDBEdit component.|
|Steps To Reproduce||See sample or just try something like:|
if DBEditDBF.Modified then
ShowMessage('DBF NOT Modified');
Made a sample code using IBX, Memdataset and TDBF
|Tags||No tags attached.|
|Fixed in Revision||r62769|
modified.zip (200,191 bytes)
||tested with Lazarus 2.0.6 and the bug stills there|
I am not sure if the "Modified" property should be set for any DB aware controls. The DB itself is modified, not the control connecting to it.
A DB expert should comment on this one.
Hi Juha Manninen, thx for your comment
I have a project running on Lazarus 1.8 and the Modified is stetted normally.
I have a logic the use "onExit" and "Modified" to do some stuff. On Lazarus 1.8 and early it's works good... on 2.0+ no..
I'm stuck on 1.8..
Hello, found the issue related: https://bugs.freepascal.org/view.php?id=31820
The problem is that "TDBEdit.UpdateData" is called after every change on the TDBEdit, so the "Modified := False;" is always executed...
If I remove the "Modified := False;" my code works fine.
> The problem is that "TDBEdit.UpdateData" is called after every change on the TDBEdit
Do you mean after every keypress? Then it is called too often.
Please see the note by Soner in the related issue:
which is perfectly valid.
Making decisions based on TDBEdit.Modified is logically wrong. TField.Modified would indeed make more sense but implementing it may be tricky. Somebody with good DB knowledge should comment on this one.
[Edit] I reopened the related issue. Maybe we should indeed revert r56034 unless somebody comes up with a better solution.
The question is: If the Modified flag is not useful, why Andrey Korol and Soner wanted to reset it in the first place?
Ideal solution would be to reset TDBEdit.Modified only after DataSet.Post.
Hi Juha Manninen thx for your answer.
I know it's not the best to use TDBEdit.Modified, but i'ts work for my logic.. I have a "refresh data" that is called at onExit, to optimize I call It only when it's "Modified"..
Now talking about TField.Modified it would be awesome..
I have a code in Delphi that checks "TField.OldValue" and "TField.NewValue" at DataSet.OnBeforePost for audit purposes, tried to replicate with Lazarus.. but the OldValue and NewValue are always the same...
> but the OldValue and NewValue are always the same...
Ohh! Could you please study the code and fix it? I don't personally work much with DBs.
||Sure, I can try|
Hi Juha Manninen
About the old/new value thing.. I need to make some changes on the DB.pas file..
This file is part of FPC and not Lazarus right?
Sorry I missed your question earlier.
Yes, unit DB is part of FPC project. You should create a separate patch and open a separate report for it. The issue can be marked as related to this one then.
I reverted r56034 in r62769. Authors of the related issue must justify better their request.
|2019-10-11 18:37||Anderson||New Issue|
|2019-10-11 18:37||Anderson||File Added: modified.zip|
|2019-11-07 15:01||Anderson||Note Added: 0119136|
|2019-11-13 00:03||Juha Manninen||Note Added: 0119249|
|2019-11-23 13:12||Anderson||Note Added: 0119448|
|2019-12-04 19:21||Anderson||Note Added: 0119616|
|2019-12-04 23:49||Juha Manninen||Relationship added||related to 0031820|
|2019-12-05 00:28||Juha Manninen||Note Added: 0119617|
|2019-12-05 00:28||Juha Manninen||Assigned To||=> Juha Manninen|
|2019-12-05 00:28||Juha Manninen||Status||new => feedback|
|2019-12-05 00:28||Juha Manninen||LazTarget||=> -|
|2019-12-05 00:32||Juha Manninen||Note Edited: 0119617||View Revisions|
|2019-12-05 19:39||Juha Manninen||Note Edited: 0119617||View Revisions|
|2019-12-06 22:12||Anderson||Note Added: 0119668|
|2019-12-06 22:12||Anderson||Status||feedback => assigned|
|2019-12-06 22:56||Juha Manninen||Note Added: 0119669|
|2019-12-07 00:02||Anderson||Note Added: 0119670|
|2019-12-13 01:55||Anderson||Note Added: 0119810|
|2019-12-28 23:43||Juha Manninen||Note Added: 0120118|
|2020-03-16 20:57||Juha Manninen||Status||assigned => resolved|
|2020-03-16 20:57||Juha Manninen||Resolution||open => fixed|
|2020-03-16 20:57||Juha Manninen||Fixed in Revision||=> r62769|
|2020-03-16 20:57||Juha Manninen||Note Added: 0121630|