我试图通过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');
?>
我只是想在关系中创建一个领域。也许我在清单文件中的某处丢失了,或者我需要包含一些额外的文件。
您使用的是什么版本的SugarCRM?当您遇到500错误时,您的sugarcrm.log中是否有任何条目? – Reisclef
@Reisclef,谢谢,我正在使用SugarCRM EE 7.6.1的评论。我没有检查糖注销,但我认为它主要是关于权限问题。权限对于通过模块加载器创建定制关系非常重要。 –
@egg,请给我看看上面的代码我知道我误解的地方。所以请帮助我。 –