In function merci_check_content_type_restrictions the max hours isn't returning an error. Instead it moves on to checking for item level conflicts...

 // Make sure the item still passes content type restrictions.
            $type_settings = merci_load_content_type_settings($type);
            $restrictions = merci_check_content_type_restrictions($type_settings, $start, $end);

            if (!empty($restrictions)) {
              $message = '';
              foreach ($restrictions as $restriction) {
                $message .= '<div>'. strtr($restriction, array('%name' => theme('placeholder', $title))) .'</div>';
              }
            } 

This was a really frustrating error because it told users that there was a conflict, but would show a conflict grid with no conflicts. The real error was that it exceeded the max hours, but since that wasn't returned MERCI went on to check for conflicting reservations.

The logic behind structuring the code to check for error like exceeding the max validation first is that if there is an error there, we don't need to check the more resource consuming checks.

As it stands, the current release does not validate correctly.

Comments

kreynen’s picture

Assigned: Unassigned » darrick
darrick’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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