I am creating a filedepot folder during user registration. I am using following code for for creation of filedeopt folder.

function modulealter_user_insert(&$edit, $account, $category) {
	$node = new stdClass();
	$node->type = 'filedepot_folder';
	node_object_prepare($node);
	$node->language = LANGUAGE_NONE;
	$node->uid = $account->uid;
	$node->name = $account->name;
	$node->title = check_plain($account->name);
	$node->filedepot_folder_desc[LANGUAGE_NONE][0]['value'] = 'This is private folder of author user.';
	$node->parentfolder = 4;
	$node->inherit = 0;
	node_save($node);
	watchdog('filedepot',"New folder created @name - new filedepot folder created.", array('@name' => $account->title));
}

Above snippet will give error

Error creating folder
Notice: Undefined property: stdClass::$title in modulealter_user_insert() (line 24 of D:\wamp\www\Vokoto\sites\all\modules\custom\modulealter\modulealter.module).

Even though it creates a folder with user name, but it doesn't set the value of "Parent Field", when i try to set the value using "admin interface", then also it doesn't allow me to set the value of Parent Field

Comments

mohit_aghera’s picture

Status: Active » Closed (fixed)

There was a problem related to parent folder permissions. Resolved and fixed