MDL-18375 calendar: added condition to ensure calendar type exists before loading