I am writing some code for an online contest. I used Formit for the form - then added a customHook to load the 'contest' package.
It ran fine on my development server but failed on the staging and production servers.
The code to add the package is:
$basePath = MODX_BASE_PATH . 'core/components/contests/';
$this->config = array_merge(array(
'basePath' => $basePath,
'corePath' => $basePath,
'modelPath' => $basePath.'model/',
'processorsPath' => $basePath.'processors/',
'templatesPath' => $basePath.'templates/',
'chunksPath' => $basePath.'elements/chunks/',
),$config);
$p = $this->modx->addPackage('contests',$this->config['modelPath']);
The problem was with "$this->config['modelPath']". Instead of being ending with "/core/components/contests/model/" it ended with "/core/components/formit/model/". None of the other paths had that problem.
I fixed it by forcing the change with:
$config['modelPath'] = MODX_BASE_PATH . 'core/components/contests/model/';
The staging and production sites are hosted on Blue Host. I suspect it has something to do with configuration - but have no idea what.