Changeset 2001

Show
Ignore:
Timestamp:
11/29/2009 01:27:28 AM (2 months ago)
Author:
kurtwiersma
Message:

Fix for CF 9 not providing the "access" attribute when auto getters/setters are used

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • framework/1-8-0/trunk/util/BeanUtil.cfc

    r1892 r2001  
    154154                <cfset var field = 0 /> 
    155155                <cfset var map = describeBean(arguments.bean) /> 
    156                  
     156                <!---<cftrace text="bean name: #getMetaData(bean).fullname#" />---> 
     157 
    157158                <cfloop collection="#map#" item="field"> 
    158159                        <cfif arguments.prefix neq ""> 
     
    160161                                        AND StructKeyExists(arguments.fieldCollection, "#prefix#.#field#")> 
    161162                                        <cfset setBeanField(arguments.bean, field, arguments.fieldCollection["#prefix#.#field#"]) /> 
     163                                        <!---<cftrace text="setBeanField(arguments.bean, field, arguments.fieldCollection[prefix.field]) = 
     164                                                setBeanField(arguments.bean, #field#, arguments.fieldCollection['#prefix#.#field#']) :  
     165                                                '#arguments.fieldCollection['#prefix#.#field#']#'" />---> 
    162166                                </cfif> 
    163167                        <cfelse> 
     
    165169                                        AND StructKeyExists(arguments.fieldCollection, field)> 
    166170                                        <cfset setBeanField(arguments.bean, field, arguments.fieldCollection[field]) /> 
     171                                        <!---<cftrace text="setBeanField(arguments.bean, field, arguments.fieldCollection[field]) =  
     172                                                setBeanField(arguments.bean, #field#, arguments.fieldCollection[#field#]) :  
     173                                                '#arguments.fieldCollection[field]#'" />---> 
    167174                                </cfif> 
    168175                        </cfif> 
     
    215222                <cfloop from="1" to="#ArrayLen(metaFunctions)#" index="i"> 
    216223                        <cfset metaFunction = metaFunctions[i] /> 
     224                         
     225                        <!--- CF 9 does not seem to provide the "access" attribute when auto getters/setters are used --->                       
     226                        <cfif NOT structKeyExists(metaFunction, "access")> 
     227                                <cfset metaFunction.access = "public" /> 
     228                        </cfif> 
     229                         
    217230                        <cfif metaFunction.name.toLowerCase().startsWith("get") 
    218231                                AND metaFunction.access.equalsIgnoreCase("public")