SuiteCrm 8: problems with customizations

Hello everyone,
I recently switched from version 7.12 to version 8.2 and found some problems. The customizations I had are no longer working:

  • js in editview are not executed
  • views (view.detail, view.edit) are not executed

Unfortunately, the documentation for version 8 is still under development and I can’t find any info on the forum.
I’m asking if the way to execute customizations like the ones above has changed, because for example, I’ve tried to have a simple “Hello” printed to the screen, but it’s like that file is ignored.
Of course, the custom forms are correctly placed in

public/legacy/custom/modules.

Can you give me any info? Thanks

2 Likes

The new UI is completely different and none of the previous ways of customizing will work.

The new ones are pretty much undocumented, although there is something about this in the Docs, and there is the generic Angular knowledge that will surely be helpful.

Your quickest way to get back to a safe point is to turn off the new UI on the specific modules you’ve customized - this should make v7 stuff work again. Search these forums for how-tos, it’s been discussed often. Here’s one example:

@pgr

Are modifications in config/services/module/module_routing.yaml upgrade-safe?

I tried to execute the instructions in the link:
I edited module_routing.yaml and added at the end

<MODULE_CUSTOM>:
      index: true
      list: true
      record: true

I did Q&R, but nothing changed

@blqt

check the thread I linked above, a couple of posts later Ashley explains how to make it upgrade-safe :ok_hand:

@fab that other solution should work for your custom module, as documented by @samus-aran on Option 2.

  • create a file called extensions/<my-ext>/config/module_routing.php
<?php

use Symfony\Component\DependencyInjection\Container;

if (!isset($container)) {
    return;
}

/** @var Container $container */
$routes= $container->getParameter('legacy.module_routing') ?? [];

$routes['test_MyModule'] = [
    'index' => false,
    'list' => false,
    'record' => false
];

$container->setParameter('legacy.module_routing', $routes);

Don’t forget QR&R and clear cache

I also tried following the second method, but nothing changes, maybe I’m doing something wrong, but I followed the instructions, created folders and files

extensions/myext/config/module_routing.php

entering the given instructions, deleted the contents of suitecrm8/cache and did a Q&R, nothing, it doesn’t work

Try logging something in the code to check if it’s running.

(or the naughty way - provoke a FATAL and try to break PHP - if it’s a test server, of course)

I inserted a
GLOBAL['log']->fatal('Hello');
both in my custom code and in module_routing.php, but it never runs

What about php_errors.log, does it say anything during QR&R?

I am only responding now because I do not have access to folders other than the project and had to retrieve the PHP log.
There are no errors reported inside, the only thing I see, from firefox page analysis, is that it does not find the file

public/legacy/cache/jsLanguage/en_us.js?v=W_OuJ5JYKqaJ50RzJRt1UA

But it is present, so I don’t think that is the problem.
It’s driving me crazy. Unfortunately, if SuiteCRM 8 does not allow me to use the customizations made up to version 7.12, the new version becomes useless to me and I will have to stop at 7.12.

This is trickier than you would think. Here’s my personal instructions to activate legacy mode on a module. It does work…

go to:

config/services/module/module_routing.yaml

then repair→rebuild in admin ./bin/console cache:clear from cli

First of all, if you want it to use the legacy module set it to “false”, it seems counterintuitive as it’s called “legacy module routing” you’d expect it to be the opposite.

ALSO… all the module names in the file are in lower case ie: “accounts” when they are actually “Accounts” in SuiteCRM, so if you have a custom module, you’d expect it to be lower case. You’d be wrong. I have “PLNE_Planes” module and you have to enter it exactly as it is in SuiteCRM custom modules folder.

ALSO… do not “tab” in the file to line up the columns, will not work. Space bar only.

2 Likes

Yes, I also followed these instructions, but nothing changes, it still doesn’t work

hmm… did you repair and rebuild an flush the cache from cli after you made the changes to the yaml file? That’s an important step. Also, it’s VERY tricky, you can only use spaces, no TAB. and make sure the formatting is perfect. I remember trying like 5-6 times to get it right.

I did not access the cli folder, but as instructed I deleted the suitecrm/cache folder… I wrote the names of the custom modules in both lower and upper case, avoided using TAB… I followed all the steps, but it doesn’t work

so clearing cache from the cli - … I have access through cPanel / terminal… what would the commands look like from there to clear the cache? Otherwise there are a bunch of different cache folders so… hesitant there… I have:
root/.cache (contains esbuild, node, yarn)
root/public_html/cache (contains prod)
think I came across another one or so as well… so which do we delete everything out of to test this?

Like this…

You have to do a cache clear AND repair and rebuild

That command on cPanel → Terminal, doesn’t work… tried pathing to the console but it’s a file and doesn’t open… Suggestions?

Did you put “php” in front of it?

nope ha… that’d do it… thanks for the simple reminder!

1 Like