Test Server: SuiteCRM 7.10.6, MySQL 5.5.59, CentOS 6.9
My Local Computer: SuiteCRM 7.10.6, MySQL 5.6.38, macOS Sierra 10.12.3, Google Chrome V66
TLDR; Checked Permissions, did a Quick Repair and Rebuild, site_url, host_name are all correct, custom view won’t load.
I have created my own view in Opportunities called ‘PreSaleCheck’.
You can view the code here in this post:
Custom View Missing Form Data
This works perfectly fine on my local copy running MAMP. However, when I pull the files down from GitHub into our testing environment, and attempt to access this new view, I just get a blank screen. There are no PHP errors other than some irrelevant notices and deprecation warnings.
I turned on Debugging in SuiteCRM and did a Quick Repair and Rebuild, this did not fix the issue and upon inspection of the logs I noticed this error:
[FATAL] ERROR: rmdir_recursive(): argument is not a file or a dir when referring to cache/themes/SuiteP/modules
I read the link above and made sure permissions and ownership were correct, to be clear, they are exactly what they’ve always been.
I then repeated clearing the cache on local copy and observed that when I accessed this custom view, a file was created in cache/themes/SuiteP/modules/Opportunities/PreSaleCheck.tpl
This same file was not being created in the test environment.
I went back to my view.preSaleCheck.php file and attempted to do something simple in the display() function such as "echo ‘test’; " and got no output. I decided that this was likely because the view wasn’t being accessed. Upon further investigation I discovered this error in the SuiteCRM Logs:
Tue Jun 12 18:25:10 2018 [13191][-none-][DEBUG] Unable to find SugarController:: preCheck
and further down in the logs:
Tue Jun 12 18:25:10 2018 [13191][1][DEBUG] Performing action: action_precheck MODULE: Opportunities
I looked and found that this error comes from include/MVC/Controller/SugarController.php on line 302
/**
* Allows action to be pass XSS protection check provide that the action exists in the SugarController
*
* @param string $action
*/
protected function allowAction($action)
{
if ($this->hasFunction($this->getActionMethodName())) {
$GLOBALS['sugar_config']['http_referer']['actions'][] = $action;
} else {
$GLOBALS['log']->debug("Unable to find SugarController:: $action");
}
}
Any help? I can’t figure out whats wrong.