View Issue Details

IDProjectCategoryView StatusLast Update
0037500pas2jsrtlpublic2020-08-06 15:00
Reporterhenrique Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWebOSWindows 
Fixed in Versiontrunk 
Summary0037500: Error reading property
DescriptionI published a property of type "referring to function", and when it loads the resource that should fill this property gives error of "Unknown property type 17". I attached a fix, because apparently it wasn't mapping this new type.

I changed the message too, to show the name of the unrecognized type instead of its number.
Steps To ReproduceI created a button class, and created an OnClick property, which is a reference to function, and put it in a form and implemented an alert just to test.
TagsNo tags attached.
Fixed in Revision810
Attached Files

Activities

henrique

2020-08-06 14:38

reporter  

Error property.patch (1,878 bytes)   
From d9be54fce849772a15c08dae157ef27866ca168c Mon Sep 17 00:00:00 2001
From: Henrique Gottardi Werlang <henriquewerlang@hotmail.com>
Date: Thu, 6 Aug 2020 09:30:24 -0300
Subject: [PATCH] Erro lendo propriedade

---
 packages/rtl/classes.pas   | 4 ++--
 packages/rtl/rtlconsts.pas | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/packages/rtl/classes.pas b/packages/rtl/classes.pas
index e69fc84..6ee65c9 100644
--- a/packages/rtl/classes.pas
+++ b/packages/rtl/classes.pas
@@ -7719,7 +7719,7 @@ begin
         if TTypeInfoSet(PropType).CompType.Kind=tkEnumeration then
           SetOrdProp(Instance, PropInfo, FDriver.ReadSet(TTypeInfoEnum(TTypeInfoSet(PropType).CompType)));
       end;
-    tkMethod:
+    tkMethod, tkRefToProcVar:
       if FDriver.NextValue = vaNil then
       begin
         FDriver.ReadValue;
@@ -7776,7 +7776,7 @@ begin
     {tkint64:
       SetInt64Prop(Instance, PropInfo, ReadInt64);}
     else
-      raise EReadError.CreateFmt(SUnknownPropertyType, [Ord(PropType.Kind)]);
+      raise EReadError.CreateFmt(SUnknownPropertyType, [Str(PropType.Kind)]);
   end;
 end;
 
diff --git a/packages/rtl/rtlconsts.pas b/packages/rtl/rtlconsts.pas
index 27a452a..cbf25bd 100644
--- a/packages/rtl/rtlconsts.pas
+++ b/packages/rtl/rtlconsts.pas
@@ -60,7 +60,7 @@ Resourcestring
   SInvalidPropertyValue           = 'Invalid value for property';
   SInvalidImage                   = 'Invalid stream format';
   SUnknownProperty                = 'Unknown property: "%s"';
-  SUnknownPropertyType            = 'Unknown property type %d';
+  SUnknownPropertyType            = 'Unknown property type %s';
   SAncestorNotFound               = 'Ancestor class for "%s" not found.';
   SUnsupportedPropertyVariantType = 'Unsupported property variant type %d';
   SPropertyException              = 'Error reading %s%s%s: %s';
-- 
2.28.0.windows.1

Error property.patch (1,878 bytes)   

Michael Van Canneyt

2020-08-06 15:00

administrator   ~0124616

Applied, thank you very much for the patch.

Issue History

Date Modified Username Field Change
2020-08-06 14:38 henrique New Issue
2020-08-06 14:38 henrique File Added: Error property.patch
2020-08-06 15:00 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-08-06 15:00 Michael Van Canneyt Status new => resolved
2020-08-06 15:00 Michael Van Canneyt Resolution open => fixed
2020-08-06 15:00 Michael Van Canneyt Fixed in Version => trunk
2020-08-06 15:00 Michael Van Canneyt Fixed in Revision => 810
2020-08-06 15:00 Michael Van Canneyt Note Added: 0124616