Ticket #359 (closed defect: worksforme)

Opened 16 years ago

Last modified 15 years ago

Event-Type override takes defaultType

Reported by: calvinhobbs@… Owned by:
Priority: high Milestone: 3.0
Version: 3.0.178 Severity: major
Keywords: event-type defaultType Cc:

Description

I am new to MG - but am trying to get the event-type syntax straight. What I'm doing seems pretty simple, but the results are not as expected. For simplicity, I have the event-type simply doing 'footer' content for me - as defined as such (defining 2 footer pages - both with value of 'footer'):

<event-types>

<event-type name="templatedPage">

<before>

<views>

<include template="pages/footer.cfm" name="footer"/>

</views>

</before>

</event-type>

<event-type name="templatedPage2">

<before>

<views>

<include template="pages/footer2.cfm" name="footer"/>

</views>

</before>

</event-type>

</event-types>

The below I have an even-handler defined with a defaultType of the first templatedPage (footer)

<event-handlers defaultType="templatedPage">

That works well to get my 'results' template to be populated with the footer variable which I can output as such:

<cfoutput>#viewCollection.getView("body")#</cfoutput>

However, overriding a specific event-handler is NOT displaying the second footer as in:

<event-handler name="page.index" type="templatedPage2"><!-- HERE I AM OVERRIDING THE DEFAULT TYPE -->

<broadcasts /> <results>

<result do="template.main" />

</results> <views>

<include name="body" template="pages/index.cfm" />

</views>

</event-handler>

Instead of the text in my footer being 'This is the Footer2' which is the content in pages/footer2.cfm I get the content from footer.cfm 'This is the Footer'. (I have started/stopped service, reload, init=true etc.)

Also, If i override the event-type on the event-hander as in : <event-handler name="page.index" type=""> (per the event-type documentation) it will also show the 'templatedPage' event-type footer content (instead of what I would expect to be NOTHING populated for the footer variable).

This is from a brand new download of 'ModelGlue?_3.0.final.178.zip' from the site - and am running a prior 3.0 version on another project and am seeing some inconsistencies there as well.

Attachments

newApplicationDirectory.7z (6.3 kB) - added by calvinhobbs@… 16 years ago.
Entire MG directory with event-type definitions and footer files for review.

Change History

Changed 16 years ago by calvinhobbs@…

Entire MG directory with event-type definitions and footer files for review.

follow-up: ↓ 2   Changed 16 years ago by kpenny@…

Please ignore / delete - this looks like its an implementation problem on my end - "The problem here is that you have template.main in the same block and its getting a default event of templatedPage applied to it. If you follow the logic through its clear why this won't work.."

in reply to: ↑ 1   Changed 16 years ago by cfgrok

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

Replying to kpenny@…:

Please ignore / delete - this looks like its an implementation problem on my end - "The problem here is that you have template.main in the same block and its getting a default event of templatedPage applied to it. If you follow the logic through its clear why this won't work.."

This comment correctly indicates the source of the problem, so I'm closing this ticket.

Note: See TracTickets for help on using tickets.