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.