Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Overriding Plugin Templates from Inside Your Application" does not work #5338

Closed
ravage84 opened this issue Oct 25, 2017 · 7 comments
Closed

Comments

@ravage84
Copy link
Member

The feature "Overriding Plugin Templates from Inside Your Application" documented at: https://book.cakephp.org/3.0/en/plugins.html#overriding-plugin-templates-from-inside-your-application does not work, because the theme/plugin search paths are always the first two.

The tests say so too:
https://github.com/cakephp/cakephp/blob/3.5.4/tests/TestCase/View/ViewTest.php#L516-L521

$themePath . 'src' . DS . 'Template' . DS . 'Plugin' . DS . 'TestPlugin' . DS,
$themePath . 'src' . DS . 'Template' . DS,
TEST_APP . 'TestApp' . DS . 'Template' . DS . 'Plugin' . DS . 'TestPlugin' . DS,
$pluginPath . 'src' . DS . 'Template' . DS,
TEST_APP . 'TestApp' . DS . 'Template' . DS,
CAKE . 'Template' . DS,

Could be related:
cakephp/cakephp#4064
cakephp/cakephp#11198
cakephp/cakephp#11210

There is another, related feature that does not work, which I already documented in #5337.

@markstory
Copy link
Member

Theme paths are always before the app/plugin paths. In your path snippet, the application overrides are the 3rd path checked (after the active theme). The docs are still correct, your scenario also has a theme which the application cannot override.

@ravage84
Copy link
Member Author

I see.. So I guess the documentation doesn't make it clear enough what the distinction between a "normal" plugin and a theme is and what the implications are.

@ivanamat
Copy link

ivanamat commented Apr 5, 2018

Hi all,

When iinstall AclManager plugin vía Composer it doesn't work as described in the manual. To override virews must override without vendor, then it works.

The version of CakePHP is 3.5. Is the documentation really good or is there something I have not understood?

Regards!

@markstory
Copy link
Member

The documentation should be how the code is working. @ivanamat could you open an issue in cakephp/cakephp for this?

@ivanamat
Copy link

ivanamat commented Apr 7, 2018

Hi @markstory, The issue has been created.

Regards!

@markstory
Copy link
Member

Thanks!

markstory added a commit that referenced this issue Apr 22, 2018
@othercorey
Copy link
Member

Is this ok now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants