Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing detail view of Email module throws exception: Exception in Controller: No module defined #537

Open
LoLei opened this issue Aug 26, 2024 · 6 comments
Labels
Area: Emails Issues & PRs related to all things regarding emails & email module Priority:Important Issues & PRs that are important; broken functions; errors; there are workarounds Severity: Major Significant impact/severe disruption Type: Bug Something isn't working

Comments

@LoLei
Copy link

LoLei commented Aug 26, 2024

Issue

I have this error when accessing an Email record:

Mon Aug 26 16:54:23 2024 [12690][1][FATAL] Exception handling in /var/www/crm/public/legacy/include/MVC/Controller/SugarController.php:397
Mon Aug 26 16:54:23 2024 [12690][1][FATAL] Exception in Controller: No module defined
Mon Aug 26 16:54:23 2024 [12690][1][FATAL] backtrace:
#0 /var/www/crm/public/legacy/include/portability/RouteConverter.php(120): RouteConverter->convert('', 'DetailView', '', Array)
#1 /var/www/crm/public/legacy/include/portability/RouteConverter.php(91): RouteConverter->convertUri('index.php?modul...')
#2 /var/www/crm/public/legacy/include/Smarty/plugins/function.convert_link.php(34): RouteConverter->generateUiLink('index.php?modul...')
#3 /var/www/crm/public/legacy/cache/smarty/templates_c/b58b1d5c6daa9ee2c39c4f35d132ca137ad81d21_0.file.EmailsDetailView.tpl.php(713): smarty_function_convert_link(Array, Object(Smarty_Internal_Template))
#4 /var/www/crm/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_66cc954b87fd34_89982787(Object(Smarty_Internal_Template))
#5 /var/www/crm/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#6 /var/www/crm/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#7 /var/www/crm/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render(false, 0)
#8 /var/www/crm/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, NULL, NULL, 0)
#9 /var/www/crm/public/legacy/include/Sugar_Smarty.php(150): Smarty_Internal_TemplateBase->fetch('cache/themes/ps...', NULL, NULL, NULL)
#10 /var/www/crm/public/legacy/include/TemplateHandler/TemplateHandler.php(362): Sugar_Smarty->fetch('cache/themes/ps...')
#11 /var/www/crm/public/legacy/include/EditView/EditView2.php(934): TemplateHandler->displayTemplate('Emails', 'EmailsDetailVie...', 'include/DetailV...', false, Array)
#12 /var/www/crm/public/legacy/modules/Emails/include/DetailView/EmailsDetailView.php(115): EditView->display(true, false)
#13 /var/www/crm/public/legacy/include/MVC/View/views/view.detail.php(81): EmailsDetailView->display()
#14 /var/www/crm/public/legacy/modules/Emails/views/view.detail.php(85): ViewDetail->display()
#15 /var/www/crm/public/legacy/include/MVC/View/SugarView.php(210): EmailsViewDetail->display()
#16 /var/www/crm/public/legacy/include/MVC/Controller/SugarController.php(432): SugarView->process()
#17 /var/www/crm/public/legacy/include/MVC/Controller/SugarController.php(363): SugarController->processView()
#18 /var/www/crm/public/legacy/include/MVC/SugarApplication.php(101): SugarController->execute()
#19 /var/www/crm/public/legacy/index.php(52): SugarApplication->execute()
#20 {main}

For some reason the URL query has the correct parameters in a previous call to the function, but then it's empty:

Mon Aug 26 16:54:23 2024 [12690][1][FATAL] RouteConverter::convertUri: index.php?module=Emails&action=DetailView&record=a5453b14-6bdf-3576-18eb-66c85a85c24c
Mon Aug 26 16:54:23 2024 [12690][1][FATAL] RouteConverter::convertUri: index.php?module=Emails&action=EditView&return_module=Emails&return_action=DetailView
Mon Aug 26 16:54:23 2024 [12690][1][FATAL] RouteConverter::convertUri: index.php?module=&action=DetailView&record=
Mon Aug 26 16:54:23 2024 [12690][1][FATAL] Exception handling in /var/www/crm/public/legacy/include/MVC/Controller/SugarController.php:397
Mon Aug 26 16:54:23 2024 [12690][1][FATAL] Exception in Controller: No module defined

See the three calls to convertUri.

This seems to be the incorrect one:

RouteConverter::convertUri: index.php?module=&action=DetailView&record=

The only "fix" I found so far was disabling the exception in RouteConverter.php::69:

    public function convert(?string $module, ?string $action, ?string $record, ?array $queryParams): string
    {
        if (empty($module)) {
            // throw new InvalidArgumentException('No module defined');
        }

This started happening after upgrading to SuiteCRM 8.6.2 (from 8.5.1).

Possible Fix

The only "fix" I found so far was disabling the exception in RouteConverter.php::69:

    public function convert(?string $module, ?string $action, ?string $record, ?array $queryParams): string
    {
        if (empty($module)) {
            // throw new InvalidArgumentException('No module defined');
        }

Steps to Reproduce the Issue

1. Upgrade SuiteCRM from 8.5.1 to 8.6.2.
2. Open the Email detail view, e.g. `/#/emails/record/a5453b14-6bdf-3576-18eb-66c85a85c24c`.
3. Observe a blank space in the UI where the usual detail view would be.
4. See the error logged in `suitecrm.log`.

Context

Version

8.6.2

What browser are you currently using?

Firefox

Browser Version

129.0.2

Environment Information

MariaDB, PHP 8.0.3

Operating System and Version

php:8.0-apache-buster

@LoLei LoLei added the Type: Bug Something isn't working label Aug 26, 2024
@LoLei
Copy link
Author

LoLei commented Aug 26, 2024

Sorry, I'm not downloading and executing this file without context. What's this for?

@salesagility salesagility deleted a comment Aug 26, 2024
@salesagility salesagility deleted a comment Aug 26, 2024
@pgorod
Copy link
Contributor

pgorod commented Aug 26, 2024

PHP 8.0 is not a supported version:
https://docs.suitecrm.com/8.x/admin/compatibility-matrix/

Please also delete the offending tpl file from under cache/themes, it will get recreated, but this will help figure out if it is a transient error or not.

@LoLei
Copy link
Author

LoLei commented Aug 27, 2024

I just increased the PHP version to 8.2 (php:8.2-apache-buster) and still get the same error:

Tue Aug 27 07:55:57 2024 [2436][1][FATAL] Exception handling in /var/www/crm/public/legacy/include/MVC/Controller/SugarController.php:397
Tue Aug 27 07:55:57 2024 [2436][1][FATAL] Exception in Controller: No module defined
Tue Aug 27 07:55:57 2024 [2436][1][FATAL] backtrace:
#0 /var/www/crm/public/legacy/include/portability/RouteConverter.php(124): RouteConverter->convert('', 'DetailView', '', Array)
#1 /var/www/crm/public/legacy/include/portability/RouteConverter.php(96): RouteConverter->convertUri('index.php?modul...')
#2 /var/www/crm/public/legacy/include/Smarty/plugins/function.convert_link.php(34): RouteConverter->generateUiLink('index.php?modul...')
#3 /var/www/crm/public/legacy/cache/smarty/templates_c/b58b1d5c6daa9ee2c39c4f35d132ca137ad81d21_0.file.EmailsDetailView.tpl.php(713): smarty_function_convert_link(Array, Object(Smarty_Internal_Template))
#4 /var/www/crm/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_66cd68203ca171_22485831(Object(Smarty_Internal_Template))
#5 /var/www/crm/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#6 /var/www/crm/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#7 /var/www/crm/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render(false, 0)
#8 /var/www/crm/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, NULL, NULL, 0)
#9 /var/www/crm/public/legacy/include/Sugar_Smarty.php(150): Smarty_Internal_TemplateBase->fetch('cache/themes/ps...', NULL, NULL, NULL)
#10 /var/www/crm/public/legacy/include/TemplateHandler/TemplateHandler.php(362): Sugar_Smarty->fetch('cache/themes/ps...')
#11 /var/www/crm/public/legacy/include/EditView/EditView2.php(929): TemplateHandler->displayTemplate('Emails', 'EmailsDetailVie...', 'include/DetailV...', false, Array)
#12 /var/www/crm/public/legacy/modules/Emails/include/DetailView/EmailsDetailView.php(115): EditView->display(true, false)
#13 /var/www/crm/public/legacy/include/MVC/View/views/view.detail.php(81): EmailsDetailView->display()
#14 /var/www/crm/public/legacy/modules/Emails/views/view.detail.php(85): ViewDetail->display()
#15 /var/www/crm/public/legacy/include/MVC/View/SugarView.php(210): EmailsViewDetail->display()
#16 /var/www/crm/public/legacy/include/MVC/Controller/SugarController.php(432): SugarView->process()
#17 /var/www/crm/public/legacy/include/MVC/Controller/SugarController.php(363): SugarController->processView()
#18 /var/www/crm/public/legacy/include/MVC/SugarApplication.php(101): SugarController->execute()
#19 /var/www/crm/public/legacy/index.php(52): SugarApplication->execute()
#20 {main}

I cleared the cache via bin/console cache:clear, however, the stack trace still includes this file. So not sure what else to do there...

@pgorod
Copy link
Contributor

pgorod commented Aug 27, 2024

You cleared the Symfony cache, but that's not the same thing as the Smarty cache of SuiteCRM.

I suggest clearing the entire cache/themes directory tree, if this is a development server (not production). Make sure you don't break ownerships and permissions there.

@johnM2401 johnM2401 added Area: Emails Issues & PRs related to all things regarding emails & email module Priority:Important Issues & PRs that are important; broken functions; errors; there are workarounds Severity: Major Significant impact/severe disruption labels Aug 30, 2024
@shubham-pawar
Copy link

If you're using linux bases OS:

  • Go to YourCRM/public/legacy/cache and delete themes folder

rm -R themes/

@jarred-aos
Copy link

I have also encountered this issue with a fresh install of v8.6.2 with php 8.2.

All of the emails are visible until they are imported, then the ability to view the email is replaced by the blank page as described in the original bug report. Unfortunately I am unable to generate a stack trace report for this error due to #543

I have followed the suggestions in this thread. So far the only one that works is the hacky workaround to comment out the error handler in the RouteConverter file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Emails Issues & PRs related to all things regarding emails & email module Priority:Important Issues & PRs that are important; broken functions; errors; there are workarounds Severity: Major Significant impact/severe disruption Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants