Error in suitecrm8: editviewdefs.php is missing

I suspect your custom module has some custom code trying a redirect, and this redirect is failing because it is for v7, and not aware of the changes in v8. You must update it.

Check php_errors.log, it should have helpful messages there - and if you can get a stack trace, you will easily reach the problematic file.

the module in question is known on the forum (advanced report) created by a forum user.

Yes, it was not created for suitecrm8, I was hoping that it would work anyway or that maybe I could modify it to make it work, but I canā€™t even understand where the error is.

There are no errors in PHP

If you can get a stack trace, I can help you further. But if not, sorryā€¦

Hereā€™s a part, itā€™s a bit long:

polyfills.b06f30c758be4076.js:1 [Violation] 'load' handler took 281ms
dist_core_fesm2022_core_mjs-_06691.c6086bcd8c2d6fb0.js:59 
        
        
       GET localhost/suitecrm8/public/legacy/index.php?return_module=Home&return_action=DetailView&module=Home&action=EditView 500 (Internal Server Error)
initIframe @ dist_core_fesm2022_core_mjs-_06691.c6086bcd8c2d6fb0.js:59
ngAfterViewInit @ dist_core_fesm2022_core_mjs-_06691.c6086bcd8c2d6fb0.js:59
ru @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
dv @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
ou @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
zo @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
Ff @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
jf @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
Vf @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
Ff @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
jf @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
lE @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
Hf @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
Ff @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
Sr @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
detectChanges @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
tick @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
(anonime) @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
invoke @ polyfills.b06f30c758be4076.js:1
onInvoke @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
invoke @ polyfills.b06f30c758be4076.js:1
run @ polyfills.b06f30c758be4076.js:1
run @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
next @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
next @ node_modules_rxjs_dist_esm_operators_index_js.db6b2403458907d9.js:1
_next @ node_modules_rxjs_dist_esm_operators_index_js.db6b2403458907d9.js:1
next @ node_modules_rxjs_dist_esm_operators_index_js.db6b2403458907d9.js:1
(anonime) @ node_modules_rxjs_dist_esm_operators_index_js.db6b2403458907d9.js:1
_ @ node_modules_rxjs_dist_esm_operators_index_js.db6b2403458907d9.js:1
next @ node_modules_rxjs_dist_esm_operators_index_js.db6b2403458907d9.js:1
emit @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
xl @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
onHasTask @ node_modules_angular_core_fesm2022_core_mjs.3e1a513b7cb4915e.js:1
hasTask @ polyfills.b06f30c758be4076.js:1
_updateTaskCount @ polyfills.b06f30c758be4076.js:1
_updateTaskCount @ polyfills.b06f30c758be4076.js:1
runTask @ polyfills.b06f30c758be4076.js:1
w @ polyfills.b06f30c758be4076.js:1
invokeTask @ polyfills.b06f30c758be4076.js:1
N @ polyfills.b06f30c758be4076.js:1
B @ polyfills.b06f30c758be4076.js:1
H @ polyfills.b06f30c758be4076.js:1
load (asinc)
n @ polyfills.b06f30c758be4076.js:1
scheduleTask @ polyfills.b06f30c758be4076.js:1
onScheduleTask @ polyfills.b06f30c758be4076.js:1
scheduleTask @ polyfills.b06f30c758be4076.js:1
scheduleTask @ polyfills.b06f30c758be4076.js:1
scheduleEventTask @ polyfills.b06f30c758be4076.js:1
(anonime) @ polyfills.b06f30c758be4076.js:1

...

Thatā€™s a JS trace on the front-end, I meant a PHP trace on the back-end ( 500 (Internal Server Error))

This is the PHP log:

[Mon Mar 11 15:10:35.786960 2024] [lsapi:warn] [pid 2608521:tid 22862032799488] [client 95.230.109.30:57782] [host pntest.biz] Backend log: PHP Deprecated:  Return type of Symfony\\Component\\HttpFoundation\\Session\\Session::count() should either be compatible with Countable::count(): int, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /public_html/suitecrm8/vendor/symfony/http-foundation/Session/Session.php on line 141\n, referer: localhost://suitecrm8/public/index.php
[Mon Mar 11 15:10:35.786952 2024] [lsapi:warn] [host localhost] Backend log: PHP Deprecated:  Return type of Symfony\\Component\\HttpFoundation\\Session\\Session::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /public_html/suitecrm8/vendor/symfony/http-foundation/Session/Session.php on line 131\n, referer: localhost://suitecrm8/public/index.php

Deprecated messages are not errors, they are messages for the developers of the future.

If you have a 500 error, most often there will be a PHP FATAL error in the back-end. If you can get that one, and get a stack trace for it, then we can determine where it is being called from.

But maybe you canā€™t get it, if itā€™s not there, or you donā€™t know how to.

yes, I know, thatā€™s why I said there was nothing in the PHP log.

The only errors that appear are those of suitecrm.log and those of chrome, I donā€™t know where to get the others

I suggest that you remove the new metadata file you created, and get back to your original error; it might be easier to find good feedback in the logs.

ok, done, deleted the metadata folder and did a Q&A. Now the original error is back:

Mon Mar 11 16:44:26 2024 [2808256][1][FATAL] Error: File [modules/Home/metadata/editviewdefs.php] is missing. Unable to create because no corresponding HTML file was found.
Mon Mar 11 16:44:26 2024 [2808256][1][FATAL] Exception handling in /suitecrm8/public/legacy/include/MVC/Controller/SugarController.php:397
Mon Mar 11 16:44:26 2024 [2808256][1][FATAL] Exception in Controller: Error: File [modules/Home/metadata/editviewdefs.php] is missing. Unable to create because no corresponding HTML file was found.

and in PHP the same warnings I posted above

Ok, so now please add these to your public/legacy/config_override.php and provoke the error again:

$sugar_config['stackTrace'] = true;
$sugar_config['stack_trace_errors'] = true;

adding those two lines, I canā€™t access the site:

Oops! An Error Occurred

The server returned a ā€œ500 Internal Server Errorā€.

Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.

I noticed one thing, on the link that should create the record (in the top menu), the path points to:

#/home/edit?return_module=Home&return_action=DetailView

while the link should be:

?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3Dadrep_report%26action%3DEditView%26return_module%3Dadrep_report%26return_action%3DDetailView

I tried to look for where the path is set, but I canā€™t find it, do you know where it is contained?

Youā€™re mixing v8-style URLs with v7. The add-on is probably doing a redirect somewhere with the old style, but that wonā€™t work with v8. It needs to be fixed in the PHP code, but that will require someone who can use a debugger and understand the code. Have you tried reaching ou to the add-on author?

Yes, I contacted him, but he no longer deals with suites and cannot help me. I realize that this is a component created for version 7, but Iā€™m trying to modify it to make it work with 8, the starting point is the creation and understanding at least where this redirection is done, for this I need help. Version 7 I know how it worked, but suitecrm8 is a little different and I still donā€™t know how it works.

Have you searched the code of the add-on for that redirect?

Yes, but I canā€™t find anything, I think the address is somehow reconstructed

Search for the word header, thatā€™s the PHP command to send a raw header redirecting the browser.

I wish this PR would be merged and I would stop wasting my time going in circles trying to get people to figure out how to get a simple stack trace

This is my biggest frustration with the SuiteCRM project (and I have several ongoing frustrations with itā€¦ sigh)

1 Like

I added, as suggested, the instructions in config_override, but other than the warnings about the deprecated ones, there are no errors.

However I understood part of the problem, I managed to enable the creation of the record by modifying the moduleā€™s Menu file.

The problem is this statement:

$record = $_REQUEST['record'];
$module = $_REQUEST['module'];
if(ACLController::checkAccess("$module", 'edit', true))
$module_menu[]=Array("index.php?module=$module&action=EditView&return_module=$module&return_action=DetailView", $mod_strings['LNK_NEW_RECORD' ],"Create$module", "$module");

if ($_REQUEST['action'] == 'DetailView')
$module_menu[]=Array("index.php?module=$module&action=RunReport&record=$record&return_module=$module&return_action=DetailView&return_record=$record", $mod_strings['LNK_RUN_REPORT'],$module, $module);

the $_REQUEST statement contains these entries:

     [action] => LogView
     [module] => Configurator
     [doaction] => all
     [filter] =>

so both module and record are missing, as for $module I replaced it with the module name, but I canā€™t recover the record ID. Maybe the $_REQUEST statement has changed in suitecrm8, I tried to use $_SESSION, but I canā€™t recover it either.