When I first committed my models for a Codeigniter application, they were named as such 'Plan_m.php' and loaded like so '$this-load-model('plan_m', 'plan');'.
This was a mistake, so I renamed the models to 'plan_m.php' and did not change how they were loaded, yet I'm still getting errors of 'unable to locate model plan_m'.
Oh, my class definition is 'Plan_m', which is correct.
My only thought is that PB hasn't picked up or changed the filenames when I renamed them? Any other thoughts?
Depending on your local operating system, it’s very possible that Git didn’t recognize the change to the file because it was only a case change to the file name. A workaround may be to rename the file to something that will change the characters used in the file name, commit, then change it back.
Plan_m.php → Plan_m-temp.php → plan_m.php
You were almost onto the answer there. Renaming them, committing them and then renaming them back doesn't work, presumably because Git still has the file names with the incorrect case in its structure and just assumes it's the same file and merges them.
I've had to rename all of my models to something different and stick with it, which is incredibly annoying since it was a just a simple case mismatch. Seems very dumb to me.
Thanks for your help.
Maybe after doing the temporary rename, you can remove the old file from Git with something like:
$ git rm —cached Plan_m.php
That way it won’t have the old file to merge the new one with.
This question is closed to new answers.