Export Customizations

SuiteCRM 7.4 full release

If I go into Studio to Export my Customisations I find at least two issues:

  1. List of customisations made
    The list reflects all customisations present in the system,. Not just those I have implemented.
    This may be a problem since I want to export my customisations only in order to re-import them in another instance which doesn’t have them.
    If I import every customisation present in the system I am sure that, if the source implementation is not identical to the target implementation I will end up in trouble (for example if I export from an older system to a newer system in which certain bugs or new features have been fixed or added, I may end up with a system with older features or bugs).
    Additionally I have no idea on how does SuiteCRM behave when I try to import something that is already there.

Conclusion: it would useful to separate customisations made by system admins from those made for the standard SuiteCRM version. (I know it’s hard to implement. Myabe standard customisations should go in the standard product not as customisations but as part of the normal source code. I also know that doing so raises an issue with keeping the system up to date with new features / corrections coming from SugarCRM)

  1. Undefined Labels
    Next to each module I get plenty (not only) of lines with an “undefined” description. I am i inclined to believe that those descriptions are not implemented or something is not perfectly working since I am 100% sure that I have no permissions problems since I have a scheduler running every minute resetting permissions and I have also edited config.php and include/utils.php and, after a manual check, everything looks fine).

The following is an image to show the undefined descriptions and the high number of customisations I did not implement.

Hi,

If you export customizations of an older version, and import them into a new version. I don’t imagine it will cause any unseen issues.
However, If you are worried, you can create a backup of your CRM in the Admin > Backups menu.
Do note that this doesn’t take a backup of your Database, just the CRM’s directories/files.

In regards to the undefined labels,
What permission values are you setting with your scheduler?
What values did you set in your config.php and utils.php files?

John,

thanks for your reply.

  1. Customisations
    My main concern is that, amng customisations, I get lots of stuff that isn’t mine.
    The other question is, actually marginal but gives me worries because, if I look at the manifest.php file there is a bunch of (old) files that gets copied (probably replacing the new files) to the new system! This issue wouldn’t exist if there were only my customisations, or at least it would be only my problem. Fortunately I always back everything up and I have created a custom module with a scheduler which does it for me every night. Including the DB

  2. Undefined labels
    I am wondering what is wrong here because I am pretty sure that my permissions are set correctly
    My scheduler sets everything to 755 except for certain things, which it sets to 775 (folders: cache, custom, data, modules, themes, upload and file: config_override.php). To test it, among other checks (logs, scheduler job lists, etc…) I place a file in a random folder and, after it has run, the file has the correct permissions.
    In config.php and in include/utils.php I have set:

  'default_permissions' => 
  array (
    'dir_mode' => 1533, // 2775
    'file_mode' => 493,  // 755
    'user' => 'myuser', // this value is actually set correctly
    'group' => 'mygroup',  // this value is actually set correctly
  ),

(note that, for the post I have changed the user and group value to myuser and mygroup respectively, but the actual ones are set correctly - if I modify them I start getting errors)

John,

After digging deeper into the problem of the Undefined labels I found out what is the cause and it is a bug in the file modules/ModuleBuilder/MB/MBPackage.php in the switch found at around line 704 (after an if statement in which a foreach statements loops through the modules list).

The code of that section is:

            if ($module == false ){
                foreach ($dirlisting as $value){
                	if(!file_exists('modules/' . $value . '/metadata/studio.php'))
                		continue;
                    $custommodules[$value]=$this->getCustomModules($value);
                    foreach ($custommodules[$value] as $va){
                        switch ($va) {
                        case 'language':
                                $return[$value][$va] = $mod_strings['LBL_EC_CUSTOMFIELD'];
                            break;
                        case 'metadata':
                            $return[$value][$va] = $mod_strings['LBL_EC_CUSTOMLAYOUT'];
                            break;
                        case 'Ext':
                            
							$return[$value][$va] = $mod_strings['LBL_EC_CUSTOMFIELD'];
                            break;
                        case '':
                            $return[$value . " " . $mod_strings['LBL_EC_EMPTYCUSTOM']] = "";
                            break;
                        default:
                            $return[$value][$va] = $mod_strings['LBL_UNDEFINED'];
                        }
                    }
                }
                return $return;
            }

The default value of the switch string returns Undefined instead of being more specific for a number of cases.

To understand better what is going on I modified the line from:

$return[$value][$va] = $mod_strings['LBL_UNDEFINED'];

to:

$return[$value][$va] = 'va=['.$va .'] - ' . $mod_strings['LBL_UNDEFINED'];

in this way I display also the value of the variable being checked bt the switch statement $va and it gives me the following screenshot:

The solution would be to edit the switch statement adding the various extra cases (views, SugarFeeds, Dashlets, css, tpls, images, js qtip) with a meaningful label to be added in the section // EXPORT CUSTOMS at around line 620 of the file modules/ModuleBuilder/language/en_us.lang.php

The following are my modifications:

file modules/ModuleBuilder/language/en_us.lang.php

//EXPORT CUSTOMS
'LBL_EC_TITLE'=>'Export Customizations',
'LBL_EC_NAME'=>'Package Name:',
'LBL_EC_AUTHOR'=>'Author:',
'LBL_EC_DESCRIPTION'=>'Description:',
'LBL_EC_KEY'=>'Key:',
'LBL_EC_CHECKERROR'=>'Please select a module.',
'LBL_EC_CUSTOMFIELD'=>'customized field(s)',
'LBL_EC_CUSTOMLAYOUT'=>'customized layout(s)',
'LBL_EC_NOCUSTOM'=>'No modules have been customized.',
'LBL_EC_EMPTYCUSTOM'=>'has empty customizations.',
'LBL_EC_EXPORTBTN'=>'Export',
'LBL_MODULE_DEPLOYED' => 'Module has been deployed.',
'LBL_UNDEFINED' => 'undefined',
// *** BEGIN My additions ***
'LBL_EC_VIEWS'=>'customized view(s)',
'LBL_EC_SUGARFEEDS'=>'customized SugarFeeds(s)',
'LBL_EC_DASHLETS'=>'customized Dashlets(s)',
'LBL_EC_CSS'=>'customized css(s)',
'LBL_EC_TPLS'=>'customized tpls(s)',
'LBL_EC_IMAGES'=>'customized image(s)',
'LBL_EC_JS'=>'customized js(s)',
'LBL_EC_QTIP'=>'customized qtip(s)',
// *** END My additions ***

file modules/ModuleBuilder/MB/MBPackage.php

                        switch ($va) {
                        case 'language':
                                $return[$value][$va] = $mod_strings['LBL_EC_CUSTOMFIELD'];
                            break;
                        case 'metadata':
                            $return[$value][$va] = $mod_strings['LBL_EC_CUSTOMLAYOUT'];
                            break;
                        case 'Ext':
                            
							$return[$value][$va] = $mod_strings['LBL_EC_CUSTOMFIELD'];
                            break;
                        case '':
                            $return[$value . " " . $mod_strings['LBL_EC_EMPTYCUSTOM']] = "";
                            break;
// *** BEGIN My additions ***
                        case 'views':
                            $return[$value][$va] = $mod_strings['LBL_EC_VIEWS'];
                            break;
                        case 'SugarFeeds':
                            $return[$value][$va] = $mod_strings['LBL_EC_SUGARFEEDS'];
                            break;
                        case 'Dashlets':
                            $return[$value][$va] = $mod_strings['LBL_EC_DASHLETS'];
                            break;
                        case 'css':
                            $return[$value][$va] = $mod_strings['LBL_EC_CSS'];
                            break;
                        case 'tpls':
                            $return[$value][$va] = $mod_strings['LBL_EC_TPLS'];
                            break;
                        case 'images':
                            $return[$value][$va] = $mod_strings['LBL_EC_IMAGES'];
                            break;
                        case 'js':
                            $return[$value][$va] = $mod_strings['LBL_EC_JS'];
                            break;
                        case 'qtip':
                            $return[$value][$va] = $mod_strings['LBL_EC_QTIP'];
                            break;
// *** END My additions ***
                        default:
                            $return[$value][$va] = $mod_strings['LBL_UNDEFINED'];
                        }

After these modifications I don’t get any Undefined labels in this script anymore.

Hi Guys,

A simple solution to this problem is as follows:

(1) Install the version 7.7.9
(2) Copy the 2 files from this version and replace in the your actual version.

Everything will work fine. Obviously, version 7.7.9 has everything working. The developers of the version later forgot all about this.

SIgh and they want me to pay for the support! I am truly disappointed.

hey folks. another great thread I didn’t find. In fact, I had no idea that there even was an ‘export customizations’ until today. this seems to me like a hugely important ‘safety measure’ for a serious organization. However, I’m not finding any documentation on this (and other) stuff. As you can see here, documentation is empty for Studio. Is there a way for community to write it or is it somewhat closed off?

I would like to learn about exporting and then importing these customizations if there is such documentation.

Thanks so much. :slight_smile: