2017-08-08 124 views
1

我試圖通過SugarCRM中的模塊加載程序創建關係。但問題是我的包在55%之後停止安裝。當我觀看顯示記錄錯誤是: -sugarCRM:使用模塊加載程序創建關係,未安裝程序包

無法複製 緩存/升級/溫度/ 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提供權限貴糖目錄:http://support.sugarcrm.com/Knowledge_Base/Platform_Management/Required_File_System_Permissions_on_Linux/
對於Windows:
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步: - 文件accounts_contacts_1MetaData.php和accounts_contacts_1.php的內容與您所看到的相同。

第4步: - 安裝快速修復和重建後,壓縮所有三個文件並通過模塊加載器上載。

進入Studio> Accounts> Relationships您將看到一個新字段,名稱爲accounts_contacts_1這就是我想要創建的。

相關問題