Skip to content

Conversation

@dereuromark
Copy link
Member

Summary

  • Fix template path duplication when rendering plugin templates where templatePath equals name
  • Before: templates/Controller/Controller/custom_file.php
  • After: templates/Controller/custom_file.php
  • Restores conditional check from CakePHP 5.2

Fixes #19180

When rendering a template from a plugin controller using the syntax
`$this->render('PluginName.Controller/custom_file')`, the framework was
generating an incorrect path with a duplicated controller directory.

Before fix: `templates/Controller/Controller/custom_file.php`
After fix: `templates/Controller/custom_file.php`

This restores the conditional check from CakePHP 5.2 that prevented the
unwanted path concatenation when working with plugin templates where
templatePath equals name.

Fixes #19180
@dereuromark dereuromark added this to the 5.3.1 milestone Jan 14, 2026
@dereuromark dereuromark merged commit 4ec1e8a into 5.x Jan 14, 2026
15 checks passed
@dereuromark dereuromark deleted the fix-19180-plugin-template-path-duplication branch January 14, 2026 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Template path resolution error when rendering plugin controller templates in CakePHP 5.3

3 participants