2017-08-08 10 views
1

SugarCRMのモジュールローダーを使用してリレーションシップを作成しようとしています。しかし、問題は私のパッケージが55%後にインストールが停止されることです。私は、表示を見ていたときにエラーを記録している: -sugarCRM:モジュールローダーを使用してリレーションシップを作成する、パッケージをインストールしない

は キャッシュ/アップグレード/ TEMP/SYWr9G /カスタム/メタデータ/ accounts_contacts_1MetaData.php カスタム/メタデータ/ accounts_contacts_1MetaData.php

のコピーに失敗しました私はアクセス権も変更しようとしましたが、ある時点では内部サーバのエラー500を経由しました。以下は私が使用しているコードです。

1.In manifest.php file : 
    $installdefs = array(
     'id' => 'package_20170804', 
     'copy' => array(
      0 => array(
       'from' => '<basepath>/accounts_contacts_1MetaData.php', 
       'to' => 'custom/metadata/accounts_contacts_1MetaData.php', 
       ), 
      1 => array(
       'from' => '<basepath>/accounts_contacts_1.php', 
       'to' => 'custom/Extension/application/Ext/TableDictionary/accounts_contacts_1.php', 
       ), 
      ), 
     'relationships'=>array (
      array (
       'module'=> 'Accounts', 
       'meta_data'=>'<basepath>/custom/metadata/accounts_contacts_1MetaData.php', 
       'module_vardefs'=>'<basepath>/custom/Extension/application/Ext/TableDictionary/accounts_contacts_1.php' 

       ) 
      ), 
     ); 

2. In accounts_contacts_1MetaData.php file : 

    <?php 
    $dictionary["accounts_contacts_1"] = array (
     'true_relationship_type' => 'one-to-many', 
     'from_studio' => true, 
     'relationships' => 
     array (
     'accounts_contacts_1' => 
     array (
      'lhs_module' => 'Accounts', 
      'lhs_table' => 'accounts', 
      'lhs_key' => 'id', 
      'rhs_module' => 'Contacts', 
      'rhs_table' => 'contacts', 
      'rhs_key' => 'id', 
      'relationship_type' => 'many-to-many', 
      'join_table' => 'accounts_contacts_1_c', 
      'join_key_lhs' => 'accounts_contacts_1accounts_ida', 
      'join_key_rhs' => 'accounts_contacts_1contacts_idb', 
     ), 
     ), 
     'table' => 'accounts_contacts_1_c', 
     'fields' => 
     array (
     0 => 
     array (
      'name' => 'id', 
      'type' => 'varchar', 
      'len' => 36, 
     ), 
     1 => 
     array (
      'name' => 'date_modified', 
      'type' => 'datetime', 
     ), 
     2 => 
     array (
      'name' => 'deleted', 
      'type' => 'bool', 
      'len' => '1', 
      'default' => '0', 
      'required' => true, 
     ), 
     3 => 
     array (
      'name' => 'accounts_contacts_1accounts_ida', 
      'type' => 'varchar', 
      'len' => 36, 
     ), 
     4 => 
     array (
      'name' => 'accounts_contacts_1contacts_idb', 
      'type' => 'varchar', 
      'len' => 36, 
     ), 
     ), 
     'indices' => 
     array (
     0 => 
     array (
      'name' => 'accounts_contacts_1spk', 
      'type' => 'primary', 
      'fields' => 
      array (
      0 => 'id', 
      ), 
     ), 
     1 => 
     array (
      'name' => 'accounts_contacts_1_ida1', 
      'type' => 'index', 
      'fields' => 
      array (
      0 => 'accounts_contacts_1accounts_ida', 
      ), 
     ), 
     2 => 
     array (
      'name' => 'accounts_contacts_1_alt', 
      'type' => 'alternate_key', 
      'fields' => 
      array (
      0 => 'accounts_contacts_1contacts_idb', 
      ), 
     ), 
     ), 
    ); 
3. In accounts_contacts_1.php file: 

<?php 
include('custom/metadata/accounts_contacts_1MetaData.php'); 
?> 

私はただの関係でフィールドを作成したかっただけです。たぶん私はマニフェストファイルのどこかに見つからないか、いくつかの追加ファイルを含める必要がありました。

+0

SugarCRMのどのバージョンをお使いですか? 500エラーが発生した場合、sugarcrm.logには何かエントリがありますか? – Reisclef

+0

@Reisclef、ありがとう、私はSugarCRM EE 7.6.1を使っています。私は砂糖のログアウトをチェックしなかったが、主に許可の問題について言うと思う。モジュールローダーを使用してカスタムリレーションシップを作成するための許可は、本当に重要ですか? –

+0

@egg、私が間違っているところを知っている上記のコードを見てください。だから私を助けてください。 –

答えて

1

私はそれを解決しました。 SugarCRMでモジュールローダーを使用して関係を作成するには、次の手順に従います。

ステップ1: - Linuxの場合
を以下に基づいて、あなたの砂糖のディレクトリへのアクセス権を付与します。Windowsの場合http://support.sugarcrm.com/Knowledge_Base/Platform_Management/Required_File_System_Permissions_on_Linux/

http://support.sugarcrm.com/Knowledge_Base/Platform_Management/Required_File_System_Permissions_on_Windows_With_IIS/

ステップ2: - manifest.php

<?php 
$manifest = array(
    'acceptable_sugar_flavors' => array('CE','PRO','CORP','ENT','ULT'), 
    'acceptable_sugar_versions' => array(
     'exact_matches' => array(), 
     'regex_matches' => array('(.*?)\\.(.*?)\\.(.*?)$'), 
     ), 
    'author' => 'Ravi Ranjan', 
    'description' => 'Relationship', 
    'icon' => '', 
    'is_uninstallable' => true, 
    'name' => 'custom relation', 
    'published_date' => '2017-08-10 2017 11:45:04', 
    'type' => 'module', 
    'version' => '20170810', 
    ); 

$installdefs = array(
    'id' => 'package_20170810', 
    'copy' => array(
     0 => array(
      'from' => '<basepath>/accounts_contacts_1MetaData.php', 
      'to' => 'custom/metadata/accounts_contacts_1MetaData.php', 
      ), 

     1 => array(
      'from' => '<basepath>/accounts_contacts_1.php', 
      'to' => 'custom/Extension/application/Ext/TableDictionary/accounts_contacts_1.php', 
      ), 

     ), 

    ); 

?> 

でステップ3: - ファイルaccount_contacts_1MetaData.phpとaccounts_contacts_1.phpの両方の内容は、あなたが問題に見られるのと同じです。

ステップ4:インストール後に3つのファイルをすべて圧縮し、モジュールローダー経由でアップロードします。

スタジオ>アカウント>リレーションシップに新しい名前のフィールドが表示されます。accounts_contacts_1これは私が作成したかったものです。

関連する問題