If we try to book a non-english room from the admin/store/orders/create the autocomplete field returns the nid of the node selected and when we try to book, an error message appears. The reason is that when having nodes with translated content, the UC Hotel module uses the source nid and not the actual nid of the node we are looking for. This can be fixed if go to file hotel_booking.edit.inc and look for the function hotel_booking_room_autocomplete and replace lines 475-479 with the following:

if(module_exists('i18n')){
  $res = db_query(db_rewrite_sql("SELECT DISTINCT n.tnid as nid, n.title, n.language
                         FROM {node} n
                         WHERE n.type = 'hotel_room_type'
                         AND n.status = 1
                         AND n.title LIKE '%%%s%%'"), $string);
}else{
    $res = db_query(db_rewrite_sql("SELECT DISTINCT n.nid, n.title, n.language
                         FROM {node} n
                         WHERE n.type = 'hotel_room_type'
                         AND n.status = 1
                         AND n.title LIKE '%%%s%%'"), $string);
}

Also, in hotel_booking.ca.inc just before line 157 we must add the following code

if(module_exists('i18n')) {
  $nid = db_result(db_query("SELECT tnid FROM {node} WHERE nid=%d", $nid));
}

so that the Condition Action actually does something instead of updating the void.

Sorry for not having the time to file a patch...

PS: Other than that, you have done a really great Hotel Booking solution! Keep it up!

CommentFileSizeAuthor
#2 patch.patch2.26 KBvensires
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Status: Needs review » Needs work

Hi
Can you add this as a patch?
Kind Regards
Lee

vensires’s picture

FileSize
2.26 KB

Your wish is my duty :)

larowlan’s picture

Status: Needs work » Needs review