Community & Support

Pro Drupal Development Chapter 2: annotate

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

Comments

You annotate module

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

its there and it looks

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

If you disable the module,

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

wow, i uninstalled it (an

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.

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

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

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

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.

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!

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

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

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 it now

the root cause for this issue is the incorrect function: variable_delete() in annotate_uninstall(), then change it to variable_del(), then all related error are disappear now!

FIXED

FIXED

Problem mysteriously fixed

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/

Still doesn't work for me.

I have the same error messages on my relatively fresh local copy of Drupal 6.17. Have done the following:

- Downloaded the latest source of the annotate module
- Checked phpMyAdmin to see that the 'annotations' table doesn't exist
- Disabled/re-enabled the annotate module
- Disabled the annotate module, took it out of the site/modules, put in a fresh copy and re-enabled it
- Ran update.php
- Ran 'clear cached data'. No caching was enabled anyways.

All of that did not create the annotations table. Next step appears to be a fresh Drupal install .. . .

Deleted the database, created a new one, ran install.php, enabled Annotations, and it worked. No other modules were enabled prior to this one (ie CKEditor).

got it

core 6.17 same problem
try many times still has this problem
so after unistalling the module, reinstall it
then the annotations table was created in my datebase

thx all

A comment problem

In my case in the annotate.install file I have left a blank space in the initial comment:

/**
* Implementation of hook_install().
* /

So I correct that:

/**
* Implementation of hook_install().
*/

Now everything goes smooth.

Since I'm in linux, I recommend using the meld tool to compare files.

nobody click here