Commit 7f7bafe9 authored by Robert Rollins's avatar Robert Rollins

Issue #2127549: Fixed a protential error state in the upgrade path from v1.x.

User oskar_calvo discovered that if you update Date iCal from 1.x, but
don't also install the Libraries module, you'll get a fatal error when Date iCal
attempts to check for the iCalcreator library, because the libraries_detect()
function doesn't exist.

Now, you'll instead see an error in the site requirements.
parent cd17423a
......@@ -13,8 +13,20 @@ function date_ical_requirements($phase) {
// Ensure translations don't break at install time.
$t = get_t();
switch ($phase) {
case 'runtime':
if ($phase == 'runtime') {
if (!function_exists('libraries_detect')) {
$requirements['date_ical'] = array(
'title' => $t('Date iCal'),
'value' => $t('Libraries module is not installed.'),
'description' => $t('Date iCal 2.x and above require the Libraries module. Please install it from !here.',
array('!here' => l('here', ''))
'severity' => REQUIREMENT_ERROR,
// Return immediately, since we can't even attempt to determine if iCalcreator is installed.
return $requirements;
$library = libraries_detect('iCalcreator');
if ($library && !empty($library['installed'])) {
$requirements['date_ical'] = array(
......@@ -33,7 +45,6 @@ function date_ical_requirements($phase) {
'severity' => REQUIREMENT_ERROR,
return $requirements;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment