#1 2022-12-03 21:27:18

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

boolean fields are always false using INI config in TSynDaemonSettings

A mormot2 daemon does not follow the configuration after an update. I using an inherited class from TSynDaemonSettings with extra properties in the published section and the config file is an INI file.
The same source compiled with Delphi it works ok, but with FPC all boolean directives are taking all the false value. I do not know from which version of Mormot it started to happen.
My FPC version is Lazarus 2.2.4 (rev lazarus_2_2_4-0-g06a78ed923) FPC 3.2.2 x86_64-win64-win32/win64 and even with last versions it is the same.
I tried for the first time the debugger from FPC and I found that the problem should be in line 4243 from mormot.core.data, "if p^.Prop^.SetValueText(Instance, v) then" but even with O0 optimization the debugger shows only assembly when calling this function and it is impossible for me to follow.
string and integers work without problem

Any ideas? Thank you in advance

Offline

#2 2022-12-04 11:37:30

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: boolean fields are always false using INI config in TSynDaemonSettings

With which kind of p^.Prop^ ?

Offline

#3 2022-12-04 12:09:48

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Re: boolean fields are always false using INI config in TSynDaemonSettings

p^.Value.Kind is rkBool
p^.Prop^ is shown as TRttiProp but I can not have any of each properties in the debugger, and evaluating it as expression in the debugger I am getting "TRttiProp ()"

Offline

#4 2022-12-05 09:06:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: boolean fields are always false using INI config in TSynDaemonSettings

Should be fixed with https://github.com/synopse/mORMot2/commit/b0a51d12

You can now use case-insensitive false/true/yes/no in the INI field.

Offline

#5 2022-12-05 10:36:52

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Re: boolean fields are always false using INI config in TSynDaemonSettings

Thanks a lot @ab, it works now

Offline

Board footer

Powered by FluxBB