We find that items are being left with status "checked out" after reservations are successfully marked as "checked in".
In includes/api.inc the last function merci_add_reservation_items($node) the conditional statement that determines whether or not to update merci_reservation_item_node is evaluating as false, because $node->merci_original_reservation_status is NULL.
e.g.
$item_status == MERCI_ITEM_STATUS_AVAILABLE is true, but $node->merci_original_reservation_status == MERCI_STATUS_CHECKED_OUT is false
We put a work around in our code that checks if the item status in the database is different from the item status in this function, then update the database with the latest status. This meets our needs.
I'm not sure why the logic is included that the item status is only checked in if the original reservation status was previously set as checked out.
But if that logic is important for the overall functioning of the module, then finding out why that value is not set for use in this conditional should be tracked down.
Comments
Comment #1
adwuk commentedI have this same problem. Drupal 7.33 and Merci 7.x-2.0.
Eventhough the reservation is checked in successfully, the resource remains checked out. I can fix it by manually editing the table merci_reservation_item_node and change the value menu_item_status from 2 (checked out) to 0 (available) but the problem reoccurs on the next auto checkin.
I am confused about the field merci_item_status in the table merci_reservation_detail - which has values of -1, 0 and 1.
Any suggestions as to how to progress with this?
Comment #2
adwuk commentedComment #3
darrick commentedDo you mean the auto checkin feature which is run on cron?
Comment #4
adwuk commentedI think it must be run by cron, yes.
Comment #5
darrick commentedA quick look shows the status isn't being updated via cron for the checked out/in item. I'm super busy right now so it will take a while before I have a chance to look into it.
Comment #7
darrick commentedCommitted a fix for this. Please test.
Comment #8
darrick commented