Quoting Ivan Sergio Borgonovo mail@webthatworks.it:
This is D5.
Yes, you said that before.
And yeah even if the snippet didn't use a *form* there is a form involved in the real case.
So let's make the snippet more complete and add the steps to reproduce the problem.
/* hook_menu */ if(!$may_cache) {
$may_cache only affects the items returned for the $menu.
$item[] = array( 'path' => 'some/path1', 'callback' => 'stuffthatchangedb', ); $item[] = array( 'path' => 'some/path2', 'callback' => 'drupal_get_form', 'callback arguments' => array('stuffthatdependsondb'), );
So the above will not be cached in the menu's cache.
}
function stuffthatchangedb() { db_query('insert values(someid, somefield) values(default, 97); drupal_goto('some/path2'); }
function stuffthatdependsondb() { $result = db_query("select someid, somefield from table1;"); while($row = db_fetch_array($result)) { $form['something'][$row['someid']] = array( '#type' => 'textfield', '#default_value" => $row['somefield'], ); } return $form; }
I visit some/path1. some/path1 add a record to table1 I get redirected to some/path2. I visit once more some/path1 some/path1 add a record to table1 some/path2 still show the content of the first time I visited it.
This has nothing to do with $menu_cache. It has to do with your page cache or the browser cache since you have caching set to normal. Reduce the cache lifetime in settings.php.
-- Earnie -- http://r-feed.com/ -- http://for-my-kids.com/ -- http://www.4offer.biz/ -- http://give-me-an-offer.com/