Ticket #305 (new defect)

Opened 2 years ago

Last modified 8 weeks 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 Download (4.6 KB) - added by otupman 2 years ago.

Change History

Changed 2 years ago by otupman

Changed 8 weeks ago by DanWilson

  • milestone set to 2.0.x-next-patch

Changed 8 weeks 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

Add/Change #305 (Name/Alias Bug in scaffold view.xsl)

Author


E-mail address and user name can be saved in the Preferences.


Action
as new
 
Note: See TracTickets for help on using tickets.