The apt_plugin fails with this PHP error if the profile module isn't enabled:

PHP Fatal error: Call to undefined function profile_load_profile() in /var/www/html/drupal-6.12/sites/all/modules/casaa/plugins/apt_plugin/apt_plugin.module on line 315

By adding a call to module_exists in apt_plugin.module you can handle this error gracefully. Here is a patch:

--- /home/bakomatic/casaa/plugins/apt_plugin/apt_plugin.module	2010-02-26 15:29:49.000000000 -0600
+++ casaa/plugins/apt_plugin/apt_plugin.module	2010-03-31 15:55:43.000000000 -0500
@@ -311,7 +311,7 @@ function apt_plugin_output($script_value
   $output .= 'yld_mgr.request_type="ac";' . "\n";
   $output .= 'yld_mgr.container_type="js";' . "\n";
 
-  if ($user->uid != '') {
+  if ($user->uid != '' && module_exists('profile')) {
     profile_load_profile($user);
     if ($user->profile_gender == 'M') {
       $output .= 'yld_mgr.user_gender = "male";' . "\n";

Comments

cntlscrut’s picture

Assigned: Unassigned » cntlscrut
Status: Active » Patch (to be ported)

Thanks!

cntlscrut’s picture

Status: Patch (to be ported) » Fixed

fix has been applied to the module and is available as of v. 6.x-1.12-rc1

Status: Fixed » Closed (fixed)

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