#1 2018-03-05 06:08:50

ComingNine
Member
Registered: 2010-07-29
Posts: 294

Regression of ManyAdd/Many.../SourceGet/DestGet with "current" omitted

As discussed in https://synopse.info/forum/viewtopic.php?id=164, ManyAdd/ManyDelete/ManySelect/SourceGet/DestGet can be used with one less parameter - the "current" fSourceID/fDestID.

However, in the latest sample code "mORMot and Open Source friends-d573e7358a\SQLite3\Samples\ThirdPartyDemos\Migajek\synopse-sqlite-demo", the overloaded methods with one less parameter does not work, as tested with the following modifications

HiWin10@MICROSO-8C7VFP4 /cygdrive/d/mORMot and Open Source friends-d573e7358a/SQLite3/Samples/ThirdPartyDemos/Migajek/synopse-sqlite-demo
$ diff Unit1.pas ../synopse-sqlite-demo.original/
184,185c184
<   ACustomer.Tasks.DestGet(globalClient, fIds);
<   // ACustomer.Tasks.DestGet(globalClient, ACustomer.ID, fIds);
---
>   ACustomer.Tasks.DestGet(globalClient, ACustomer.ID, fIds);
371,372c370
<                     cust.Tasks.ManyAdd(globalClient, task.ID, true)
<                     // cust.Tasks.ManyAdd(globalClient, cust.ID, task.ID, true)
---
>                     cust.Tasks.ManyAdd(globalClient, cust.ID, task.ID, true)
374,375c372
<                     cust.Tasks.ManyDelete(globalClient, task.ID);
<                     // cust.Tasks.ManyDelete(globalClient, cust.ID, task.ID);
---
>                     cust.Tasks.ManyDelete(globalClient, cust.ID, task.ID);

Could you help to fix the behavior ? Many thanks for your efforts ! smile

Offline

#2 2018-03-05 08:44:50

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

Re: Regression of ManyAdd/Many.../SourceGet/DestGet with "current" omitted

Could you please make a pull request on github?

It is much easier to merge, and manage.

Offline

#3 2018-03-05 08:47:40

ComingNine
Member
Registered: 2010-07-29
Posts: 294

Re: Regression of ManyAdd/Many.../SourceGet/DestGet with "current" omitted

Sorry for the confusion.

I did not manage to find the fix... 

The diff was intended to show how to reproduce the regression . Could you help to check and fix ?

Offline

#4 2018-03-05 08:54:45

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

Re: Regression of ManyAdd/Many.../SourceGet/DestGet with "current" omitted

I'm sorry, but I don't understand well what you mean...

Offline

#5 2018-03-05 09:04:17

ComingNine
Member
Registered: 2010-07-29
Posts: 294

Re: Regression of ManyAdd/Many.../SourceGet/DestGet with "current" omitted

As discussed in https://synopse.info/forum/viewtopic.php?id=164, ManyAdd/ManyDelete/ManySelect/SourceGet/DestGet can be used with one less parameter - the "current" fSourceID/fDestID.

That is to say, in about 184th line of the "mORMot and Open Source friends-d573e7358a/SQLite3/Samples/ThirdPartyDemos/Migajek/synopse-sqlite-demo/Unit1.pas", both lines below should work. Nevertheless, only the second one works in the latest source.

      cust.Tasks.ManyAdd(globalClient, task.ID, true)
      cust.Tasks.ManyAdd(globalClient, cust.ID, task.ID, true)

Could you help to comment whether the situation is made clearer ? big_smile

Offline

Board footer

Powered by FluxBB