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

adwuk’s picture

Issue summary: View changes

I 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?

adwuk’s picture

Version: 7.x-2.0-rc1 » 7.x-2.0
darrick’s picture

Do you mean the auto checkin feature which is run on cron?

adwuk’s picture

I think it must be run by cron, yes.

darrick’s picture

A 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.

  • darrick committed 29abb57 on 7.x-2.x
    Issue #1826448 by @veades: Auto checkin for reservation item failing.
    
darrick’s picture

Status: Active » Needs review

Committed a fix for this. Please test.

darrick’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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