In the process of upgrading from Codeigniter 2.2 to 3.1 we renamed all of the models. Now they are not loading unless I remake them with another name.
Looking at numerous other articles common issues are failing to load the model or typos in the names. I am not seeing either of these to be the case. There are several models who all have this issue, but a fix I found which is not ideal is making a new model with a new name. The first example is a model called PrpmsModel I can take everything in this file and make a new model called FooModel.php and just change the class name in the file to also be FooModel and then when I load it and make a call it works.
<?php
/**
* PRPMS - Model
**/
if (! defined('BASEPATH'))
exit('No direct script access allowed');
class PrpmsModel extends MY_Model
{
I took out the tail end but just to see top definition.
$this->load->model('PrpmsModel');
$employee = $this->PrpmsModel->fetchPRPMSbyEmployeeId(1, 1);
This does not work above.
<?php
/**
* Foo - Model
**/
if (! defined('BASEPATH'))
exit('No direct script access allowed');
class FooModel extends MY_Model
{
Copied all of PrpmsModel.php into FooModel.php
$this->load->model('FooModel');
$employee = $this->FooModel->fetchPRPMSbyEmployeeId(1, 1);
This above does work. The model used to be prpmsModel, so I just changed the case. The file name was also changed to match the PrpmsModel casing.