PHP Fatal error:  Cannot redeclare class TrimText in /custom/modules/Accounts/trim_text.php on line 15

When trying to convert a lead i click on the save contact button and i get a white screen and the apache log shows the below

PHP Fatal error:  Cannot redeclare class TrimText in /var/www/virtual/crm.hardent.com/custom/modules/Accounts/trim_text.php on line 15

I am using Version 6.5.20 (Build 1001) on CentOS release 5.4

Any ideas , i am so very new to SugarCRM

Thanks!

Parents Reply Children
  • In versions 7.9 and beyond, I faced a similar error.

    After issuing

    $grep -rnw . -e 'class class_name'

    I have found something like

    ./modules/class_name/class_name.php:16:class class_name extends class_name_sugar {
    ./custom/modulebuilder/builds/class_name/SugarModules/modules/class_name/class_name.php:16:class class_name extends class_name_sugar {

    So we had 2 classes under the sugarCRM root

    for custom packages, this issue was linked to the composer.json .

    Solving

    It was necessary updating it as following:

    In file "composer.json" (root directory) locate the "exclude-from-classmap" array and add an entry of:
    "/custom/modulebuilder/**"

    In SugarCRM root dir, run "composer update -o --no-dev" to deploy the new dependencies.

    Clear the cache folder

    And that was it! 

    I would like to thanks the SugarCRM Support Team who came out with the solution.