Error in suitecrm8: editviewdefs.php is missing

Hi everyone, I recently switched to suitecrm 8 and I wanted to import an important module, the import went well, but if I try to create a new record, the blank page appears, this message appears in suitecrm.log:

Error: File [modules/Home/metadata/editviewdefs.php] is missing. Unable to create because no corresponding HTML file was found.

in this location there is no “metadata” folder and therefore not even the “editviewdefs.php” file.

I checked in previous versions (suitecrm 7.12 and suitecrm 7.14) and it doesn’t exist here either, but there are no problems or errors here.

I noticed in the forum that this is an error that I’ve already encountered, but I still haven’t found a solution.

Can you help me please? It is important. Thank you

Hi,
As a workaround, what if you may create “metadata” folder and create editviewdefs.php file, and add the attached file in there. Otherwise it is to debug the system to find the cause of the error.

the code for the file


<?php
$module_name = 'Home';
$viewdefs[$module_name] =
  array(
    'EditView' =>
    array(
      'templateMeta' =>
      array(
        'maxColumns' => '2',
        'widths' =>
        array(
          0 =>
          array(
            'label' => '10',
            'field' => '30',
          ),
          1 =>
          array(
            'label' => '10',
            'field' => '30',
          ),
        ),
        'useTabs' => false,
        'tabDefs' =>
        array(
          'DEFAULT' =>
          array(
            'newTab' => false,
            'panelDefault' => 'expanded',
          ),
        ),
        'syncDetailEditViews' => false,
      ),
      'panels' =>
      array(
        'default' =>
        array(
          0 =>
          array(),
          1 =>
          array(),
        ),
      ),
    ),
  );;

Thanks a lot

Ok, I did as you suggested and now the error no longer appears, but the blank page appears.

No errors appear in suitecrm.log, in Chrome developer tools this message appears:

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)

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