[development] rebuilding permissions stuck at node 35

Lluís enboig at gmail.com
Wed May 13 16:07:59 UTC 2009


It was a mistake of the load function, it was (I don't know why)
modifying the nid of the node.

On Wed, May 13, 2009 at 5:49 PM, Lluís <enboig at gmail.com> wrote:
> I have coded a module to modify access to nodes; but when I rebuild
> permissions, it starts at node 1, goes counting, and then when it
> reaches 49 it starts rebuilding permission for node 35. My custom
> function to write permissions is:
>
> function wu_node_access_records($node) {
>  $extra_strings=module_invoke_all('wu_node_access_records', $node);
> //this allow other modules to add strings
>  sort($extra_strings);  // idem
>
>  $res=db_query("SELECT * FROM {wu_nodes} WHERE nid=%d",$node->nid);
>  while ($row=db_fetch_object($res))
>    $grants[] = array(
>      'realm' => 'wu_'.$row->wu_realm.(!empty($extra_strings) ? "
> <###> ".implode(" <###> ", $extra_strings): ""),
>      'gid' => $row->wu_nid,
>      'grant_view' => 1,
>      'grant_update' => 1,
>      'grant_delete' => 1,
>      'priority' => 0,  //maybe should be increased
>    );
>  drupal_set_message("rebuilding node: ".$node->nid."-".$node->vid); //debug
>  return isset($grants) ? $grants : NULL;
> }
>
> and it returns:
>    * rebuilding node: 1-1
>    * rebuilding node: 23-23
>    * rebuilding node: 24-24
>    * rebuilding node: 27-27
>    * rebuilding node: 28-28
>    * rebuilding node: 29-29
>    * rebuilding node: 30-30
>    * rebuilding node: 31-31
>    * rebuilding node: 32-32
>    * rebuilding node: 33-33
>    * rebuilding node: 34-34
>    * rebuilding node: 35-35
>    * rebuilding node: 36-36
>    * rebuilding node: 40-40
>    * rebuilding node: 42-42
>    * rebuilding node: 43-43
>    * rebuilding node: 44-44
>    * rebuilding node: 45-45
>    * rebuilding node: 35-35
>    * rebuilding node: 47-47
>    * rebuilding node: 48-48
>    * rebuilding node: 49-49
>    * rebuilding node: 35-35
>    * rebuilding node: 35-35
>    * The content access permissions have been rebuilt.
>
>
> Any hint is wellcome
>
> --
> *La vida és com una taronja, què esperes a exprimir-la?
> *Si creus que l'educació és cara, prova la ignorància.
> *La vida és com una moneda, la pots gastar en el que vulguis però
> només una vegada.
> *Abans d'imprimir aquest missatge, pensa en el medi ambient.
>



-- 
*La vida és com una taronja, què esperes a exprimir-la?
*Si creus que l'educació és cara, prova la ignorància.
*La vida és com una moneda, la pots gastar en el que vulguis però
només una vegada.
*Abans d'imprimir aquest missatge, pensa en el medi ambient.


More information about the development mailing list