When trying to install the module in version 5, I got an error. I tried to remove the module, then readd it. Now all I get is
user warning: Table 'drupal.volunteer_timeslots' doesn't exist query: SELECT * FROM volunteer_timeslots WHERE vid = 30 in C:\Inetpub\wwwroot\drupal\includes\database.mysql.inc on line 172.

Sounds like a table wasn't created sucessfully

CommentFileSizeAuthor
#7 vt_install_1.patch1.78 KBpwolanin

Comments

pwolanin’s picture

At the moment, this module doesn't have an implementation of hook_uninstall(), so you'll have to fix this by hand to get a clean re-install. Run a query like this:

DELETE FROM system WHERE name = 'volunteer_timeslots'

After that, you should be able to re-install and have the table created.

irbk’s picture

Thanks for the reply. Here is what I did.
Went into Drupal and disabled the module.
Ran the query you gave.
Refreshed my modules window and checked volunteer timeslots
Clicked save configuration.

Then I recieve the following error....

user warning: BLOB/TEXT column 'timeslot_data' can't have a default value query: CREATE TABLE volunteer_timeslots ( vid int unsigned NOT NULL default '0', nid int unsigned NOT NULL default '0', timeslot_length int NOT NULL default '1', num_volunteers int NOT NULL default '1', timeslots_organizers varchar(255) NOT NULL default '', timeslot_data longtext NOT NULL default '', PRIMARY KEY (nid, vid), KEY vid (vid) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in C:\Inetpub\wwwroot\drupal\includes\database.mysql.inc on line 172.
user warning: Table 'drupal.volunteer_timeslots' doesn't exist query: SELECT * FROM volunteer_timeslots WHERE vid = 30 in C:\Inetpub\wwwroot\drupal\includes\database.mysql.inc on line 172.

I'm no drupal expert by ANY stretch of the mind, however, I wonder if the volunteer_timeslots.install might be part of the problem. I noticed that you have

case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {volunteer_timeslots} (
vid int unsigned NOT NULL default '0',
nid int unsigned NOT NULL default '0',
timeslot_length int NOT NULL default '1',
num_volunteers int NOT NULL default '1',
timeslots_organizers varchar(255) NOT NULL default '',
timeslot_data longtext NOT NULL default '',
PRIMARY KEY (nid, vid),
KEY vid (vid)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
break;

As I use mysql and not mysqli, is that the issue, that there isn't an install script for mysql? (again, I may be way off base here, I just know what errors I'm getting).

Thanks again in advance!

irbk’s picture

Or, as the error has to do with the "timeslot_data" having a default length, could I change

 timeslot_data longtext NOT NULL default '',

to

 timeslot_data longtext NOT NULL,

with out screwing up anything?

Thanks again.

pwolanin’s picture

Category: support » bug

Yes, this is apparently a bug in the schema that generates the warning on MySQL 5. The install code should be changed to remove the default value as you suggest.

irbk’s picture

Alright, that worked! Excellent!

However, it opens up another issue that is also talking about a default value? Should I post it here or as it may not be related to an install issu, should I open up a new bug?

pwolanin’s picture

post it here- even if somewhat unrelated, we can try to get all these little bugs at once.

pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new1.78 KB

here's an untested patch as a starting point.

irbk’s picture

Ok, here is the next catch that may or may not be related to the earlier issue.
I edit the install file as we discussed earlier, to remove the default value. The module then seems to install correctly.
Here are the steps I follow
1. Create content >> Event with volunteer timeslots
2. Give the event a title, organizer, and volunteer event description
3. Submit the event. I'm now brought to the event and everything seems ok. I can see and access the event in my "upcoming events" menu item and all is good, as long as I don't add any volunteers.
4. When I add volunteers, then click "submit" I get the following error

user warning: Field 'log' doesn't have a default value query: INSERT INTO node_revisions (nid, vid, title, body, teaser, timestamp, uid, format) VALUES (33, 36, 'Test', 'Test', 'Test', 1179500637, 1, 1) in C:\Inetpub\wwwroot\drupal\includes\database.mysql.inc on line 172.

Also at this point, I can no longer edit, update, delete, or anything else with the event. While I still see the event in my Upcoming Events menu, if I click on it, it does not display. If I try to delete, update, etc through content management, it won't do anything with the content.

Let me know if I can be of more help.

Thanks agian!

pwolanin’s picture

What version of Drupal are you running? Do you have this problem with other content types?

irbk’s picture

Running

Drupal 5.1
MySQL 5.0.37
PHP 5.2.1

irbk’s picture

No, I don't have this prople with anything other then the timeslots with volunteer content

irbk’s picture

No, I don't have this problem with anything other then the timeslots with volunteer content

pwolanin’s picture

Looks like you are experiencing this Drupal bug due to MySQL 5.0: http://drupal.org/node/100850

Maybe because this content type has revisions turned on by the install code.

try updating to the latest 5.x: http://drupal.org/drupal-5.x-dev

irbk’s picture

I'll download it and give it a try. This will be my first Drupal "upgrade" so I'm not quite sure what to expect.

irbk’s picture

I upgraded to the snapshot release for 5-21-07 of Drupal. After following the upgrade instructions, I went back in to try and add a volunteer to a new event. Looks like it added the users with out error. That's execellent! One last question. As an event administrator, when I add "volunteers" to an event, is there a way to get the module to automatically send a notification e-mail to the volunteer stating something like " has volunteered you for to "? It would make me 1 happy camper if there was a way to do that! Thanks for all your help.

pwolanin’s picture

This code does not notify someone who gets "volunteered", but that would not be too hard to add.

Why don't you look at this function: _timeslots_signup_form_submit($form_id, $form_values)

And submit a separate issue as a feature request.

irbk’s picture

Please forgive me, I don't understand what you mean by
look at this function: _timeslots_signup_form_submit
Could I get a little further explination on this? I'm brand new to this.

Thanks.

pwolanin’s picture

In the module code, this is the function that would need to be modified to add the functionality you suggest.

If you know some PHP, you might be able to contribute a starting patch. If not, you should at least identify in the feature request this function, so anyone else joining in will know where to start looking. Probably we'll also have to add a check box to the form as well.

irbk’s picture

Ahh, got you! I know a bit of PHP so I'll take a peak at it and see if I can come up with some suggestions!

pwolanin’s picture

committed the patch in #7

pwolanin’s picture

Status: Needs review » Fixed
pwolanin’s picture

Status: Fixed » Closed (fixed)