Renderer is causing coldbox RestHandler to render convention view
Description
Issue: The handler extends coldbox.system.RestHandler. In a service there is a Renderer.renderLayout() call for an email. That email call looks like this newMail().setHtml( Renderer.renderLayout(layout="x", view="y") ).send() from cbmailservices. The email goes out just fine. The next thing that should happen should be handler action exiting and returning a json response. But as you’ll see in the stacktrace coldbox is now attempting to go through the normal flow of including the convention view. In this example repo, the endpoint is /user/password/request/create which calls the handler action auth:createPasswordChangeRequest and so the error is “Could not find the included template //views/auth/createPasswordChangeRequest.cfm"
NOTE: If my handler extends a custom rest handler, something I’ve been using since colbox 4.0, then the email is sent and the request flows correctly without error.
NOTE: If in my service I do not use Renderer.renderLayout() and instead pass in a string to the .setHtml() method, then the email is sent and the request flows correctly without error.
Test: The issue is reproduceable with this repo: The instructions to reproduce the issue are so simple and they are include in the README.md.
I remember you reproted this. I thought we had fixed it
Daniel MejiaMay 12, 2022 at 6:41 PM
This is what my code looks like now
Daniel MejiaMay 12, 2022 at 6:40 PM
Edited
ok I used newMail().setView( layout="x", view="y" ).send() and still got the same error - the exact same error message. “Page /views/auth/createPasswordChangeRequest.cfm [C:\Development\playground\webmandman-renderer-issue-demo\views\auth\createPasswordChangeRequest.cfm] not found”
Fixed
Pinned fields
Click on the next to a field label to start pinning.
Issue:
The handler extends
coldbox.system.RestHandler
. In a service there is aRenderer.renderLayout()
call for an email. That email call looks like thisnewMail().setHtml( Renderer.renderLayout(layout="x", view="y") ).send()
fromcbmailservices
. The email goes out just fine. The next thing that should happen should be handler action exiting and returning a json response. But as you’ll see in the stacktrace coldbox is now attempting to go through the normal flow of including the convention view. In this example repo, the endpoint is/user/password/request/create
which calls the handler actionauth:createPasswordChangeRequest
and so the error is “Could not find the included template //views/auth/createPasswordChangeRequest.cfm"NOTE: If my handler extends a custom rest handler, something I’ve been using since colbox 4.0, then the email is sent and the request flows correctly without error.
NOTE: If in my service I do not use Renderer.renderLayout() and instead pass in a string to the .setHtml() method, then the email is sent and the request flows correctly without error.
Test:
The issue is reproduceable with this repo: The instructions to reproduce the issue are so simple and they are include in the README.md.