Suitecrm 7.14.2 php-function "key" as a modifier is deprecated

I have been helping a client upgrade his Windows 10 suitecrm server from version 7.11.5 to 7.14.2. Everything went well till I upgraded from 7.13.4 with PHP 8.0.30 to 7.14.2, PHP 8.0.30.

I got a warning -
Deprecated: Using php-function “key” as a modifier is deprecated and will be removed in a future release. Use Smarty::registerPlugin to explicitly register a custom modifier. in C:\xampp8-0-30-CRM-7-14\htdocs\suitecrm\vendor\smarty\smarty\libs\sysplugins\smarty_internal_compile_private_modifier.php on line 114

Everything appears to be working fine except if a user searches for a contact and then clicks on the ‘edit’ icon to make changes to the contact’s details. Then, the user is returned to the XAMPP dashboard with no errors on screen or in the suitecrm error log. However, the following is logged in the PHP error log-

[04-Feb-2024 10:19:07 Europe/Berlin] PHP Warning: sugar_file_put_contents_atomic() : fatal rename failure ‘C:\xampp8-0-30-CRM-7-14\htdocs\suitecrm\cache\modules\Employees\temFA78.tmp’ → ‘cache/modules/Employees/Employeevardefs.php’ in C:\xampp8-0-30-CRM-7-14\htdocs\suitecrm\include\utils\sugar_file_utils.php on line 232
[04-Feb-2024 10:20:14 Europe/Berlin] PHP Warning: sugar_file_put_contents_atomic() : fatal rename failure ‘C:\xampp8-0-30-CRM-7-14\htdocs\suitecrm\cache\modules\Employees\tem21D.tmp’ → ‘cache/modules/Employees/Employeevardefs.php’ in C:\xampp8-0-30-CRM-7-14\htdocs\suitecrm\include\utils\sugar_file_utils.php on line 232
[04-Feb-2024 10:20:14 Europe/Berlin] PHP Warning: sugar_file_put_contents_atomic() : fatal rename failure ‘C:\xampp8-0-30-CRM-7-14\htdocs\suitecrm\cache\modules\Users\tem24E.tmp’ → ‘cache/modules/Users/Uservardefs.php’ in C:\xampp8-0-30-CRM-7-14\htdocs\suitecrm\include\utils\sugar_file_utils.php on line 232

I am not a developer and I’m not sure where to start troubleshooting this issue. I would be grateful for any suggestions.

Thanks in advance.
​ ​ ​ ​

You could ignore those warning!

  • It is because of your php.ini 's error reporting settings. If you have access to php.ini file.

Try the line below:

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE & ~E_WARNING

Thank you for the suggestion. Editing php.ini does supress the warnings, but clicking the ‘edit’ next to a contact name still brings up the XAMPP dashboard rather than the contact’s details edit form.

I read before on the forum, when you upgrade from 7.13 to 7.14 keep your PHP 7.4 and once you upgraded successfully change PHP to 8.x version.

Just tried it - same result though.

I noticed that there is a new folder ‘sysplugins’ in the Smarty folder in suitecrm 7.14.x that wasn’t in 7.13, so it’s the suitecrm upgrade that is causing the malfunction.

Any ideas?

Delete any files giving errors, but only the ones under cache directory.

Then try again and see if it changes anything.

How to get back cache directory?

The parts that I tell people to delete, they all re-generate by themselves when you use the software or visit specific screens.

If I understood you correctly, I deleted Employeevardefs.php and Uservardef.php in the cache directory. Did a search for a contact and tried to edit the contact in the search results, but still ended up with the XAMPP dashboard. The deleted files were indeed regenerated.

Thanks for your suggestion anyway.

1 Like

So, you still have a same issue? :thinking:

Yes, unfortunately. It’s got to be something to do with ‘php-function “key” as a modifier is deprecated’ hasn’t it?

In your suitecrm directory.

Run sudo chown -R www-data:www-data .

Replace www-data with your Owner name.

Then run below command in same folder one after another.

  sudo chmod -R 755 .

  sudo chmod -R 775 cache custom modules themes data upload

php.ini file location:

Windows (With Xampp Installation):

/xampp/php/php.ini

MacOS, OS X:

/private/etc/php.ini

Linux:

/etc/php.ini

/usr/bin/php5/bin/php.ini

/etc/php/php.ini

/etc/php5/apache2/php.ini?

Add the below line:

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE & ~E_WARNING

Let me know, once you do these steps.

I’m running on a Windows 10 box. Obviously, chmod is inapplicable, but I just set Everyone → Full Access for testing…

The upgrade went without issue, but again, if I try to search for a contact and then try to edit that contact in the returned list, it takes me back to the XAMPP dashboard.

No idea, why you’re getting that pop-up window :melting_face: