开发者

arg api in drupal gets incorrect values when you are NOT logged in

开发者 https://www.devze.com 2023-02-01 10:26 出处:网络
Merged with how to force drupal function to not use DB开发者_如何学Go cache?. i have a module and i am using node_load(array(\'nid\' => arg(1)));
Merged with how to force drupal function to not use DB开发者_如何学Go cache?.

i have a module and i am using node_load(array('nid' => arg(1)));

now the problem is that arg API keeps getting incorrect values when i am not logged in. how can i force this function to not use DB cache or static value?

Example

the link is _http://mydomain.com/node/344983

now:

$node=node_load(array('nid'=>arg(1)),null,true);

echo $node->nid . " ,, " arg(1);

output:

435632 ,, 435632 which is a randomly node id (available in the database)

and everytime i ctrl+F5 my browser, i get new nid!!

Note: if i am logged in, it gives the result correctly, but this problem happens only when i am browsing the website as an anonymous user

i really appreciate any idea!! Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消