I'm beginning work on a module which adds four new tables to the database. I've gotten my initialization routine to work nicely, adding the tables and session vars that I need. But when I test "Remove", it reports that the module was removed, but the tables (and Session vars) remain in the database.
It appears that the module_delete() function in my pninit.php file doesn't seem to be called at all. If I put my delete code up into my init block, it works without error -- adding and then deleting the same table when I initialise. That rules out a database rights issue, which I also checked.
When I test the Template module, it works perfectly as well. When I copy the Template delete function and just change the module from "template" to my module name, and change the name of the pnTable name, I get the previous result: PN reports a sucessful removal (no error message -- and I test for DB errors), but no change to the database.
Thanks in advance for any tips for validating my init and delete functions to get this working.
- shyra posted »MenuTree Mystery« 19:50h
- dks answered »include a file« 18:22h
- dks answered ».764 -> 1.1.1, Can't add new blocks« 17:33h
- craigh posted »PostCalendar 5.5.0RC1 needs testers and translators« 17:24h
- bartl answered »Upgrading 1.0.2 --> 1.1.1« 15:02h
- Charlie-otb answered »SafeHTML output filter and youtube« 10:02h
- dl7und answered »Adding an "About Us" page« 03:34h
Login
Initilization Works; Delete Doesn't
-
- Rank: Freshman
- Registered: 05.03.03
- last visit: 16.03.03
- Posts: 3
-
- Rank: Professional
- Registered: 27.06.02
- last visit: 02.04.03
- Posts: 746
it has to work. check and double check for stupid errors, like typos, etc., especially the function name. -
- Rank: Freshman
- Registered: 05.03.03
- last visit: 16.03.03
- Posts: 3
I ended up removing all of the "function module_upgrade($oldversion)" code that I had modified only to comment out the template example code. It didn't appear that this commented out my module_delete() function, but once I got rid of that code, the delete code worked perfectly.
Thanks for the pointer!
- Moderated by :
- Support
