-
Notifications
You must be signed in to change notification settings - Fork 140
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
unhandledPaths not working inside sub folder #510
Comments
See comment on slack thread. https://cfml.slack.com/archives/C06TA3B3L/p1567550207059800 |
If the issue ends up being resolved in that Slack thread, we should be sure to include the relevant comments here, for posterity. |
@mjclemente Yes. I am doing some commandBox tests today with a sub directory FW1 installation. I will post my results. |
@sneiland @mjclemente Based on the CommandBox tests I did today, the details of which I have added to the original submission, and from comments made on Slack, both myself and @tonyjunkes, believe that this issue is a bug. |
Just to note here, following similar steps to what @charlesr1971 documented here, I was able to reproduce the scenario. I started dissecting FW/1's process up to attempting to either ignore the request or move on to rendering a view but haven't discovered anything substantial to back up how this is occurring. One thing I noticed is I was unable to trigger a dump/abort of the variables/framework settings within FW/1's onRequestStart method when hitting the unhandled path in the browser. It seems like it moves right to onRequest and attempts to draw a view/layout. Completely ignoring the check for an unhandled path. If I find anything more useful, I'll post back. |
@tonyjunkes It seems that the unhandledPath value is formatted by framework/one.cfc, using the method:
Into:
But never gets to the next method:
So, somewhere, between these 2 steps, an error gets thrown. Looking at the error trace, it seems like FW1 attempts to build a new view path, completely ignoring the value of the:
It maybe that the view path calculation is made before:
Is executed, and then depending on the Boolean that is returned, from the above method, the view path is then either deleted or followed.
Tomorrow, I may try and explicitly set the:
And, see, if this helps to guide the regex path parsing engine. This may provide a temporary workaround. |
Changing the:
Did not make any difference. I still get the error. |
In the end, I had to place an Application.cfc in the includes directory, which is a real pain in the backside. I then had to create an include of all the content of my parent Application.cfc's setupRequest function and then I added this include to both the parent and child Application.cfc request method. This is very janky, so I really hope someone might be able to fix this bug. Thank you for everyone's help on this issue. |
I was able to spend some time this week attempting to replicate this issue using the folder structures described here, however I have not been able to replicate the issue when supplying the expected folder paths. Please review the test case at "https://github.com/framework-one/fw1/tree/issue/510/tests/issue510" and let me know what additional steps are needed to recreate the issue. Note that the directory "issue510" is the webroot for the supplied command box files to run this for adobe cf 11. box start [email protected] |
I came back to this and was able to recreate the issue again. This time I think I narrowed it down. At the start of the event chain, It looks like a viable solution is to add a check in I have this as a working fix locally, and I am just verifying if I can put together a test case to help get some coverage on this issue. All existing tests pass which is a good sign. When I get a chance I will commit to my repo and file a PR for review. Cheers. |
Thanks for looking into that further tony, I'll keep an eye out for that PR. |
I have a PR ready to be submitted for review but could not for the life of me get a test case to correctly reproduce the issue. Not sure if it's me, or it just can't easily be triggered programmatically without being more of an "integration" approach. I've personally found replicating life cycle events to be tricky. I can however reproduce with an actual application structure much like how you have set up in branch So I can either commit the code as is with existing tests passing or, also commit a small condensed app structure in the How would you like me to proceed? Cheers! |
Can you commit the condensed app to the test directory please. |
Environment:
When I use the following inside Application.cfc:
I have also tried:
And I try and access the following template directly:
I get the following error. Please see screenshot below:
And here is my directory structure:
My Application.cfc & framework directory are in:
Some of my colleagues think the problem may be caused by the fact that the FW1 framework is located in a subdirectory of the webroot.
Update 04.09.19
I have added a CommandBox Installation of FW1 in a sub directory:
For some reason, the framework folder did not get installed, so I installed it manually:
My Appilcation.cfc
I have then added the following directory & file:
I have then tried to access:
And I get the following message:
On further investigation, when I removed the
Method of the Application.cfc
I now get the original error back:
The text was updated successfully, but these errors were encountered: