Prospects Detail View returns error

Hello all!!

We are getting some troubles when accessing the detail view of prospects. The ony customization in this entity was some fields which were created from studio.

SuiteCRM: 7.9.8
PHP: 7.1.7

Any errors in the logs (php_errors.log and suitecrm.log) , or in the browser’s developer console?

Hi pgr,

the only error I got in on browsers console: “Uncaught AjaxUI error parsing response”.

from the suitecrm.log, I could not find any error. buton the PHP log it shows

Stack trace:
[20-Mar-2018 Europe/] PHP 1. {main}() C:\inetpub\wwwroot\SuiteCRM-7.9.0\index.php:0
[20-Mar-2018 Europe/] PHP 2. SugarApplication->execute() C:\inetpub\wwwroot\SuiteCRM-7.9.0\index.php:52
[20-Mar-2018 Europe/] PHP 3. HomeController->execute() C:\inetpub\wwwroot\SuiteCRM-7.9.0\include\MVC\SugarApplication.php:105
[20-Mar-2018 Europe/] PHP 4. HomeController->processView() C:\inetpub\wwwroot\SuiteCRM-7.9.0\include\MVC\Controller\SugarController.php:375
[20-Mar-2018 Europe/] PHP 5. ViewAjaxUI->process() C:\inetpub\wwwroot\SuiteCRM-7.9.0\include\MVC\Controller\SugarController.php:432
[20-Mar-2018 Europe/] PHP 6. ViewAjaxUI->displayHeader($retModTabs = uninitialized) C:\inetpub\wwwroot\SuiteCRM-7.9.0\include\MVC\View\SugarView.php:191
[20-Mar-2018 Europe/] PHP Fatal error: Cannot declare class ViewDetail, because the name is already in use in C:\inetpub\wwwroot\SuiteCRM-7.9.0\include\MVC\View\views\view.detail.php on line 106

You can try turning off Ajax for that module, see if that fixes anything. Although I would prefer a solution where we actually understand why it’s failing.

Admin / System settings / Configure AJAX User Interface

I have edit my last reply with php logs.

if I disable the ajax, neither an error message is displayed. just a blank page.

Maybe after the Ajax disabled, the logs show anything different?

Anyway - I don’t think you copy-pasted your stack trace correctly - normally the error comes on top (that FATAL) and below comes the stack trace with the numbers of the function calls. So I don’t know what error was above those function calls you show, and I don’t know which function calls were below that FATAL :slight_smile:

That error with the class name would seem to be when instead of extending a class, you redefine it.

Well for the lines after the FATAL error here is the stack for it

Fatal error: Cannot declare class ViewDetail, because the name is already in use in C:\inetpub\wwwroot\SuiteCRM-7.9.0\include\MVC\View\views\view.detail.php on line 106
[28-Feb-2018 Europe/] PHP Stack trace:
[28-Feb-2018 Europe/] PHP 1. {main}() C:\inetpub\wwwroot\SuiteCRM-7.9.0\index.php:0
[28-Feb-2018 Europe/] PHP 2. SugarApplication->execute() C:\inetpub\wwwroot\SuiteCRM-7.9.0\index.php:52
[28-Feb-2018 Europe/] PHP 3. SugarController->execute() C:\inetpub\wwwroot\SuiteCRM-7.9.0\include\MVC\SugarApplication.php:105
[28-Feb-2018 Europe/] PHP 4. SugarController->processView() C:\inetpub\wwwroot\SuiteCRM-7.9.0\include\MVC\Controller\SugarController.php:375
[28-Feb-2018 Europe/] PHP 5. ViewFactory::loadView() C:\inetpub\wwwroot\SuiteCRM-7.9.0\include\MVC\Controller\SugarController.php:423
[28-Feb-2018 Europe/] PHP 6. ViewFactory::_buildFromFile() C:\inetpub\wwwroot\SuiteCRM-7.9.0\include\MVC\View\ViewFactory.php:98
[28-Feb-2018 Europe/] PHP 7. require_once() C:\inetpub\wwwroot\SuiteCRM-7.9.0\include\MVC\View\ViewFactory.php:224

Have you been changing any of these files? Or creating any view detail classes in custom? This is a conflict between two places in your code, but unfortunately we only know the location of one of these places…

We have not made any changes in those files, but in fact I have installed a new environment and in the this clean environment the error does not appear.

What makes me no sense is that this is the only detail view with this problem…

I have commented the following line in ‘modules/Prospects/views/view.detail.php’ and it starts to work again (but I do not know the consequences of it yet)

//require_once(‘include/MVC/View/views/view.detail.php’);

I think this is now the right solution yet.