Development

#1192 (Wrong view.yml config being used after setTemplate())

You must first sign up to be able to contribute.

Ticket #1192 (reopened defect)

Opened 6 years ago

Last modified 1 year ago

Wrong view.yml config being used after setTemplate()

Reported by: msquire Assigned to:
Priority: major Milestone: 1.0.0
Component: view Version: 1.4.13
Keywords: Cc:
Qualification: Unreviewed

Description

It would appear that if you use setTemplate() in an action it is still using the view configuration for the default template of that action. E.g. if in an action executeFoo(which would have a default template of fooSuccess) setTemplate() is used to change the template to 'bar' (to make the template barSuccess) the view.yml entries for fooSuccess are still being used to render barSuccess.

Change History

12/06/06 13:45:57 changed by fabien

  • milestone set to 1.0.0.

12/06/06 13:46:11 changed by fabien

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

(In [2932]) fixed wrong view.yml config being used after setTemplate() (closes #1192)

09/16/11 16:20:35 changed by derbouka

  • status changed from closed to reopened.
  • component set to view.
  • priority changed from minor to major.
  • version changed from 1.0.0-beta1 to 1.4.13.
  • qualification set to Unreviewed.
  • resolution deleted.

I believe that this still happens in version 1.4.13. I've this structure:

  • /apps/frontend/module/A
    • /actions/.. -> here I call setTemplate("CCC","B")
    • /config/
    • /templates
  • /apps/frontend/module/B
    • /actions/.. -> here I call setTemplate("CCC","B")
    • /config/view.yml -> here I've "CCC" specific configuration
    • /templates/CCCSuccess.class.php

When I call the "setTemplate("CCC","B")" from the module A it renders correctly the template "CCC" from the module "B" but it just ignores what's defined in the "B/config/view.yml" and uses the "default" configuration.

02/15/12 19:00:17 changed by glerendegui

Even stranger behaviour if you put the view.yml in the module A:

a) /apps/frontend/module/A/config/view.yml:

CCCSuccess:

javascripts: [ some_js.js ] -> ignored

b) /apps/frontend/module/A/config/view.yml:

default:

javascripts: [ some_js.js ] -> not ignored

02/15/12 19:24:34 changed by glerendegui

Some ultra-harcoded workaroud to fix my problem, not the original from derbouka, but that maybe can be usefull: Set the template with a relative path and without a module name: In A/actions/... setTemplate("../../B/templates/CCC") Then set harcoded config In A/view/config/view.yml ../../B/templates/CCCSuccess:

javascripts: [ some_js.js ]