📣 We're Hiring!

You are not authorized to view this page. Please contact your system administrator

I’m the only user in this SuiteCRM instance. I’m the administrator (ony one user cannot be anything else).

I created a module.
Admin → Module Builder → New package
I created the Package and then the Module. Then I deployed it. Then quick repair and rebuild.
The module appears in top menu. When I cklick on it I get an error pop up: “You are not authorized to view this page. Please contact your system administrator.”

Error log says this:
13-Oct-2021 13:06:06 UTC] PHP Warning: Undefined array key “enctype” in /home/crm8/public_html/public/legacy/cache/smarty/templates_c/%%F4^F45^F45E7F3F%%EditView.tpl.php on line 24
[13-Oct-2021 13:06:06 UTC] PHP Warning: Undefined array key “return_id” in /home/crm8/public_html/public/legacy/cache/smarty/templates_c/%%F4^F45^F45E7F3F%%EditView.tpl.php on line 52
[13-Oct-2021 13:06:06 UTC] PHP Warning: Undefined array key “return_relationship” in /home/crm8/public_html/public/legacy/cache/smarty/templates_c/%%F4^F45^F45E7F3F%%EditView.tpl.php on line 57
[13-Oct-2021 13:06:06 UTC] PHP Warning: Undefined array key “relate_to” in /home/crm8/public_html/public/legacy/cache/smarty/templates_c/%%F4^F45^F45E7F3F%%EditView.tpl.php on line 58
[13-Oct-2021 13:06:06 UTC] PHP Warning: Undefined array key “return_id” in /home/crm8/public_html/public/legacy/cache/smarty/templates_c/%%F4^F45^F45E7F3F%%EditView.tpl.php on line 61
[13-Oct-2021 13:06:06 UTC] PHP Warning: Undefined array key “app_strings” in /home/crm8/public_html/public/legacy/cache/smarty/templates_c/%%F4^F45^F45E7F3F%%EditView.tpl.php on line 110
[13-Oct-2021 13:06:06 UTC] PHP Warning: Trying to access array offset on value of type null in /home/crm8/public_html/public/legacy/cache/smarty/templates_c/%%F4^F45^F45E7F3F%%EditView.tpl.php on line 110
[13-Oct-2021 13:06:06 UTC] PHP Warning: Undefined array key “default_value” in /home/crm8/public_html/public/legacy/cache/smarty/templates_c/%%F4^F45^F45E7F3F%%EditView.tpl.php on line 186
[13-Oct-2021 13:06:06 UTC] PHP Warning: Undefined array key “default_value” in /home/crm8/public_html/public/legacy/cache/smarty/templates_c/%%F4^F45^F45E7F3F%%EditView.tpl.php on line 625
[13-Oct-2021 13:06:06 UTC] PHP Warning: Undefined array key “default” in /home/crm8/public_html/public/legacy/cache/smarty/templates_c/%%F4^F45^F45E7F3F%%EditView.tpl.php on line 674
[13-Oct-2021 13:06:06 UTC] PHP Warning: Undefined array key “default_value” in /home/crm8/public_html/public/legacy/cache/smarty/templates_c/%%F4^F45^F45E7F3F%%EditView.tpl.php on line 754
[13-Oct-2021 13:06:06 UTC] PHP Warning: Undefined array key “TOGGLE_JS” in /home/crm8/public_html/public/legacy/cache/smarty/templates_c/%%F4^F45^F45E7F3F%%EditView.tpl.php on line 900

— environment —
PHP 8.0
MySQL 5.7.35
Apache 2.4.49
SuiteCRM 8.0.0-rc

I would really appreciate if somebody can help me solve this problem.

Thank you.

Hi @Cadej,

Thanks for your feedback and for trying on SuiteCRM 8 RC.

Could you try the following:

Create a file at public/legacy/custom/Extension/application/Ext/ModuleNameMap/my_module.php with the following contents please?

  • Replace MyModule by the name of your module, should be the “machine name” something like ABC_MyModule or similar.
  • Run a repair and rebuild
<?php

$module_name_map = $module_name_map ?? [];

$module_name_map['MyModule'] = [
    'frontend' => 'my-module',
    'core' => 'MyModule'
];

I’ve raised this internally, I think this is something we should look at.

I didn’t quite understand you. Here is what I did

A file
public/legacy/custom/Extension/application/Ext/Podrocja_delovanja/Podrocja_delovanja.php

Content:
<?php

$module_name_map = $module_name_map ?? [];

$module_name_map['Podrocja_delovanja'] = [
    'frontend' => 'Podrocja_delovanja',
    'core' => 'Podrocja_delovanja'
];

Sadly it doesn’t work.

Hi @Cadej,

Thanks for the feedback

This file, could you move it to the following location please?

public/legacy/custom/Extension/application/Ext/ModuleNameMap/Podrocja_delovanja.php

Also could you change the front end name to something like the following please?

delovanja, like so: 'frontend' => 'delovanja'

I did
public/legacy/custom/Extension/application/Ext/ModuleNameMap/Podrocja_delovanja.php

<?php

$module_name_map = $module_name_map ?? [];

$module_name_map['Podrocja_delovanja'] = [
    'frontend' => 'delovanja',
    'core' => 'Podrocja_delovanja'
];

It still doesn’t work.

Note: I don’t know if there should be a directory ModuleNameMap by default, I’m just informing you there were no directory ModuleNameMap, I had to create it.

The console reports:
VM6094 sugar_grp1_jquery.js:2 [Violation] 'load' handler took 169ms

Hi @Cadej,

Yes, thats correct, you need to create it.

Could you check if a file was generated on the following path please?
public/legacy/custom/application/Ext/ModuleNameMap/module_name_map.ext.php

Yes, it was.

<?php 
 //WARNING: The contents of this file are auto-generated

$module_name_map = $module_name_map ?? [];

$module_name_map['Podrocja_delovanja'] = [
    'frontend' => 'delovanja',
    'core' => 'Podrocja_delovanja'
];
?>

Hi @Cadej,

Thank you

Could you also send me a screen shot of the following please?

  • error on the browser
  • browser console log
  • browser network tab

Hi @Cadej,

I was able to replicate the issue on my side. I’ve applied the solution I told you and it worked ok.

Could you check if the case in the letters of your module name is correct?

if you go to public/legacy/custom/Extension/application/Ext/Include there should be a file with the name of your module.

In my case I added a MyModule module, with package prefix of test.

On public/legacy/custom/Extension/application/Ext/Include/MyModule.php I have

<?php 
 //WARNING: The contents of this file are auto-generated
$beanList['test_MyModule'] = 'test_MyModule';
$beanFiles['test_MyModule'] = 'modules/test_MyModule/test_MyModule.php';
$moduleList[] = 'test_MyModule';

?>

On the fix file public/legacy/custom/Extension/application/Ext/ModuleNameMap/my_module.php in have:

<?php

$module_name_map = $module_name_map ?? [];

$module_name_map['test_MyModule'] = [
    'frontend' => 'my-module',
    'core' => 'test_MyModule'
];

Then I had to do a repair and rebuild.

Another thing.

Are you able to load the homepage ok?

I’m not getting all those errors.

Could you check the following file please?

  • public/legacy/.htaccess

On RewriteBase you should have the following:

  1. If your vhost is pointing to public inside SuiteCRM 8 folder, RewriteBase should have /legacy

  2. If your are using a subfolder in the url like https://<yourdomain>/subfolder/public, thenRewriteBase should have /subfolder/public/legacy

Hi,
I was getting the authorization error yesterday.
I tried your workaround and it worked initially.
When I came back today and tried to access my custom module, i get a text error on a blank screen: Error: Module Staff does not exist.

My file PKG1_Staff.php, as per above, looks like this:

<?php

$module_name_map = $module_name_map ?? [];

$module_name_map['PKG1_Staff'] = [
    'frontend' => 'Staff',
    'core' => 'PKG1_Staff'
];

?>

Any suggestions?

Thanks,
Arthur

Hi @art,

Thanks for trying out SuiteCRM 8.

Could you try with the following, please?

$module_name_map['PKG1_Staff'] = [
    'frontend' => 'PKG1_Staff',
    'core' => 'PKG1_Staff'
]

HI @clemente.raposo ,

With all 3 being ‘PKG1_Staff’ i get the original error - not authorized to view page.

Arthur

Hi @clemente.raposo,

Also, the file is in the Include directory and looks like yours.
The name of the file is the full package name PACKAGE1.php not the key PKG1.php.

My custom package is PACKAGE1 with key PKG1
My custom module in this package is Staff.

So, I am a bit confused with when I should use PACKAGE1, PKG1_Staff or just Staff.
For filenames and statements within files.

Arthur

Hi @clemente.raposo,

Any thoughts on this issue?
Not being able to create and use a custom module is a significant blocker.

Update:
I was able to get this to work, but not sure why.
Above, you say to look for public/legacy/custom/Extension/application/Ext/Include/MyModule.php
For me, that file was not named MyModule.php but was the full package name.
That is, expected was Staff.php but the file name was PACKAGE1.php.
I created a link: ln -s PACKAGE1.php Staff.php and i was able to see the module.
Not sure how long this workaround will last.
So, some things are not working properly and need to be addressed before the next release.

Regards,
Arthur