Make implicit views case sensitive by default

Description

Under Linux when handlers and view folders use case sensitive names (e.g. someFolder), the route is being lowercase'd when trying to load the view (e.g. somefolder). While this works fine under Windows as it is case insensitive, under Linux (which is case sensitive) however it throws a MissingInclude error that it cannot locate the view (see attached for an example).

Activity

Show:
Denard Springle
March 14, 2018, 5:42 PM
Edited

Didn't see this comment come though in email either. Odd. Anyway, yes... I am talking about implicit views.

If I have a controller named attendeeTypes and request (appadmin.)attendeeTypes.index ala buildLink() then I get the error shown in my original report (and currently visible here: http://coldbox-mp.mpeventapps.com/appadmin/attendeeTypes/index)

This is still an issue after having grabbed the latest ColdBox code directly from GitHub (development branch) and applying it to my codebase. ColdBox continues to look for the implicit view at //views/attendeetypes/index.cfm (note the extra slash in the error msg as well - not sure if that's also relevant) instead of (/appadmin)/views/attendeeTypes/index.cfm. Note that this view is in the 'appadmin' module under modules_app/appadmin/views on my system.

Note that this worked fine in earlier versions of ColdBox, just not in 5.0.0 (or whatever I have now that I grabbed the code from GitHub directly since CommandBox was failing to do so for me)

Denard Springle
March 14, 2018, 8:00 PM
Edited

Ok, So I rooted around in the ColdBox code and I have this issue figured out as well.

It seems CB 5.0.0 added a new setting `caseSensitiveImplicitViews` with a default of false at `Renderer.cfc` line 809, but there was no subsequent setting defined in ColdBox.cfc configuration. Not sure if that is now explicitly defined in ColdBox.cfc (was using the advanced script template, btw), but it wasn't when I started with the older @be code I ended up with. In either case, adding `caseSensitiveImplicitViews = true` to ColdBox.cfc config solved the problem.

I'd advise setting the default on line 809 to `true` instead of `false`... since Windows isn't case sensitive and Linux is, the default of false will always fail under Linux (unless Linux is configured otherwise, which is not typical).

So, I guess you can close this one too

Denard Springle
March 14, 2018, 8:30 PM

Also, as a quick update... `caseSensitiveImplicitViews` is not outlined in either:

https://coldbox.ortusbooks.com/content/full/introduction/upgrading-to-coldbox-5.html OR
https://coldbox.ortusbooks.com/content/full/introduction/whats-new-with-500.html

Might want to mention it there JIC others run into this issue?

Denard Springle
March 14, 2018, 8:38 PM

Added comments, forgot to @ you.

Assignee

Luis Majano

Reporter

Denard Springle

Labels

Components

Fix versions

Affects versions

Priority

Major
Configure