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

Model instantiation skipped due to Linux file case sensitivity #643

Closed
chapmandu opened this Issue Jul 3, 2016 · 4 comments

Comments

2 participants
@chapmandu
Member

chapmandu commented Jul 3, 2016

Calling models/MyModel.cfc using foo = model("myModel") does not instantiate the model due to file case sensitivity.

It seems it must be called as foo = model("MyModel") to work as desired (model name must be referenced using exactly the same case as the model file name).

This issue only occurs on Linux, works as expected on Windows and OSX.

I would expect that I be able to call the model with any case and it be returned.

@chapmandu chapmandu added the bug label Jul 3, 2016

@chapmandu

This comment has been minimized.

Member

chapmandu commented Jul 16, 2016

Added a failing test for this issue 03cbca5

Oddly, the tests pass on OSX.

@chapmandu

This comment has been minimized.

Member

chapmandu commented Jul 18, 2016

The issue seems to be here..

https://github.com/cfwheels/cfwheels/blob/master/wheels/global/internal.cfm#L664

loc.file = $fileExistsNoCase(ExpandPath(loc.fullObjectPath & ".cfc"));

On Linux, ExpandPath(loc.fullObjectPath & ".cfc")) returns something like /Users/foo/cfwheels/wheels/foo/cfwheels/wheels/_assets/model/

Removing the ExpandPath() get the committed test above passing, but breaks about 40 other tests.

@chrisdpeters

This comment has been minimized.

Contributor

chrisdpeters commented Jul 18, 2016

See this comment:

One thing to be careful about expand path is, it doesn't work if the file or directory doesn't exist. It doesn't throw error, but it returns wrong path. So, something like this fileExits(expandPath('/mydir/myfile')) may or may not work.

chapmandu added a commit that referenced this issue Jul 19, 2016

chapmandu added a commit that referenced this issue Jul 19, 2016

chapmandu added a commit that referenced this issue Jul 19, 2016

@chapmandu chapmandu self-assigned this Jul 20, 2016

chapmandu added a commit that referenced this issue Jul 21, 2016

@chapmandu

This comment has been minimized.

Member

chapmandu commented Jul 21, 2016

Test package model.miscellaneous.$objectFileName still failing on Windows and ACF.. investigating..

http://zebrinny.viviotech.net/index.cfm?controller=wheels&action=wheels&view=tests&type=core&package=model.miscellaneous.$objectFileName

neokoenig added a commit that referenced this issue Jul 21, 2016

resolves issue #643 - maybe.
$objectFileName doesn't need expandPath() - CF10 "re-expands" it, lucee
doesn't. I think.

@chapmandu chapmandu closed this Jul 22, 2016

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