og_save_subscription don't work

Events happening in the community are now at Drupal community events on www.drupal.org.
ismaas2002@gmail.com's picture

now i want to create a groupe with admins user:

<?php
global $user;
 
$node = new stdClass();
 
$node->type = 'group'; // Change this to group node type name.
 
$node->uid = $user->uid;
 
$node->title = t('Mon groupe'); // Change title generation
 
$node->body = t('Body'); // Change body generation
 
$node->og_description = t('Group description'); // Change group description generation
 
$node->og_selective = OG_CLOSED;
 
$node->og_register = OG_REGISTRATION_NEVER;
 
$node->og_directory = OG_DIRECTORY_CHOOSE_FALSE;
 
$node->og_private = 0;
 
node_save($node);
 
og_insert_group($node);
 
og_save_subscription($node->nid, $node->uid, array('is_active' => 1, 'is_admin' => 1));
?>

after execution he created a groupe in table og
but nothing in table og_uid

i have this message after user connexion :
warning: array_fill() [function.array-fill]: Number of elements must be positive in C:\xampps\htdocs\atrium\includes\database.inc on line 253.
warning: implode() [function.implode]: Invalid arguments passed in C:\xampps\htdocs\atrium\includes\database.inc on line 253.
warning: array_keys() expects parameter 1 to be array, null given in C:\xampps\htdocs\atrium\modules\user\user.module on line 513.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in C:\xampps\htdocs\atrium\modules\user\user.module on line 513.
user warning: Duplicate entry '0' for key 'PRIMARY' query: INSERT INTO og_notifications (uid) VALUES (0) in C:\xampps\htdocs\atrium\profiles\openatrium\modules\contrib\og\modules\og_notifications\og_notifications.module on line 56.

Organic groups

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: