Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TFIBxxxfield.OnValidate might dump #30

Closed
riniman opened this issue Aug 16, 2018 · 3 comments
Closed

TFIBxxxfield.OnValidate might dump #30

riniman opened this issue Aug 16, 2018 · 3 comments

Comments

@riniman
Copy link

riniman commented Aug 16, 2018

TpFIBDataSet.TFIBxxxField.OnValidate will create an Access Violation error
when reading the same field as the OnValidate "sits" on.

OnValidate on a TStringField in a TpFIBDataSet works.

Delphi Tokyo (10.2.3)

TestOnValidate.zip

@fduron
Copy link

fduron commented Mar 12, 2020

TpFIBDataSet.TFIBxxxField.OnValidate will create an Access Violation error
when reading the same field as the OnValidate "sits" on.

OnValidate on a TStringField in a TpFIBDataSet works.

Delphi Tokyo (10.2.3)

TestOnValidate.zip

This issue remains on Delphi Rio (10.3.3)

@OLMIG62
Copy link

OLMIG62 commented Jun 30, 2023

Tested with Delphi Sydney 10.4, work fine!

procedure TFIBCustomDataSet.DoFieldValidate(Field:TField;Buffer:Pointer);
begin
if Assigned(Field.OnValidate) then
begin
Include(FRunState,drsInFieldValidate);
try
FValidatingFieldBuffer:=Buffer;
{$ifdef D_27}
Field.Validate(FValidatingFieldBuffer);
{$else}
FValidatedField:=Field;
FValidatedRec:= ActiveRecord;
Field.OnValidate(FValidatingFieldBuffer);
{$endif}
finally
Exclude(FRunState,drsInFieldValidate);
FValidatingFieldBuffer:=nil;
end;
end;
end;

@madorin
Copy link
Owner

madorin commented Dec 24, 2023

Fixed in #76

@madorin madorin closed this as completed Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants