AnsweredAssumed Answered

Adding vardef via module loader creates a folder instead of file

Question asked by Madhav Shenoy on Oct 28, 2015
Latest reply on Nov 10, 2015 by Madhav Shenoy
Sugar is being difficult again. :(. I'm trying to add a vardef via the module loader. I've created a package. I'm adding the installdefs I'm using. Everything seems to go fine, except that the vardef I've added gets created as a folder and now a file in custom/Extensions/modules/ProspectLists/Ext/Vardefs. Any pointers??



$installdefs = array(
'id' =>'Test',
'copy' => array(
array(
'from' => '<basepath>/copy/files/CheckIfMarketingDataExists.php',
    'to' => 'custom/CheckIfMarketingDataExists.php',
    ),
    array(
    'from' => '<basepath>/copy/files/GetMailChimpLists.php',
        'to' => 'custom/GetMailChimpLists.php',
        ),
        array(
        'from' => '<basepath>/copy/custom/modules/Campaigns/UpdateMailChimpSync.php',
            'to' => 'custom/modules/Campaigns/UpdateMailChimpSync.php',
            ),
            array(
            'from' => '<basepath>/copy/custom/modules/Campaigns/UpdateMarketingData.php',
                'to' => 'custom/modules/Campaigns/UpdateMarketingData.php',
                ),
                array(
                'from' => '<basepath>/copy/custom/modules/Campaigns/WizardHome.php',
                    'to' => 'custom/modules/Campaigns/WizardHome.php',
                    ),
                    array(
                    'from' => '<basepath>/copy/custom/modules/Campaigns/WizardNewsletter.php',
                        'to' => 'custom/modules/Campaigns/WizardNewsletter.php',
                        ),
                        array(
                        'from' => '<basepath>/copy/custom/modules/Campaigns/include/javascript/Validate.js',
                            'to' => 'custom/modules/Campaigns/include/javascript/Validate.js',
                            ),
                            array(
                            'from' => '<basepath>/copy/custom/modules/Campaigns/include/javascript/ViewMailChimpList.js',
                                'to' => 'custom/modules/Campaigns/include/javascript/ViewMailChimpList.js'
                                ),
                                array(
                                'from' => '<basepath>/copy/custom/modules/Campaigns/metadata/editviewdefs.php',
                                    'to' => 'custom/modules/Campaigns/metadata/editviewdefs.php',
                                    ),
                                    array(
                                    'from' => '<basepath>/copy/custom/modules/Campaigns/tpls/WizardCampaignBudget.tpl',
                                        'to' => 'custom/modules/Campaigns/tpls/WizardCampaignBudget.tpl',
                                        ),
                                        array(
                                        'from' => '<basepath>/copy/custom/modules/Campaigns/tpls/WizardCampaignHeader.tpl',
                                            'to' => 'custom/modules/Campaigns/tpls/WizardCampaignHeader.tpl',
                                            ),
                                            array(
                                            'from' => '<basepath>/copy/custom/modules/CM_CRMS_Campaign_MailChimp/clients/base/api/CampaignMailChimpEndpointsApi.php',
                                                'to' => 'custom/modules/CM_CRMS_Campaign_MailChimp/clients/base/api/CampaignMailChimpEndpointsApi.php',
                                                ),
                                                array(
                                                'from' => '<basepath>/copy/custom/modules/ProspectLists/UpdateSync.php',
                                                    'to' => 'custom/modules/ProspectLists/UpdateSync.php',
                                                    ),
                                                    array(
                                                    'from' => '<basepath>/copy/custom/modules/ProspectLists/clients/base/views/create-actions/create-actions.js',
                                                        'to' => 'custom/modules/ProspectLists/clients/base/views/create-actions/create-actions.js',
                                                        ),
                                                        array(
                                                        'from' => '<basepath>/copy/custom/modules/ProspectLists/clients/base/views/record/record.js',
                                                            'to' => 'custom/modules/ProspectLists/clients/base/views/record/record.js',
                                                            ),
                                                            array(
                                                            'from' => '<basepath>/copy/custom/modules/ProspectLists/clients/base/views/record/record.php',
                                                                'to' => 'custom/modules/ProspectLists/clients/base/views/record/record.php',
                                                                ),
                                                                array(
                                                                'from' => '<basepath>/copy/custom/modules/Prospects/UpdateMailChimpSync.php',
                                                                    'to' => 'custom/modules/Prospects/UpdateMailChimpSync.php',
                                                                    ),
                                                                    ),
                                                                    'entrypoints' => array(
                                                                    array(
                                                                    'from' => '<basepath>/Extension/application/Ext/EntryPointRegistry/MCEntryPoints.php',
                                                                        'to' => 'custom/Extension/application/Ext/EntryPointRegistry/',
                                                                        )
                                                                        ),
                                                                        'language' => array(
                                                                        array(
                                                                        'from' => '<basepath>/Extension/modules/ProspectLists/Ext/Language/en_us.lang.php',
                                                                            'to_module' => 'ProspectLists',
                                                                            'language'=>'en_us'
                                                                            ),
                                                                            array(
                                                                            'from' => '<basepath>/Extension/modules/Campaigns/Ext/Language/en_us.lang.php',
                                                                                'to_module' => 'Campaigns',
                                                                                'language'=>'en_us'
                                                                                ),
                                                                                array(
                                                                                'from' => '<basepath>/Extension/modules/Schedulers/Ext/Language/en_us.lang.php',
                                                                                    'to_module' => 'Schedulers',
                                                                                    'language'=>'en_us'
                                                                                    ),
                                                                                    ),
                                                                                    'scheduledefs' => array(
                                                                                    array(
                                                                                    'from' => '<basepath>/Extension/modules/Schedulers/Ext/ScheduledTasks/CRM_MailChimpSync.php',
                                                                                        )
                                                                                        ),
                                                                                        'vardefs' => array(
                                                                                        array(
                                                                                        'from' => '<basepath>/Extension/modules/Prospects/Ext/Vardefs/mailchimp_list_vardef.php',
                                                                                            'to_module' => 'ProspectLists',
                                                                                            ),
                                                                                            ),
                                                                                            'logic_hooks' => array(
                                                                                            array(
                                                                                            'function' => 'UpdateMarketingData',
                                                                                            'module' => 'Campaigns',
                                                                                            'hook' => 'after_save',
                                                                                            'order' => 50,
                                                                                            'description' => 'Test',
                                                                                            'file' => 'custom/modules/Campaigns/UpdateMarketingData.php',
                                                                                            'class' => 'MailChimpIntegration_hook',
                                                                                            ),
                                                                                            array(
                                                                                            'function' => 'UpdateSync',
                                                                                            'module' => 'Campaigns',
                                                                                            'hook' => 'after_relationship_add',
                                                                                            'order' => 50,
                                                                                            'description' => 'Test',
                                                                                            'file' => 'custom/modules/Campaigns/UpdateMailChimpSync.php',
                                                                                            'class' => 'MailChimp_LogicHook',
                                                                                            ),
                                                                                            array(
                                                                                            'function' => 'UpdateSync',
                                                                                            'module' => 'Campaigns',
                                                                                            'hook' => 'after_relationship_delete',
                                                                                            'order' => 50,
                                                                                            'description' => 'Test',
                                                                                            'file' => 'custom/modules/Campaigns/UpdateMailChimpSync.php',
                                                                                            'class' => 'MailChimp_LogicHook',
                                                                                            ),
                                                                                            array(
                                                                                            'function' => 'DeleteSync',
                                                                                            'module' => 'Campaigns',
                                                                                            'hook' => 'after_delete',
                                                                                            'order' => 50,
                                                                                            'description' => 'Test',
                                                                                            'file' => 'custom/modules/Campaigns/UpdateMailChimpSync.php',
                                                                                            'class' => 'MailChimp_LogicHook',
                                                                                            ),
                                                                                            array(
                                                                                            'function' => 'UpdateAfterSave',
                                                                                            'module' => 'ProspectLists',
                                                                                            'hook' => 'after_save',
                                                                                            'order' => 50,
                                                                                            'description' => 'Test',
                                                                                            'file' => 'custom/modules/ProspectLists/UpdateSync.php',
                                                                                            'class' => 'MailChimp_ProspectLogicHook',
                                                                                            ),
                                                                                            array(
                                                                                            'function' => 'UpdateAfterDelete',
                                                                                            'module' => 'ProspectLists',
                                                                                            'hook' => 'after_delete',
                                                                                            'order' => 50,
                                                                                            'description' => 'Test',
                                                                                            'file' => 'custom/modules/ProspectLists/UpdateSync.php',
                                                                                            'class' => 'MailChimp_ProspectLogicHook',
                                                                                            ),
                                                                                            array(
                                                                                            'function' => 'UpdateSync',
                                                                                            'module' => 'Prospects',
                                                                                            'hook' => 'after_save',
                                                                                            'order' => 50,
                                                                                            'description' => 'Test',
                                                                                            'file' => 'custom/modules/Prospects/UpdateMailChimpSync.php',
                                                                                            'class' => 'MailChimp_LogicHook',
                                                                                            ),
                                                                                            array(
                                                                                            'function' => 'DeleteSync',
                                                                                            'module' => 'Prospects',
                                                                                            'hook' => 'after_delete',
                                                                                            'order' => 50,
                                                                                            'description' => 'Test',
                                                                                            'file' => 'custom/modules/Prospects/UpdateMailChimpSync.php',
                                                                                            'class' => 'MailChimp_LogicHook',
                                                                                            )
                                                                                            ),
                                                                                            'custom_fields' => array(
                                                                                            array(
                                                                                            'name' => 'is_scheduled_c',
                                                                                            'label' => 'LBL_IS_SCHEDULED',
                                                                                            'type' => 'bool',
                                                                                            'module' => 'Campaigns',
                                                                                            'default_value' => false, // true or false
                                                                                            'help' => 'Bool Field Help Text',
                                                                                            'comment' => 'Bool Field Comment',
                                                                                            'audited' => false, // true or false
                                                                                            'mass_update' => false, // true or false
                                                                                            'duplicate_merge' => false, // true or false
                                                                                            'reportable' => true, // true or false
                                                                                            'importable' => 'true', // 'true', 'false' or 'required'
                                                                                            ),
                                                                                            array(
                                                                                            'name' => 'mailchimp_list_detail_c',
                                                                                            'label' => 'LBL_MAILCHIMP_LIST_DETAIL',
                                                                                            'type' => 'varchar',
                                                                                            'module' => 'Campaigns',
                                                                                            'help' => 'Text Field Help Text',
                                                                                            'comment' => 'Text Field Comment Text',
                                                                                            'default_value' => '',
                                                                                            'max_size' => 255,
                                                                                            'required' => false, // true or false
                                                                                            'reportable' => true, // true or false
                                                                                            'audited' => false, // true or false
                                                                                            'importable' => 'true', // 'true', 'false', 'required'
                                                                                            'duplicate_merge' => false, // true or false
                                                                                            'dependency' => 'or(equal($campaign_type,"Email"),equal($campaign_type,"NewsLetter"))',
                                                                                            ),
                                                                                            array(
                                                                                            'name' => 'mailchimp_list_name_c',
                                                                                            'label' => 'LBL_MAILCHIMP_LIST_NAME',
                                                                                            'type' => 'enum',
                                                                                            'module' => 'Campaigns',
                                                                                            'help' => 'Enum Field Help Text',
                                                                                            'comment' => 'Enum Field Comment Text',
                                                                                            'ext1' => 'mailchimp_list', //maps to options - specify list name
                                                                                            'default_value' => '', //key of entry in specified list
                                                                                            'mass_update' => false, // true or false
                                                                                            'required' => false, // true or false
                                                                                            'reportable' => true, // true or false
                                                                                            'audited' => false, // true or false
                                                                                            'importable' => 'true', // 'true', 'false' or 'required'
                                                                                            'duplicate_merge' => false, // true or false
                                                                                            'labelValue' => 'MailChimp List',
                                                                                            'dependency' => 'or(equal($campaign_type,"Email"),equal($campaign_type,"NewsLetter"))',
                                                                                            ),
                                                                                            array(
                                                                                            'name' => 'start_time_c',
                                                                                            'label' => 'LBL_START_TIME',
                                                                                            'type' => 'varchar',
                                                                                            'module' => 'Campaigns',
                                                                                            'help' => 'Text Field Help Text',
                                                                                            'comment' => 'Text Field Comment Text',
                                                                                            'default_value' => '',
                                                                                            'max_size' => 255,
                                                                                            'required' => false, // true or false
                                                                                            'reportable' => true, // true or false
                                                                                            'audited' => false, // true or false
                                                                                            'importable' => 'true', // 'true', 'false', 'required'
                                                                                            'duplicate_merge' => false, // true or false
                                                                                            'labelValue' => 'Start Time',
                                                                                            ),
                                                                                            ),
                                                                                            'post_execute' => array(
                                                                                            '<basepath>/scripts/CRM_post_install.php'
                                                                                                ),

                                                                                                );



Outcomes