I upgraded to 6.x-1.1 the other day and now I can no longer views the status report pages or the module settings page. I get:

Fatal error: Call to undefined function _advagg_build_url() in /myserverdirectory/mydirectory/sites/all/modules/advagg/advagg.install on line 524

I've cleared the caches, ran update, etc. and the errors do not go away.

Comments

mikeytown2’s picture

Status: Active » Fixed
StatusFileSize
new624 bytes

This patch should fix the issue; please re-open if it does not.

Also try re-copying advagg.module over as this contains a newly created _advagg_build_url function.

Chad_Dupuis’s picture

After patching and re-copying I still get the same error:

Upon viewing status report:
Fatal error: Call to undefined function _advagg_build_url() in /myserver/dir/sites/all/modules/advagg/advagg.install on line 524

Upon trying to view /admin/settings/advagg
Same thing...

Chad_Dupuis’s picture

Status: Fixed » Active
mikeytown2’s picture

Status: Active » Postponed (maintainer needs more info)

Can you verify this for me, that the _advagg_build_url() function is in your advagg.module file (should be at the bottom of it)? I can not repo this bug.

Chad_Dupuis’s picture

Seems to be there:

tail -n50 advagg.module 
  if (strpos($file, '/advagg_') !== FALSE && !empty($type)) {
    $return = array(
      'Content-Length: ' . filesize($file),
      'Cache-Control: ' . 'max-age=31556926, public',
    );
    if ($type == 'css') {
      $return[] = 'Content-Type: text/css';
    }
    if ($type == 'js') {
      $return[] = 'Content-Type: text/javascript';
    }
    return $return;
  }
}

/**
 * Helper function to build an URL for asynchronous requests.
 *
 * @param $filepath
 *   Path to a URI excluding everything to the left and including the base path.
 */
function _advagg_build_url($filepath = '') {
  global $base_path;

  // Server auth.
  $auth = '';
  if (isset($_SERVER['AUTH_TYPE']) && $_SERVER['AUTH_TYPE'] == 'Basic') {
    $auth = $_SERVER['PHP_AUTH_USER'] . ':' . $_SERVER['PHP_AUTH_PW'] .'@';
  }

  // Host.
  $ip = variable_get('advagg_server_addr', FALSE);
  if ($ip == -1) {
    $ip = $_SERVER['HTTP_HOST'];
  }
  elseif (empty($ip)) {
    $ip = empty($_SERVER['SERVER_ADDR']) ? '127.0.0.1' : $_SERVER['SERVER_ADDR'];
  }

  // Port.
  $port = '';
//   if (   isset($_SERVER['SERVER_PORT'])
//       && is_numeric($_SERVER['SERVER_PORT'])
//       && ($_SERVER['SERVER_PORT'] != 80 || $_SERVER['SERVER_PORT'] != 443)
//         ) {
//     $port = ':' . $_SERVER['SERVER_PORT'];
//   }

  return 'http://' . $auth . $ip . $port . $base_path . $filepath;
}
mikeytown2’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new376 bytes

give this patch a try.

Chad_Dupuis’s picture

That did it, although I applied that over top of the previously patched file if that helps you in anyway ..... At this point I can get into admin, etc. Thanks!

Chad_Dupuis’s picture

Now I'm seeing a previously reported bug (I believe) in the status report:

Adv CSS/JS Agg - Async Mode Flush your caches
You need to flush your menu cache. This can be done near the bottom of the performance page. If this does not fix the issue copy this info below when opening up an issue for advagg:

I've flushed multiple times and still get the error - doubt this is related though...

mikeytown2’s picture

Status: Needs review » Fixed

Thanks for the feedback, committed #6

Status: Fixed » Closed (fixed)

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