Ticket #305 (new defect)

Opened 18 years ago

Last modified 16 years ago

Name/Alias Bug in scaffold view.xsl

Reported by: otupman Owned by: somebody
Priority: normal Milestone: 2.0.x-next-patch
Version: 2.0.304 Severity: normal
Keywords: Cc:

Description

I believe there to be a bug in the view.xsl for scaffolding. If I have the following Reactor XML:

<object name="project">
	<hasOne name="customer">
		<relate to="id" from="customerId"/>
	</hasOne>
</object>

The customer object has a name field. When attempting to view the project object, an exception is thrown that the method 'getName()' cannot be found on 'targetObject'.

Looking into the view.xsl code it appears that the view.xsl script assigns the project record's customerId value via getCustomerID() rather than accessing the getCustomer() method:

&lt;cfset targetObject = <xsl:value-of select="/object/alias"/>
Record.get<xsl:value-of select="name"/>() /&gt;

I believe that it should read

&lt;cfset targetObject = <xsl:value-of select="/object/alias"/>
Record.get<xsl:value-of select="alias"/>() /&gt;

Where the value used is alias rather than name (alias will refer, I think, to the object's name in the ORM rather than table or field name). Note that the line above is in a block of four, all of which reference name rather than alias and all would need changing.

The view.xsl file also seems to output an extra closing div tag, which completely mucks up my div-based site :D

I've attached my modified view.xsl file that works.

Attachments

view.xsl (4.6 kB) - added by otupman 18 years ago.

Change History

Changed 18 years ago by otupman

Changed 16 years ago by DanWilson

  • milestone set to 2.0.x-next-patch

Changed 16 years ago by boomfish

  • severity changed from blocker to normal
  • summary changed from Bug in scaffold view.xsl to Name/Alias Bug in scaffold view.xsl
Note: See TracTickets for help on using tickets.