Closed (duplicate)
Project:
Subuser
Version:
7.x-2.0-alpha2
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Jan 2013 at 04:11 UTC
Updated:
28 Oct 2013 at 16:11 UTC
The install function has two bugs which prevent proper installation and use of the module. This may or may not be due to changes in the relation module.
Anyway this is what the function looks like now:
function subuser_install() {
$record = array(
'predicate' => 'subuser',
'label' => t('Subuser'),
'directional' => TRUE,
'source_bundles' => array('user:user'),
'target_bundles' => array('user:user'),
);
relation_type_save($record);
}
This is what it should look like:
function subuser_install() {
$record = array(
'relation_type' => 'subuser',
'predicate' => 'subuser',
'label' => t('Subuser'),
'directional' => TRUE,
'source_bundles' => array('user:user'),
'target_bundles' => array('user:user'),
);
$record = (object) $record;
relation_type_save($record);
}
The function relation_type_save() expects an object and also expects the value 'relation_type' to be set.
Comments
Comment #1
BillyTom commentedI got the following error when trying to enable this module:
Invalid argument supplied for foreach() relation.module:278 [warning]Your changes to the install file made it work, thanks.
Comment #2
zeit_geist commentedIt works fine with me 2. Thx for good job.
Comment #3
hooface commentedThanks.
Comment #4
akalata commentedConsolidating install issues. Marking as duplicate of #1241934: Relation API has changed so subuser install is broken.