Permalink
Browse files

MDL-32180 calendar - added developer hint for a missing or unreadable…

… calendar hook file
  • Loading branch information...
1 parent a3ab18c commit d2b46849464d37c61a7e25a6994150117ba05a3f Brian Jorgensen committed with jsnfwlr Apr 3, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 calendar/lib.php
View
@@ -2431,9 +2431,15 @@ public static function calendar_event_hook($action, array $args) {
global $CFG;
static $extcalendarinc;
if ($extcalendarinc === null) {
- if (!empty($CFG->calendar) && file_exists($CFG->dirroot .'/calendar/'. $CFG->calendar .'/lib.php')) {
- include_once($CFG->dirroot .'/calendar/'. $CFG->calendar .'/lib.php');
- $extcalendarinc = true;
+ if (!empty($CFG->calendar)) {
+ if (is_readable($CFG->dirroot .'/calendar/'. $CFG->calendar .'/lib.php')) {
+ include_once($CFG->dirroot .'/calendar/'. $CFG->calendar .'/lib.php');
+ $extcalendarinc = true;
+ } else {
+ debugging("Calendar lib file missing or not readable at /calendar/{$CFG->calendar}/lib.php.",
+ DEBUG_DEVELOPER);
+ $extcalendarinc = false;
+ }
} else {
$extcalendarinc = false;
}

0 comments on commit d2b4684

Please sign in to comment.