Grails
  1. Grails
  2. GRAILS-6825

After filter return a null model when rendering templates

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.3.5
    • Fix Version/s: 2.1.2, 2.2-RC1
    • Component/s: View technologies
    • Labels:
      None
    • Environment:
      WIndows 7

      Description

      The model attribute of the after filter is set to null when a render template is called instead of returning a model.

      In the attached sample project, I have a filter that simply prints out the result:

      after = { model ->
           println model
      }
      

      When I do a standard view render, it returns a correct model.

      def good = {
           [ test: 'test' ] 
      }
      

      call http://localhost:8080/filterBroken/broken/good

      Output: [test:test]

      However, when I call a template render, it returns null instead of the expected [test:test] model.

      def bad = {
           render( template:'/bad', model:[ test:'test' ] )
      }
      

      call http://localhost:8080/filterBroken/broken/bad

      Output: null
      Expected: [test:test]

        Activity

        Hide
        Dan Lynn added a comment -

        This affects version 1.3.4 as well.

        Show
        Dan Lynn added a comment - This affects version 1.3.4 as well.
        Hide
        Eugenio Lattanzio added a comment -

        It's a mayor issue for me, Can anybody provide a workaround for this?

        Show
        Eugenio Lattanzio added a comment - It's a mayor issue for me, Can anybody provide a workaround for this?

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Tomas Lin
          • Votes:
            7 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Last Reviewed:

              Development