Can't Rename Modules

Hello. I hope your day is going well. I just wanted to reach out, because I am having an issue with renaming modules.

Issue

Renaming modules seems to be broken

Expected Behavior

Renaming a module should change the modules name via the label functionality.

Actual Behavior

A white screen is shown and a no error logged.

Steps to Reproduce

  1. Open Admin
  2. Got to “Rename Modules”
  3. Attempt to switch the name of any core module
  4. See the error

Context

Attempting to rename a module is no longer possible.

Your Environment

Are there any work-arounds or patches that I can install?

Any help you could provide would be greatly appreciated.

Thank you in advance!

Hello Stacey,
Welcome to SuiteCRM Community. It could be an issue of file permission. Do verify file permission are correct or not. Here is general documentation for the same.

If still doesn’t work do check your Apache and PHP error log for the reason.

Thank you so much for pointing me in the right direction. I have changed the permissions as needed for the daemon user (default for the vm instance); however, the issue remains. The apache error log file is giving the following errors when I click on the option to rename modules:

PHP Warning: Undefined array key “moduleList” in /bitnami/suitecrm/cache/smarty/templates_c/%%F60^F609237E%%_headerModuleList.tpl.php on line 28PHP

PHP Warning: Undefined array key “Administration” in /bitnami/suitecrm/cache/smarty/templates_c/%%F60^F609237E%%_headerModuleList.tpl.php on line 72PHP

PHP Warning: Undefined array key “Administration” in /bitnami/suitecrm/cache/smarty/templates_c/%%F60^F609237E%%_headerModuleList.tpl.php on line 215PHP

PHP Warning: Undefined array key “LBL_SEARCH_BUTTON” in /bitnami/suitecrm/cache/smarty/templates_c/%%F60^F609237E%%_headerModuleList.tpl.php on line 662PHP

PHP Fatal Error: Uncaught Error: Non-static method StudioParser::buildImageButtons() cannot be called statically in /bitnami/suitecrm/modules/Studio/wizards/RenameModules.php:339\nStack trace:\n#0 /bitnami suitecrm/modules/Studio/wizards/RenameModules.php(284): RenameModules->display()\n#1 /bitnami/suitecrm/modules/Studio/wizards/StudioWizard.php(94): RenameModules->process()\n#2 /bitnami/suitecrm/modules/Studio/wizards/StudioWizard.php(64): StudioWizard->process()\n#3 /bitnami/suitecrm/include/MVC/View/SugarView.php()823): include_once(’…’)\n#4 /bitnami/suitecrm/include/MVC/View/views/view.classic.php(72): SugarView->includeClassicFile()\n#5 /bitnami/suitecrm/include/MVC/View/SugarView.php(210): ViewClassic->display()\n#6 /bitnami/suitecrm/include/MVC/Controller/SugarController.php(432): SugarView->process()\n#7 /bitnami/suitecrm/include/MVC/Controller/SugarController.php(363): SugarController->processView()\n#8 /bitnami/suitecrm/include/MVC/SugarApplication.php(101): SugarController->execute()\n#9 /bitnami/suitec…’, referer: http://192.168.0.25/index.php?module=Administration&action=index

Do you know what might be causing that, or if there might be a fix for it?

Thanks so much for your time.

Hello @Stacey, do you know which is the PHP version your virtual machine has on?

Hello there. It looks like it is:

PHP 8.0.17 (cli) (built: Apr 4 2022 20:18:00) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.17, Copyright (c) Zend Technologies
with Zend OPcache v8.0.17, Copyright (c), by Zend Technologies

Are you able to launch these commands on the shell:

to set default permissions on files and folders

sudo chmod -R 755 .

sudo chmod -R 775 cache custom modules themes data upload config_override.php

?
Does it help?

Yes, thank you very much. I have already run the above commands and the permissions are all correct in/for the suitecrm directory.

Is there anything else that might possibly be causing the issue? Are there any other special permission settings that should be in place on any other files/folders? Attached is a snippet in case they it is helpful:

Thank you so much for your time.

I’ve also rebooted/restarted services after making changes (in case that info is helpful)

Could you please check if daemon is in the Apache user group?

Thank you for the information. No, the daemon user does not appear to have been assigned to the Apache user group. That has just been updated, and the server/services have been rebooted. Please see screenshot for review:

However, I am still receiving the same error messages in the apache log file, and the same blank screen loads after selecting the option to change module names (or make other changes).

Just to test, I changed the permissions to the suitecrm directory to the www-data user and group, with daemon still assigned to that group. However, the same errors exist.

You did it right. That was next thing i’d do.
What happens if you delete the .htaccess file? You can rebuild it from the Admin page > Repair > Rebuild .htaccess File
What happens if you empty the cache folder? Not the folder itself, just what it’s inside.

Can you please try a small change in the code?

In this line here:

SuiteCRM/StudioParser.php at master · salesagility/SuiteCRM · GitHub

Add the word static in there, so it becomes:

public static function buildImageButtons($buttons, $horizontal=true)

this should solve the FATAL error in your log, and hopefully won’t break anything else. I have no idea if it will affect your original issue, but it’s worth a try.

Thank you so much for the very helpful information. That worked to get me past the first blank screen, and I was able to access the page which allows for those modules to be renamed. However, I then started receiving another Fatal error after saving the changes. This new error was similar and said the following:

PHP Fatal error: Uncaught Error: Non-static method DropDownHelper::saveDropDown() cannot be called statically in /bitnami/suitecrm/modules/Studio/wizards/RenameModules.php…

Using the same (very helpful) solution you provided for the first one, I was able to make the same change for this method by locating which config file it was in, and then adding “static” to that line of code. In case someone else comes across the same issue, I used grep to locate that config file as follows:

grep -i -r “public function saveDropDown” /bitnami/suitecrm/

Then I updated “public function saveDropDown…” to “public static function saveDropDown…”

I don’t see any other Fatal errors at the moment, so I hope it stays that way. I really appreciate your assistance with this. That was incredibly helpful.

1 Like

Fore future reference, here is the Issue on Github:

Hi!
I have the same problem, I was researching and came across this
No worked for me this

Did you make the extra changes suggested by @Stacey above?

1 Like

I only changed the static in the function

well… I noticed something very important to keep in mind:
in version 7.10.32, this works fine!
in version 7.10.36, it’s broken!
in version 7.11.20, this works fine too!

So what I did was:
copy the file modules\Studio\DropDowns\DropDownHelper.php
from version 7.11 to version 7.10.36
and this fixed the problem