Skip to content

Conversation

@codeconsole
Copy link
Contributor

@codeconsole codeconsole commented Nov 18, 2025

When

grails:
      scaffolding:
          enableNamespaceViewDefaults: true 

is enabled, namespace scaffold templates will take priority over non-namespace views.

For Example:

@Scaffold(RestfulServiceController<Event>)
class EventController {
    static namespace = 'admin'
}

@Scaffold(RestfulServiceController<Event>)
class EventController {
}
grails-app/
    views/
        event/
            index.gsp
src/main/templates/scaffolding/admin/
    index.gsp

The current behavior is /admin/event/index resolves grails-app/views/event/index.gsp

With this fix, when enableNamespaceViewDefaults is enabled, /admin/event/index will resolve src/main/templates/scaffolding/admin/index.gsp if grails-app/views/admin/event/index.gsp does not exist.

@jdaugherty
Copy link
Contributor

Let's add tests & documentation to merge this.

@jamesfredley jamesfredley moved this to In Progress in Apache Grails Nov 19, 2025
@jamesfredley jamesfredley added this to the grails:7.1.0 milestone Nov 19, 2025
@jdaugherty
Copy link
Contributor

@codeconsole I assume this is ready to merge? @matrei once you approve, I think we can merge.

@codeconsole codeconsole force-pushed the 7.1.x-namespace-view-defaults branch from 71e0317 to 76b58e5 Compare November 20, 2025 06:56
@matrei
Copy link
Contributor

matrei commented Nov 20, 2025

The current behavior is /admin/person/index resolves grails-app/views/event/index.gsp

Is this supposed to say:
The current behavior is /admin/event/index resolves grails-app/views/event/index.gsp

@codeconsole
Copy link
Contributor Author

Is this supposed to say: The current behavior is /admin/event/index resolves grails-app/views/event/index.gsp

@matrei yes, updated

@jdaugherty jdaugherty merged commit 7f5908d into apache:7.1.x Nov 21, 2025
71 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache Grails Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants