When clicking in a link which url should be redirected by secure pages from http to https, I get the following error while having normal caching enabled and now issue when caching is disabled:

Fatal error: Call to undefined function drupal_get_path_alias() in /path/to/site/sites/all/modules/securepages/securepages.module on line 315

Comments

jadwigo’s picture

Something similar happened here: http://drupal.org/node/119009

Adding this after line 314 helps..

  // If cache is enabled we need to load the path system
  if (variable_get('cache', CACHE_DISABLED) != CACHE_DISABLED) {
    drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
  }

But then, a full bootstrap seems excessive :(

jadwigo’s picture

Priority: Normal » Critical

This is actually a critical issue for this module, because anonymous visitors will see raw php error messages if they get to a page that should be redirected.

ebeyrent’s picture

I applied this patch and it solved the issue for me.

gordon’s picture

Status: Active » Fixed

Fixed.

Status: Fixed » Closed (fixed)

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

agschult’s picture

Status: Closed (fixed) » Active

Erm, the fix made in

http://drupalcode.org/viewvc/drupal/contributions/modules/securepages/se...

seems broken. It's causing problems with redirecting to the front page sometimes, because the function_exists('drupal_get_path_alias') check should be directly around the "$path = drupal_get_path_alias($path)" line, as to note fall back to the front page in these situations

grendzy’s picture

Status: Active » Closed (won't fix)

The 5.x branch is no longer supported. If this issue is still present in a current version of Secure Pages, please update the issue summary, change the version field, and re-open the issue.