BUG SuiteCRM 8.5.0 out of the box Symfony framework conflicts to composer.json setup

Can it be, there is a gap between thee out of the box delivered Fymfony framework inside “vendor” and the corresponding composer.json file. If I wathc the composer.lock file, I can’t find the corresponding upgrade for Symfony 5.4.. However, this given Symfony framework is version 5.4., yet it is restricted to 5…2* inside composer.json!

If you use composer update “yes | composer update”, you can see all those downgrades of the installed Symfony version. Using potential composer.json extensions I would rate this as a critical bug, since it could destroy your whole application, if you trust the SuiteCRM 8.5.0 out of the box bundle

If you try to modify the module routing and add an overwrite to module_routing.php, Symfony will run into a critical error due to data type conflicts. So far I edited the composer.json and fixed first type errors within core/backend.

Please let me know, in case my finding makes no sense at all =)

Hi, welcome to the Community! :tada:

There’s some information about the Symfony versions here

Maybe that back-and-forth, cancelling the upgrade to 5.4, was what caused the discrepancy you’re seeing.

But all I see is 5.2, where exactly are you seeing 5.4? You haven’t by any chance run a composer upgrade instead of update?

Well that background story sounds somehow suitable…I did run composer update. If you do so, you should see those downgrading messages by the given vendor folder. Actually I face that issue by using the extension section for module-routing throwing data-type error for function param “ContainerBuilder”

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\DependencyInjection\ContainerBuilder;

return static function (ContainerBuilder $container): void {
    $moduleRouting = $container->getParameter('legacy.module_routing') ?? [];
    $moduleRouting['opportunities'] = [
        'index' => true, // true => suite 8 view
        'list' => true,
        'record' => false, // false => suite 7 view
    ];
    $container->setParameter('legacy.module_routing', $moduleRouting);
};

If you install Symfony 5.2 and compare the relevant files, where the error is casted, you will see the difference. My screenshot illustrates left side Symfony 5.4 PHPFileLoader.php (located inside your 8.5.0 package) vs. downgraded Symfony 5.2 PHPFileLoader.php on the right side. There are also many other differences, but that specific one gave me a lot of headaches…

php bin/console cache:clear
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Symfony\Component\DependencyInjection\Loader\ProtectedPhpFileLoader::Symfony\Component\DependencyInjection\Loader\Configurator\{closure}() must be an instance of Symfony\Component\DependencyInjection\ContainerBuilder, instance of Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator given, called in /home/rsteinig/projects/xxx_crm_8_5_0/vendor/symfony/dependency-injection/Loader/PhpFileLoader.php on line 50 and defined in /home/rsteinig/xxx/xxx_crm_8_5_0/extensions/defaultExt/config/services/module/module_routing.php:15

I mentioned your case to a friend in SalesAgility. This is unexpected and strange but I hope somebody will find a minute to look into it.

@rogersteinig did you ever get this working? I think I understand this better now than I did in February, so tell me if you need further help.

Well I fixed it on my own by modifying the composer.json. Instead of

“symfony/stopwatch”: “5.2.",
“symfony/web-profiler-bundle”: "5.2.
”

I use

“symfony/stopwatch”: “5.4.",
“symfony/web-profiler-bundle”: "5.4.
”

This resolves my local cli errors, even though I did a composer update

1 Like