Browse Source

* Bugfix for case of more than one handler classname

git-svn-id: trunk@15696 -
michael 15 years ago
parent
commit
62adc74dc4
1 changed files with 5 additions and 1 deletions
  1. 5 1
      packages/fcl-web/src/jsonrpc/fpextdirect.pp

+ 5 - 1
packages/fcl-web/src/jsonrpc/fpextdirect.pp

@@ -218,6 +218,7 @@ Var
   HD : TJSONRPCHandlerDef;
   HD : TJSONRPCHandlerDef;
 
 
 begin
 begin
+  {$ifdef extdebug}SendDebugFmt('Creating API entries',[]);{$endif}
   D:=TJSONObject.Create;
   D:=TJSONObject.Create;
   try
   try
     D.Add('url',URL);
     D.Add('url',URL);
@@ -247,12 +248,15 @@ begin
       For I:=M.HandlerCount-1 downto 0 do
       For I:=M.HandlerCount-1 downto 0 do
         begin
         begin
         HD:=M.HandlerDefs[i];
         HD:=M.HandlerDefs[i];
+  {$ifdef extdebug}SendDebugFmt('Creating API entry for %s.%s',[HD.HandlerClassName,HD.HandlerMethodName]);{$endif}
         If (R=Nil) or (CompareText(N,HD.HandlerClassName)<>0) then
         If (R=Nil) or (CompareText(N,HD.HandlerClassName)<>0) then
           begin
           begin
+  {$ifdef extdebug}SendDebugFmt('Seems like new action entry : %s<> %s',[HD.HandlerClassName,N]);{$endif}
           N:=HD.HandlerClassName;
           N:=HD.HandlerClassName;
-          J:=A.IndexOf(R);
+          J:=A.IndexOfName(N);
           If (J=-1) then
           If (J=-1) then
             begin
             begin
+  {$ifdef extdebug}SendDebugFmt('Creating new action entry : %s ',[N]);{$endif}
             R:=TJSONArray.Create;
             R:=TJSONArray.Create;
             A.Add(N,R);
             A.Add(N,R);
             end
             end