Undefined index: q in uc_store.module and uc_credit.module ( Clean URLs Turned On )

Project:Ubercart Contributions
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description
Project: 
Ubercart

Getting the following Errors:

[Wed Feb 25 19:56:08 2009] [error] [client 127.0.0.1] PHP Notice: Undefined index: q in /home/user/domains/example.com/public/drupal-6.9/sites/all/modules/ubercart/uc_store/uc_store.module on line 510
[Wed Feb 25 22:47:09 2009] [error] [client 127.0.0.1] PHP Notice: Undefined index: q in /home/user/domains/example.com/public/drupal-6.9/sites/all/modules/ubercart/payment/uc_credit/uc_credit.module on line 227

Version: 
Ubercart 2.0-beta4
webmaker's picture
Offline
Joined: 04/22/2009
Juice: 76
Hi, also get the error

Hi,

also get the error message with the uc_store module sometimes. The line 551 in uc_store looks like the following (I marked line 551 with ####):

/**
* Implementation of hook_exit().
*/
function uc_store_exit() {
  // Save the current request for tracking paths on subsequent page requests.
  // When HTTP_REFERER is set, the session version is not; and vice versa.
  if (referer_uri() == '') {
    $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https' : 'http';
####    $_SESSION['uc_referer_uri'] = $protocol .'://'. $_SERVER['SERVER_NAME'] . $GLOBALS['base_path'] . $_GET['q']; ####
  }
  else {
    if (isset($_SESSION['uc_referer_uri'])) {
      unset($_SESSION['uc_referer_uri']);
    }
  }

  // Save the timestamp of the last access.
  // $_SESSION['uc_last_access'] = time();
}

rennsix's picture
Offline
Uber Donor
Joined: 09/11/2008
Juice: 89
Re: Hi, also get the error
Assigned to:webmaker» rennsix

In the last few days I've had more and more PHP notices spring up on my vps. Also, all of my images are now broken which is very strange/odd. I'm getting the same 551 and 227 error that you are explaining. Does anyone have any ideas of where to look for some troubleshooting info? I have cache disabled in my performance setting.

PHP Notice:  Undefined variable: base_root in /var/www/mysite*/sites/all/modules/securepages/securepages.module on line 192

PHP Notice:  Undefined index:  q in /var/www/mysite*/sites/all/modules/ubercart/payment/uc_credit/uc_credit.module on line 227

Undefined index:  q in /var/www/mysite*/sites/all/modules/ubercart/uc_store/uc_store.module on line 551

Thanks,
Colin

bsenftner's picture
Offline
Joined: 07/09/2009
Juice: 107
#3
Category:» bug report
Assigned to:rennsix» Guest

I just started getting the same "PHP Notice" messages last night, and I see them again just after doing the 6.16 core upgrade.

My messages refer to lines 237 of uc_credit.module and 558 of uc_store.module - both of which are trying to reference $_Get['q']

Ignore? Seems like this issue has been around for a while...!

Installation:
Pressflow Drupal 6.16.77
Ubercart 6.x-22

Host:
dev: OS X 10.6.2 running MAMP Pro 1.8.3
and
live: CentOS release 5.4

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
#4

You need to set your PHP error reporting level to not include Notices. This is the default for PHP 4 and 5. It sounds like this got changed at the same time you upgraded Drupal, but it should be filtering out the notices as well. The Devel module might have changed this, but it's not supposed to be used on a production site anyway.

Leksat's picture
Offline
Joined: 03/05/2011
Juice: 3
#5

Fixed in 6.x-2.x-dev - http://drupal.org/node/593588