Steps to reproduce:
1) create a booking extending more than 1 night
2) edit the booking by reducing the length of stay 1 or more nights using a new departure date.

Effect: Availability calendar is not updated to clear the removed nights from the booking. The rooms_availability table maintains the original locked event id (booking_id+11) on those dates. I've produced this with a clean install of 7.x-1.3

Cause: rooms_booking.module save() method creates a new BookingEvent instance to clear the original dates, but passes the new end date to the constructor, not the original end date. Start date is handled correctly, hence the steps to reproduce focus on changing the departure date to make stay shorter. Patch to follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ben.hamelin’s picture

Status: Active » Needs review
FileSize
1.48 KB
scalas89’s picture

Hello,

Thank you for the patch, we are going to fix it. I update the patch to avoid the error "Trying to get property of non-object" that occurs when we insert the first booking.

Regards

TheoRichel’s picture

Thanks very much, I seem to have the same problem. Could you tell by the way how to get rid of the errors that are already there? I mean, I am happy to go into the database with PhpMyadmin, but I'd like to know what to delete in which table.

scalas89’s picture

In relation with the discussion here: https://www.drupal.org/node/2374447,
modify the database directly is never a good idea! Anyway I reproduced your situation and i found in database the "corrupted" table. In db there is a table called 'rooms_availability' that contains unit's states; you have to search the unit_id of your unit that presents the bug, the right year and month; change the days corrupted by replacing the value 1 (normally they presents a number > 10).

I hope to solve the problem,

Regards

TheoRichel’s picture

Scalas89: Thank you very much, this worked. Wonderful.
In this table '1' apparently stands for available, but the existence of different numbers here, both positive and negative as well as zero remains a mystery to me

ben.hamelin’s picture

"0" is blocked. Positive numbers greater than 11 represent the booking id (booking_id+11) that is booked for that day. I'm not clear on the negative numbers, and the values 2-11 I believe were reserved for special uses in the future, based on the comments/documentation.

  • scalas89 committed 1547f7d on 7.x-1.x
    Issue #2365039 by ben.hamelin: Fixed availability calendar states while...
GiorgosK’s picture

I see some version of #2 patch included in the latest .dev release 25 of february dev
and post #7 confirms this
why is this still "needs review" ?

scalas89’s picture

Status: Needs review » Closed (fixed)