1 reply [Last post]
flyerstarter's picture
Offline
Joined: 02/18/2012
Juice: 4
Was this information Helpful?

I have Drupal 6/PHP 5.3.3 running Ubercart 6.x-2.4 with the recent products module v 6.x-1.0 running on my site and each time someone hits a product page I am getting errors to the effect of:

PHP Fatal error: Call to undefined function arg() in /home/web/acquia-drupal/sites/all/modules/uc_recently_viewed/uc_recently_viewed.module on line 29

Investigating source I see this:

function load_recently_viewed() {

if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));
if (uc_product_is_product($node) && $node->status == 1) {
if (isset($_SESSION['uc_recently_viewed']) && in_array($node->nid, $_SESSION['uc_recently_viewed'])) {
$_SESSION['uc_recently_viewed'] = array_diff($_SESSION['uc_recently_viewed'], array($node->nid));
}
$_SESSION['uc_recently_viewed'][] = $node->nid;
if (count($_SESSION['uc_recently_viewed']) > 30) array_shift($_SESSION['uc_recently_viewed']);
}
}
}

Its been filling up my log files for some time now. Does anyone have a fix for this?

-Mike

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3229
Re: UC recently viewed module is producing errors - call to unde

arg() is a core Drupal function. http://api.drupal.org/api/drupal/includes%21path.inc/function/arg/6
If that's not being found, your site is messed up.

<tr>.