When trying to change a reservation it is saying it can 't because there is a conflict but the conflicting time is it own previous revision.
All Current version
Drupal 6.25
Date 6.x-2.8

CommentFileSizeAuthor
ensemble046.png145.57 KBiPeat

Comments

iPeat’s picture

using Calendar View, Inventory, Role Rule Override, Staff, and Template Merci modules

iPeat’s picture

seems to be connected to revisions If I delete the old revisions it will save with no conflict

darrick’s picture

That was my guess. Thanks for the report. It will take me a few days to come up with a fix.

iPeat’s picture

Seems sporadic as well but I think I have it narrowed down to the third change with a specific item selected so:
confirm, check out, check in (no errors)
However:
confirm, confirm with items selected, checkout, Check in (Error)

confirm, confirm additional item added, confirm with items selected, checkout, Check in (Error)

confirm,confirm (with items selected), confirm additional item added , confirm with second item selected (Error)

iPeat’s picture

Temporary band aid
As long as you are using the ajax validation via Merci Staff, you should never see the conflict grid anyways.
Just comment out lines 100 to 104 in api.inc

      if (!$count or (empty($item_nid) and merci_type_setting($type) == 'bucket' and $count - $selected_count[$type] < 0)) {
        $messages[$did] = merci_theme_conflict_grid($type, $title, $start, $end, $item_nid, $node->vid);
        form_set_error("merci_reservation_items][$did][merci_item_nid", $messages[$did]);
        continue;
      }
darrick’s picture

Title: Can't change a reservation - Conflicting with itself » Can't change a reservation - Conflicting with itself when revisions are enabled
Status: Active » Needs review

Can you try this patch and see if it works for you?

http://drupalcode.org/project/merci.git/patch/48abfd0

iPeat’s picture

Status: Needs review » Active

The patch seems to be functioning properly.
Thanks for looking at this so quickly with

iPeat’s picture

Status: Active » Needs review
iPeat’s picture

Status: Needs review » Active

Almost there.
Here is the new scenario:
Item is checked out for a full day it comes back early and is checked in.
New reservation is created that item is available and selected. Conflict grid error appears.
Correct the to time on the checked in reservation. Still errors
Delete revisions of the checked in reservation. Works fine

darrick’s picture

Status: Active » Needs review

I've fixed the bug in #9 here: http://drupalcode.org/project/merci.git/patch/1cd1e3f

The bug happens whether or not revisions are used. The conflict code was not checking the status of the reservation (i.e. Pending, Reserved, Checked Out, Checked In) only the time the item was reserved.

Also if revisions were being used the code was looking up the most recent revision.

iPeat’s picture

Initial testing looks good

darrick’s picture

In light of your other issue #1512294: Double Check out Error I'm inclined to revert my fix in #10. As ideally when a reservation is checked back in the staff will correct the checkin date.

iPeat’s picture

We charge for late fees so changing the date due when it comes back isn't something we do. I don't understand why this is ideal, seems like it would skew usage data? I created a separate Checked in date field that is auto completed via a triggered rule on changing the status to Checked in. Anyway seems to be mute see #1512294: Double Check out Error Haven't seen any other issues regarding the conflict grid

darrick’s picture

Okay. I'll hold off on reverting in light of the recent fixes for the other issues.

darrick’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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