Uploaded image for project: 'Lucee Development'
  1. LDEV-1683

passing component on missing constructor invokes implicit setters

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.2.7.0
    • Fix Version/s: 5.2.7.26
    • Labels:
      None

      Description

      Passing a component as argument to a constructor of a (differrent) component, invokes implicit setters of the passed component. This only happens if the received component does not have an explicit constructor method.

      A.cfc

      <cfcomponent>
      	<cffunction name="isFoo" access="public" output="false" returnType="boolean">
      		<cfreturn false>
      	</cffunction>
      </cfcomponent>
      

      B.cfc

      <cfcomponent>
      	<!--- adding the [init] method prevents the issue from occuring, regardless of having an argument signature or not --->
      </cfcomponent>
      

      Breaking Code

      <cfset a = new A()>
      <cfset b = new B(a)>
      

      Error Output

      component [B] has no function with name [setISFOO]

      The issue doesn't happen in ACF. I consider this as a bug and not just as an incompatibility due to the unexpected behavior of invoking implicit setters.

        Attachments

          Activity

            People

            • Assignee:
              michael1 Michael Offner
              Reporter:
              AKwaschny Alexander Kwaschny
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: