By Cornell Jake on
Im working in the book "Pro Drupal Development".
I have now write down Chapter 1 and everyting is working, EXCEPT the .install file. (Or, to say it differently, the database isn't autofill with the annotation table)
To go for sure, I have copy the whole code from the code examples of http://www.drupalbook.com/files/7559ch02%20-%20Your%20First%20Module.zip. And put that over my code. That did not work..
Look, I can run a MySQL query, but I dont want that, I want that it works. I spent a lot of hours and cant find it, and I am sure that you can do this better :-)
Do you have some suggestions, or fixes?
Comments
Run the complete query in phpmyadmin
You can find out if your mysql query is properly formed by running it in the query window of phpmyadmin, or something like that. Then you'll know if it's the query or your code in the install file.
When I run the query
When I run the query manually in the SQL-window, then it works perfect, and it also stores the data correctly.
But my problem is, that 'Drupal' dont see the .install file..
Thus also you are correctly that you think its the .install file.
Okay here he is:
Annotate.info
Annotate.install
Annotate.module
I know its a long code, but please help me out. I cant find the prob you know, and I think its all good.
Thanks before guys!
Still having problems?
Are you still having problems with the install file?
Does your drupal database user have mysql permissions to create new tables in the drupal database?
Here's the working code from my annotate install file:
Thanks for your help
Thanks for your help duggoff@drupal.org, but your code does still not work. Also I have checked my MySQL username and pass, and that is fine. (I am working on localhost with this testsite)
Do you have any suggestions?
Simple Fix
All you need to do is disable the module and then delete its row from the system table of the database. After that is done enable the module again and all the tables will be created!
Bless your heart. This is
Bless your heart. This is what I had to do to fix the same problem for me. Thanks for helping out us noobs in our time of need!
Error info on the book's website
There's a number of posts on the Book's website with info about errors.
http://www.drupalbook.com/errata
Some reference this very piece of code - pointing out that the table name in the SQL query should be contained in curly brackets {}.
I've had precisely the same problem as you. I corrected the code and removed the row from the system table as mentioned by CmdrDork. (Thanks for that info!)
Upon the next enable of the Annotation module I got the proper confirmation messages telling me the database was set up. Those messages didn't appear before.
PE Design
http://www.pedesign.co.uk
Manually delete rows
My module never had the curly bracket problem (I worked from a revised copy of the book) but the install still doesn't work - there are no success or failure messages from the drupal_set_message calls.
I don't have phpmyadmin- how do I manually delete a row corresponding to the module from the system table?
I figured it out: mysql -u
I figured it out:
mysql -u root -p
use drupal
delete from system where filename = 'sites/all/modules/commentpoints/somemodule.module';