Ticket #32 (closed defect: fixed)

Opened 2 years ago

Last modified 1 month ago

Multi Column Join Error (includes fix to join.cfc)

Reported by: m.lesko@… Owned by: dhughes
Type: defect Priority: normal
Milestone: Component: Reactor - Object Oriented Queries
Version: 1.0 Severity: normal
Keywords: JOIN Cc:

Description

Happens when doing a join between two tables involving more than one column. The "ON" returned as part of the join is included more than once, when it should only be there one time.

Fix to lines 29-33 of join.cfc:

<!--- add the ON --->
<cfset join = join & " ON ">
<cfloop from="1" to="#ArrayLen(relationship.relate)#" index="x">


<!--- <cfset join = join & " ON " & arguments.Convention.formatFieldName(FromObject.getObjectMetadata().getField(relationship.relate[x].from).name, arguments.FromObject.getAlias()) /> --->
<cfset join = join & arguments.Convention.formatFieldName(FromObject.getObjectMetadata().getField(relationship.relate[x].from).name, arguments.FromObject.getAlias()) />
<cfset join = join & " = " & arguments.Convention.formatFieldName(Object.getObjectMetadata().getField(relationship.relate[x].to).name, getObject().getAlias()) />


<!--- if we're related by more than one column then add an and and repeat! --->
<cfif x IS NOT ArrayLen(relationship.relate)>

<cfset join = join & " AND " />

</cfif>

</cfloop>

Change History

Changed 2 years ago by dhughes

  • milestone set to Beta

Changed 2 years ago by bbowden

  • status changed from new to closed
  • resolution set to fixed

Changed 1 month ago by anonymous

  • milestone deleted

Milestone Beta deleted

Note: See TracTickets for help on using tickets.