The Modules structure is:
--modules
--correspondence
--ec
--controllers
--models
--modules
--faults
--resources
--(...)
--dailyRegistry <-- module in question
--controllers
--DefaultController.php
--models
--DailyRegistry.php
--views
--(...)
--DailyRegistry.php <-- end of module in question
--views
EcModule.php
--<other modules>
-- ...
In my config->main.php:
'import'=>array(
'application.models.*',
'application.models.backend.*',
'application.components.*',
'application.modules.files.*',
'application.modules.ec.*', <-- included the main "top-level" module
'application.modules.rh.*',
'(...)
),
In my EcModule.php:
public function init()
{
$this->setImport(array(
'ec.models.*',
'ec.components.*',
));
$this->setModules(array('faults', 'resources', (...), 'dailyRegistry')); <-- included here the dailyRegistry submodule
}
In my DailyRegistryModule.php:
public function init()
{
$this->setImport(array(
'dailyRegistry.models.*',
'dailyRegistry.components.*',
'application.modules.ec.modules.gestaoPDA.models.*' <-- another model I had to use a certain time in an action inside the default controller but i believe the conflict is not here
));
}
Sorry for the long post.
Now for the action in question:
public function actionSearch(){
if(isset($_POST["yt0"])){ //if a search is performed
// ini_set for PHP Excel here
// (...)
include 'PHPExcel.php';
include 'PHPExcel/Writer/Excel2007.php';
$objPHPExcel = new PHPExcel();
$objWorkSheet = $objPHPExcel->getActiveSheet()->setTitle('Team Records');
//for this examples sake, the $from and $to will be:
$from = $_POST["from"]." 00:00:00";
$to = $_POST["to"]." 23:59:59";
$records = DailyRegistry::model()->findAll('from > :from AND to < :to)', array(":from" => $from, ":to" => $to));
//crashes here
//however, if I put
$r_teste = DailyRegistry::model()->find();
$records = DailyRegistry::model()->findAll('from > :from AND to < :to)', array(":from" => $from, ":to" => $to));
//No crash!
//But later on inside a foreach
$record->team->name; //<-- crashes here as well
//however, if I put
$team_test = Team::model()->find();
$record->team->name; //<-- no crash
//------------------
(...)
}
(...)
}
It seems it is not loading any models at all, but only in this action. In the other DefaultControllers actions there was no issue.
I really didn’t want to leave the “$dummy_test_model = Model::model()->find();” in there and I presume updating the framework won’t resolve the issue either 
Regards
(any typos found in model names are probably due to translating to english for posting here)