PHP version: 5.2.9
Drupal version: 6.16
Bookings API: 6.x-1.0-alpha5
Views: 6.x-2.10
CCK: 6.x-2.6
Date API: 6.x-2.4

I first described this error here:
http://drupal.org/node/809222#comment-3017148

It's not the same as the issue reported there (which was fixed), so I thought it appropriate to create a new issue.

I'm trying to add an availability constraint. When I "Save" the availability I get this (see attached file availability-5.jpg):

"user warning: Table 'fence8_cms.content_type_bookingsapi_resource' doesn't exist query: SELECT drupal_node.nid FROM drupal_node LEFT JOIN content_type_bookingsapi_resource ON drupal_node.vid = content_type_bookingsapi_resource.vid WHERE drupal_node.type = 'bookingsapi_resource' AND content_type_bookingsapi_resource.field_ba_parent_nid = 10 in /home/fence8/public_html/sites/all/modules/bookingsapi/bookingsapi.module on line 1358."

The problem appears to be that the table in my database is named drupal_content_type_bookingsapi_resource, not content_type_bookingsapi_resource. "drupal_" is the value I assigned to the $db_prefix variable in my settings.php file.

CommentFileSizeAuthor
#4 bookingsapi.811906-d6.patch1.66 KBAnonymous (not verified)
#2 bookingsapi.811906-d6.patch1.01 KBAnonymous (not verified)
availability-5.jpg72.26 KBsah62

Comments

Anonymous’s picture

Assigned: Unassigned »

Thanks, I'll look into it. Seems like I forgot some {..} somewhere :)

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

Could you test the attached patch?

sah62’s picture

Patch test result:

user warning: Table 'fence8_cms.content_type_bookingsapi_resource' doesn't exist query: SELECT n.nid FROM drupal_node as n LEFT JOIN content_type_bookingsapi_resource as c ON n.vid = c.vid WHERE n.type = 'bookingsapi_resource' AND c.field_ba_parent_nid = 10 in /home/fence8/public_html/sites/all/modules/bookingsapi/bookingsapi.module on line 1358.

Anonymous’s picture

StatusFileSize
new1.66 KB

Apologies - my bad.. forgot one mistake (attached patch against dev again)

sah62’s picture

Much better - no SQL error! I still get this warning, though:

"Possible conflicts with this availability. Please check the list of bookings."

Is that expected? There are no bookings.

Anonymous’s picture

Status: Needs review » Fixed

Thats okay - if there are no availabilities defined for a resource its impossible to check whether a new availability would conflict, thus the system issues a warning :)

Thanks for the bugreport & check, its committed now :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.