Forums / Bug Reports / [DONE v1.3.0.2] SQL Error: Adding New Address Book Entry as Primary Address

[DONE v1.3.0.2] SQL Error: Adding New Address Book Entry as Primary Address

Locked

Started by kamil_tusznio on 12 Jun 2006, 3:43 PM · Views: 4,409

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
12 Jun 2006, 3:43 PM
#1
kamil_tusznio avatar

kamil_tusznio

New Zenner

Join Date:
Jun 2006
Posts:
3
Plugin Contributions:
0

[DONE v1.3.0.2] SQL Error: Adding New Address Book Entry as Primary Address

Hi,

An SQL error occurs when adding a new address as the primary address to the address book. I looked into this and the error occurs in includes/modules/pages/address_book_process/header_php.php around line 222.

Replacing the line

$sql_data_array[] = array('fieldName'=>'customers_firstname', 'value'=>$firstname, 'type'=>'string');

with

$sql_data_array = array( array('fieldName'=>'customers_firstname', 'value'=>$firstname, 'type'=>'string') );

solves the problem as far as I can tell.

Initially, $sql_data_array is created to store data for a query that is performed on the address_book table. Once that query is executed, $sql_data_array is reused to execute another query, but this time on the customers table. The problem is that the variable is not reset and still holds data which corresponds to columns in the address_book table - columns which don't match up to the customers table. :)

Cheers!

-Kamil

12 Jun 2006, 4:17 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [DONE v1.3.0.2] SQL Error: Adding New Address Book Entry as Primary Address

What version of Zen Cart are you using?

What version of php are you using?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 Jun 2006, 4:24 PM
#3
kamil_tusznio avatar

kamil_tusznio

New Zenner

Join Date:
Jun 2006
Posts:
3
Plugin Contributions:
0

Re: [DONE v1.3.0.2] SQL Error: Adding New Address Book Entry as Primary Address

PHP version 4.4.2
Zen-cart version: 1.3.0.1

I was able to reproduce the error on a demo I found here: http://demo.opensourcecms.com/zencart/

Cheers!

-Kamil

12 Jun 2006, 4:25 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [DONE v1.3.0.2] SQL Error: Adding New Address Book Entry as Primary Address

Check the ID on your /pages/address_book_process/header_php.php

  • @version $Id: header_php.php 3160 2006-03-11 01:37:18Z drbyte $

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 Jun 2006, 4:28 PM
#5
kamil_tusznio avatar

kamil_tusznio

New Zenner

Join Date:
Jun 2006
Posts:
3
Plugin Contributions:
0

Re: [DONE v1.3.0.2] SQL Error: Adding New Address Book Entry as Primary Address

@version $Id: header_php.php 3160 2006-03-11 01:37:18Z drbyte $

Cheers!

-Kamil

12 Jun 2006, 4:35 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [DONE v1.3.0.2] SQL Error: Adding New Address Book Entry as Primary Address

Thanks for the confirmation ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 Jun 2006, 6:43 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: [DONE v1.3.0.2] SQL Error: Adding New Address Book Entry as Primary Address

Bug confirmed. The posted fix works.

The correct line number to make the change is line 215, not line 222.

A variation of this fix will be in the next release (v1.3.0.2).

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

31 Mar 2009, 10:20 PM
#8
g33k_chik avatar

g33k_chik

New Zenner

Join Date:
Jun 2007
Location:
TN
Posts:
83
Plugin Contributions:
0

Re: [DONE v1.3.0.2] SQL Error: Adding New Address Book Entry as Primary Address

I have this same issue and I am using 1.3.7.1. My line of code does not look the same and I tried the fix and got a syntax error, so reverted back to what I had before.

My site is www.swansoninc.com

If you want to log in and see the error, you can use the e-mail [email protected] and the password 12345

My line of code was also not on 215 or 222, but it was 209.

My code looks like this:

$sql_data_array = array( array('fieldName'=>'customers_firstname', 'value'=>$firstname, 'type'=>'string') );
```This is under customer_default_address_id in the code. There is another line that looks the same under new_address_book_id.

Can anyone offer assistance on this? I am clueless as to what to do next. Thanks.

0be1's girl. My blood runs g33k.

1 Apr 2009, 4:26 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: [DONE v1.3.0.2] SQL Error: Adding New Address Book Entry as Primary Address

The issue discussed in this thread was fixed in v1.3.0.2.

Further discussion can take place in your other post on the same topic: http://www.zen-cart.com/forum/showthread.php?t=124092

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.