Unable to create river using elgg_create_river_item()

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;


$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');
                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.



Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking