Hi everyone.
I am using the following code for creating new elgg object. After object creation also need to create a river iten based on object created.
The object is created successfully but the river item is not created and I dont know where the problem is located.
I am using the lastest release of elgg. elgg 2.3.4
$description = new ElggObject();
$description->subtype = "description";
$description->owner_guid = elgg_get_logged_in_user_guid();
$description->descriptionname = $descriptionname;
$description->access_id = ACCESS_PUBLIC;
$description->save();
$river_id = elgg_create_river_item(array(
'view' => 'river/object/description/create',
'action_type' => 'create',
'subject_guid' => elgg_get_logged_in_user_guid(),
'object_guid' => $description->getGUID(),
));
if (!empty($river_id)) {
register_error('River created');
}else{
register_error('Unable to create river');
}
// it stiil return "Unable to create river" and the object is successfully created.
Could someone help me ??
Best regard.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Jerome Bakker@jeabakker
Jerome Bakker - 0 likes
- Hermand Pessek@rheman
Hermand Pessek - 0 likes
You must log in to post replies.does the view
'river/object/description/create'
exists? If you have caching enabled and recently added the view, flush the cache.Thanks a lot... I just flush my cache..