Kbase 19904: ADM2 - SetUserProperty Function Can Set Wrong Property
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  18/09/2008 |
|
Status: Unverified
GOAL:
ADM2 - SetUserProperty Function Can Set Wrong Property
FIX:
When the SetUserFunction adds the requested user property to the ADM-Data list, it first searches to see if the property already exists in the user property list. It searches for the property name using the INDEX function located in Smart.p.
The wrong user property might be set in certain situations because the INDEX function may find the property name inside the name of some other property.
As an example, let's say you set a user property called NotMyUserProperty and you set the value to A. Then you set a user property called MyUserProperty and set the value to B. You would expect that the values for these properties would be A and B respectively, but this is not the case.
When you call for MyUserProperty from setUserProperty, the INDEX function returns the location of MyUserProperty as within the entry for NotMyUserProperty. As a result, the value of B is set for the NotMyUserProperty property and MyUserProperty is never added to the list.
Looking at this same example in code, you set user properties with:
DYNAMIC-FUNCTION('setUserProperty', NotMyUserProperty', cNotMyProp).
DYNAMIC-FUNCTION('setUserProperty', 'MyUserProperty', cMyProp).
Make sure you set the user property name to a unique name.
In other words, make sure that the property name of one, does not exist in the property name of another.