Indicating equipment is Unavailable doesn't result in it being removed from the inventory as one would expect. Instead, users and able to attempt to make reservations on a buck with no available items and will get a conflict error.

Comments

kreynen’s picture

The problem is actually an issue with buckets with no items showing up in the initial select list. The select list isn't limited dates are added to limit the query. To solve this, I am going to limit the initial select list to bucket with active items by modifying the existing merci_check_existing_bucket_items function.

The current function..

function merci_check_existing_bucket_items($type, $status = FALSE) {
  $where = $status ? ' AND status = 1' : '';
  $existing_items = db_result(db_query("SELECT nid FROM {node} WHERE type = '%s'$where", $type));
  return $existing_items;
}

...only checks the published/unpublished/promoted status in the node table, not the MERCI specific default_availability in the merci_bucket_node (and merci_resource_node?) table(s)?

New buckets with no items or existing buckets where all the items are Always Unavailable for some reason will no longer show up in the select list.

darrick’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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