By jakeg on
I'm writing a custom module. When I change something in my module, save the changes and refresh the page on my development server, more often than not (or always even?) I can't see the changes. Not until I go to administer->menu and then poof, when I go back to the page I see the updates.
I've found similar problems with the installation of drupal-docs I've made locally.
Not fun when I'm making many changes and alt-tab, refreshing the page.
I've tried both with cache support enabled and disabled, and by trying various settings of session.cach_limiter and session.cache_expires in settings.php. No luck.
Any ideas?
Comments
Going insane - this makes *no* sense at all!
Ok, this is driving me absolutely insane now. I've tried being both logged in and not logged in, closing all instances of the web browser and then reopening the site, all kinds of things. It just doesn't bloody work!!
I'll give an example. My local host is http://aspo:10000/ (perhaps the :1000 part may be the cause?!)
I go to, as a non-logged in user:
http://aspo:10000/countries
where 'countries' is defined by my custom module.
I get an:
"user error: Table 'local_aspodrupal.country' doesn't exist" as per another forum posting I made (http://drupal.org/node/20211). But I don't think that is related to this problem... though both are equally bizarre. The rest of the page shows up fine.
I delete the line "'type' => MENU_CALLBACK" from my custom module. This should make a whole list of menu items appear on the left of the page. I save my module, and hit refresh on the browser. Nothing changes.
As per my other posting about the weird db_set_active problem, I modify a line from:
db_set_active('anything-but-default');
to
db_set_active('default');
.. which it should be. I save the module and refresh the page. The 'local_aspodrupal.country' doesn't exist" error disappears, but the menu links I'm expecting don't appear.
Now I log in. Exactly the same as before. Menu items still not there. I try navigating around, still not there. The error is not there either.
So then I go to the admin/menu page. Suddenly I get an error and nothing else on the page:
So in my module I change:
db_set_active('default');
back to my hack:
db_set_active('anything-but-default');
I refresh the page. The error is gone. All pages show correctly AND amazingly now the extra menu items are there on the left, as they should be.
In my module I add back:
'type' => MENU_CALLBACK
so the menu items should disappear. Save it, refresh the page. The menu items are still there, they shouldn't be!
I go to admin->menu then back to the page where the menus showed up just one second ago and finally they've disappeared as they should have.
What the bleeding dogs bollocks with hairy nipples falling off is going on here?!
Maybe you should first fix
Maybe you should first fix the obvious eror and create the missing database table.
--
If you have troubles with a particular contrib project, please consider filing a support request. Thanks. And, by the way, Drupal 4.6 will support PHP 5.
--
Drupal services
My Drupal services
no missing db table
There isn't a missing database table. The problem is that db_set_active isn't working, or at least not how the documentation seems to say it should work. Yes, the table is missing from my alternative database, but before the MySQL call I first do a db_set_active back to the 'defalt' database, as I should.
cache solved, database weirdness not yet
According to Killes: "This is intentional. The modul estructure is expensive to build and thus cached. For development I recoemmend the devel modul ewhich allows emptying the cache table with one click.". This hence solves this problem for me, and for others finding this thread too. The module Killes mentions can be downloaded at http://cvs.drupal.org/viewcvs/drupal/contributions/modules/devel/
My problem with changing database still stands at the moment though. Most peculiar.