Countdown module requires curl, but doesn't intelligently say so

Bug #458941 reported by Tony Yarusso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UD Countdown
Fix Released
Undecided
Michael Lustfield

Bug Description

If this module is used on a stock Ubuntu LAMP setup, running Drupal's cron script will fail. The result is a white screen with a PHP error, "call to undefined function curl_init() on line 140 of drupal.module". After installing the php5-curl package and restarting apache, it works.

Fixes:
Either there's something in the code that should check for this and behave another way if it can in fact survive without curl, or

It needs to fail gracefully by refusing to install properly in Drupal initially, explaining that the php5-curl package is necessary for it to run.

Revision history for this message
Pierre Buyle (mongolito404) wrote :

Availability of curl could be check in hook_requirements[1] with something like

$t = get_t();
$requirements = array();

$curl_version = function_exists('curl_version') ? curl_version() : false;
$requirements['udrc_curl'] = array(
  'title' => $t('cURL'),
  'value' => $curl_version,
  'description' => $('The Ubuntu Drupal Release Countdown module requires the cURL library.'),
  'severity ' => $curl_version === false ? REQUIREMENT_ERROR : REQUIREMENT_INFO
);

[1] http://api.drupal.org/api/function/hook_requirements/6

Revision history for this message
Michael Lustfield (michaellustfield) wrote :

Pierre, thanks for getting the solution so fast. Feel free to make the changes if you'd like or else you can assign this to me.

Changed in ubuntu-drupal-countdown:
assignee: nobody → Pierre Buyle (mongolito404)
status: New → Confirmed
Changed in ubuntu-drupal-countdown:
assignee: Pierre Buyle (mongolito404) → Michael Lustfield (mtecknology)
status: Confirmed → In Progress
Revision history for this message
Michael Lustfield (michaellustfield) wrote :

This is fixed in r38. I also added a wget requirement.

Thanks for pointing me to the page and giving me an example. :)

Changed in ubuntu-drupal-countdown:
status: In Progress → Fix Committed
Revision history for this message
Michael Lustfield (michaellustfield) wrote :

This fix has been merged into drupal.org.

Changed in ubuntu-drupal-countdown:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.