Pro Drupal Development Chapter 2: annotate

Danny_Joris - December 13, 2008 - 17:07

I have an error when i use the pro drupal development code that i downloaded from http://www.drupalbook.com/node/2 . I downloaded the code for the right edition. This problem occurs when i use it in my wamp setup. Its the latest version of wamp and drupal and its a fresh install. The error i get is this:

user warning: Table 'drupal.annotations' doesn't exist query: SELECT note FROM annotations WHERE nid = 1 AND uid = 1 in D:\Webdesign\wamp\www\drupal\sites\all\modules\custom\annotate\annotate.module on line 54.

I guess i can add that table manually, but that shouldnt be the way to do it.
Drupal is succesfully connected to the database and saves content succesfully except for annotations. I must say it works on my online serverspace, but i can only use php4 there, thats why i wanted to experiment with wamp.

Thanks in advance,
Danny

You annotate module

nevets - December 13, 2008 - 17:20

You annotate module directory should have a annotate.install file.

its there and it looks

Danny_Joris - December 13, 2008 - 17:24

its there and it looks complete. Straight from the www.drupalbook.com website.

If you disable the module,

nevets - December 13, 2008 - 18:01

If you disable the module, can you uninstall it(under tab at top of module page).

wow, i uninstalled it (an

Danny_Joris - December 13, 2008 - 18:14

wow, i uninstalled it (an error appeared: cannot drop table / because its doenst exist), rechecked and enabled it, and now it works. I dont really know what exactly made the difference, because there wasnt a database table anyway. I guess my first bad copy of annotate didnt make one. I pasted the good version in it and it must have thought that there was already a table. Weird that it didnt check that in the beginning.

Thanks for your help !

No modules are available to uninstall.

dvkd - March 12, 2009 - 07:12

Hi ,
I am facing this same problem:
'drupal.annotations' doesn't exist query: SELECT note FROM annotations WHERE

So, i disabled the annotate module ,and i tried uninstalling ,by clicking the uninstall option
but i got this message in the uninstall page:

No modules are available to uninstall.

Please help me....
Thank you

No annotations table

juancapistrano - March 16, 2009 - 03:00

Hi,

Me too, I have the same problem.

After I installed the annotations module I get this WARNING:

warning: Invalid argument supplied for foreach() in C:\xampp_new\htdocs\drupal610\includes\common.inc on line 3283.

And when I checked the database, there's no annotations table.

I tried disable, uninstall, and even deleting the annotate module row from the systems table, then re-install. All of these like ten times already.

I also checked the Errata section of the book more than twice for some new corrections but there's none.

I even reinstalled my whole Drupal CMS just to try this annotate module.

But its still the same error every time I try. It seems like the drupal_install_schema just didn't work on annotate module.

Please help.

Thanks.

The book has an Errata page

marquardt - March 16, 2009 - 09:25

The book has an Errata page which lists quite a number of fixes for that module - did you go through them and checked that your downloaded code has them all applied?

Yes I did. I read and applied

juancapistrano - March 16, 2009 - 12:21

Yes I did. I read and applied the errata page more than twice. But I still get the same errors.

I even started from scratch, just in case. I downloaded a fresh copy of the book ch2 code, reinstalled it on my latest installation of drupal 6.10, and applied the errata page before I enabled the "annotate" module in the admin page. But I still get those warnings.

I'm a drupal newbie. But from what I observe from the code, I believe the install portion is suppose to install the "annotations" table once I enable the "annotate" module. But somehow it doesn't create a table when I check my localhost mysql dbms.

I really don't know what I'm missing here. Please help.

Thanks for your reply.

Hmmm.

marquardt - March 16, 2009 - 19:52

Strange. I just downloaded a fresh copy of the book's source code and put it in a fresh Drupal (6.10) installation; it worked immediately after the module had been enabled. The annotations database was created without problems.

I didn't have to apply any patches, though; it seems that the source code already had been patched (and that's consistent with what the errata says). Deinstallation also worked like a charm...

So I'm sorry, but I can't reproduce the problem you describe.

Thanks!

juancapistrano - March 17, 2009 - 01:24

Hi Marq,

Sorry, my bad. You're right.

I replaced the files with the original copy and reinstalled the module and it works now.
The source code from the book were good to go, no need to edit anything. Thank you for your help.

jc

Annoate

dvkd - March 17, 2009 - 10:09

Hi juancapistrano ,

i could able add annoatation notes in the text area,
after pressing update , i got the message :Your annotation has been saved..

But can you please tell me , how to display all the upgraded notes in that page.

Thanks in advance :-)

Annotate

juancapistrano - March 25, 2009 - 23:37

Hello,

Sorry for the late return.

Anyway, I'm not sure what you meant, but mine works from the box, with the most recent code that I downloaded anyway.

So I just installed the module then it was good to go.

When I edit that node, I see an annotation box for it.

I place some text then click on the "Update" button, and I got the message "Your annotation has been saved".

Same thing when I edit the annotation and click on "Update" button again, I get the same message plus the edited text on the annotation box.

I think you can only see one annotation box at a time though, that is on the node that you are editing.

I hope that helps.

FIXED

flyingyoda51 - March 27, 2009 - 16:59

FIXED

Problem mysteriously fixed

mpulier - September 9, 2009 - 12:23

My solution was simplistic, yet mysterious.

Under Drupal 6.13 I had error messages about the lack of the necessary database table as above; and they persisted through all sorts of maneuvers, so I disabled the Annotate and Editorial Annotation 6.x-1.0 modules and tried to uninstall. The modules were still there, and another attempt to uninstall elicited the message that there was nothing to uninstall. Running update.php made no difference. Weird.

Then I re-enabled (the modules were still appearing on Administer > Site building > Modules) and now everything works, the table has been created, annotations are stored. Go figure.

Myron L. Pulier, MD
ClinAssocProfPsychiatry
UMDNJ-NJMedSchl
http://www.umdnj.edu/~pulierml/

 
 

Drupal is a registered trademark of Dries Buytaert.