Can't Edit Fields in Modules in 8.3

Hello. I’m using Linux Mint 21.1
SuiteCRM 8.3
php8.0


When I go to edit Fields in Modules I can’t save them.
For Example

Admin - Developer Tools - Studio - Contact - Fields

First Name
Help Text: I added First Name of Contact
After hitting save it’s done but when I clicked on it again the help text is blank.
Also sometimes when I click on save it goes to another field, such as Last Name


Error Report

php:warn] [pid 31732] [client 127.0.0.1:57524] PHP Warning: Undefined array key “editLabelsMb” in /var/www/html/suitecrm/public/legacy/cache/smarty/templates_c/%%8B^8B3^8B3EDACC%%fields.tpl.php on line 10, referer: http://localhost/suitecrm/public/legacy/index.php?type=studio&module=ModuleBuilder&action=index


What else should I do.

Try deleting all the contents of the above directory, it will get recreated as you visit the screens.

You might have a left-over error from an earlier problem with PHP version or something else.

Also you can try a few more repairs from Admin / Repairs.

Hello, that sounds like a permissions issue.
Could you please verify that the permissions of the files corresponding to the dropdowns you are selecting are correct?

Hello

@pgr Hello I deleted all of them and is still giving me the same problem. Also ran repairs. This is a fresh install of SuiteCRM 8.3

@fcsd Hello

I used according to the instructions

sudo su
cd /var/www/html/suitecrm

find . -type d -not -perm 2755 -exec chmod 2755 {} ;
find . -type f -not -perm 0644 -exec chmod 0644 {} ;
find . ! -user www-data -exec chown www-data:www-data {} ;
chmod +x bin/console

Okay, I was mainly commenting because I had a similar issue with dropdown menus in a previous instance of SuiteCRM 7. I would select one option, but when I saved it, it would automatically change to another option or jump to another field. We also had the permissions set according to the documentation, but something seemed to be causing a change in the permissions of the dropdown menus that gave me trouble.

I would recommend, if you have the possibility, to navigate to the directory of the module you are trying to modify in the Studio:

custom/modules/module
custom/modules/module/Ext

and verify that the folders and files inside (this is to check if I’m not mistaken, the vardefs file, which is the file that stores the definitions of the dropdown fields and their values) have the correct permissions.

When you make a modification in the Studio, for example, if you enable “mass update” for a field, it modifies the file and writes a line of code that would be something like $dictionary[‘module’][‘fields’][‘field’][‘massupdate’] = 1.

Sometimes, if it doesn’t have the correct permission, it won’t let you overwrite those files or it will delete them when repairing. So, without specifically telling you what the error is, I would look into that.

Hello I checked a couple of the files. Are these settings correct?

drwxrwsr-x 8 www-data www-data 4096 Jul 9 16:03 /var/www/html/suitecrm/public/legacy/custom/

drwxrwsr-x 15 www-data www-data 4096 Jul 8 17:33 /var/www/html/suitecrm/public/legacy/custom/modules/

drwxrwxr-x 4 www-data www-data 4096 Jul 9 15:35 /var/www/html/suitecrm/public/legacy/custom/modules/Contacts/

@cornutaurus are you sure your web server is running under user www-data?

1 Like

Yes, I think that these are not the permissions that suitecrm recommends (I understand that this is full permission on the files and directories) but it would be ok…
You should check, as @pgr says, if your web server is running with the user www-data. Once that has been checked, if it turns out to be okay, it would be helpful if you send, apart from the permissions of the directories, that of the files themselves. To see if there is something wrong

Please let me know if what I put is right. I don’t know exactly how to check.

Input

apachectl -S

Output

*:80 is a NameVirtualHost
default server 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost localhost/suitecrm (/etc/apache2/sites-enabled/suitecrm.conf:1)
ServerRoot: “/etc/apache2”
Main DocumentRoot: “/var/www/html”
Main ErrorLog: “/var/log/apache2/error.log”
Mutex default: dir=“/var/run/apache2/” mechanism=default
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
PidFile: “/var/run/apache2/apache2.pid”
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name=“www-data” id=33 not_used
Group: name=“www-data” id=33 not_used


Input

ps aux | egrep --color ‘([a|A]pache|[h|H]ttpd)’

Output

www-data 4255 0.0 0.0 3736 160 ? Ss 22:26 0:00 /usr/bin/htcacheclean -d 120 -p /var/cache/apache2/mod_cache_disk -l 300M -n
root 79553 0.0 0.2 233676 34340 ? Ss 23:03 0:00 /usr/sbin/apache2 -k start
www-data 79554 0.0 0.3 235072 63324 ? S 23:03 0:00 /usr/sbin/apache2 -k start
www-data 79555 0.1 0.4 236172 78464 ? S 23:03 0:01 /usr/sbin/apache2 -k start
www-data 79556 0.0 0.3 235188 65016 ? S 23:03 0:00 /usr/sbin/apache2 -k start
www-data 79557 0.0 0.3 234964 61996 ? S 23:03 0:00 /usr/sbin/apache2 -k start
www-data 79558 0.0 0.3 235092 58908 ? S 23:03 0:00 /usr/sbin/apache2 -k start
www-data 79563 0.1 0.4 235456 74452 ? S 23:03 0:01 /usr/sbin/apache2 -k start
www-data 79652 0.0 0.3 234948 59916 ? S 23:04 0:00 /usr/sbin/apache2 -k start
www-data 80518 0.1 0.2 234672 40100 ? S 23:11 0:00 /usr/sbin/apache2 -k start


I even did this but it still not working

sudo chown www-data:www-data -R /var/www/html/suitecrm/

It looks like you have the correct user and that this is not a problem with ownerships/permissions.

If you have SELinux active, you might need some tweaking there.

Other than that, I don’t know, you could be hitting a bug, maybe try it with PHP 7.4 at least temporarily to see if it makes a difference.

Ok thank you.

I tried 7.4 but it’s still giving me the same problem. I’ll try a fresh install.

where are the logs for this problem? Suitecrm.log and php error log(s). They are very helpful.

Hello these are the error.log. I had to remove ~E_NOTICE and ~E_WARNING from error_reporting to get these errors

[Sun Jul 16 18:48:10.195157 2023] [php:warn] [pid 90637] [client 127.0.0.1:59970] PHP Warning: Undefined array key “editLabelsMb” in /var/www/html/suitecrm/public/legacy/cache/smarty/templates_c/%%8B^8B3^8B3EDACC%%fields.tpl.php on line 10, referer: http://localhost/suitecrm/public/legacy/index.php?type=studio&module=ModuleBuilder&action=index

[Sun Jul 16 18:48:10.288626 2023] [php:warn] [pid 90637] [client 127.0.0.1:59970] PHP Warning: Undefined array key “editLabelsMb” in /var/www/html/suitecrm/public/legacy/cache/smarty/templates_c/%%8B^8B3^8B3EDACC%%fields.tpl.php on line 10, referer: http://localhost/suitecrm/public/legacy/index.php?type=studio&module=ModuleBuilder&action=index

The issue with saving field changes in SuiteCRM’s Studio module on a Linux Mint 21.1 system running SuiteCRM 8.3 with PHP 8.0 is caused by an array key issue with the template file. To resolve this issue, clear your browser cache, verify file permissions, check PHP error logs, and disable PHP opcache. If these steps don’t resolve the problem, consider downgrading to PHP 8.0 or seeking assistance from the SuiteCRM community forums or support ticket. If these steps don’t work, consider downgrading to PHP 8.0 or seeking assistance from the SuiteCRM team. Best of luck with your resolution.

Hello,
I tried php8.0 and still not working.

I noticed one thing.

When i tried to edit the Comment Text it gives me error immediately, and doesn’t save.

When trying to put something in Help Text it saves the first time. However, when I opened it again and hit save again, it’d be blank after saving.

When there is error it always the problems with these lines

Line 32, Line 52, and line 80

Line 32

<?php echo $this->_tpl_vars['preSave']; ?>

Line 52

<?php if (! $this->_tpl_vars['no_duplicate']): ?>

Line 80

<?php echo '\' onclick=\'ModuleBuilder.tabPanel.get("activeTab").close()\'>

Could it be the no_duplicate thing??