If this is your first visit, check our documentation. To post, register or login.
Forums / Bug Reports / [Done 1.3.5] zone_name Bug - e.g. London & Londonderry

[Done 1.3.5] zone_name Bug - e.g. London & Londonderry

Locked

Started by imac on 25 Jul 2006, 6:05 PM · Views: 2,856

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
25 Jul 2006, 6:05 PM
#1
imac avatar

imac

New Zenner

Join Date:
Mar 2006
Location:
Durham, UK
Posts:
78
Plugin Contributions:
0

[Done 1.3.5] zone_name Bug - e.g. London & Londonderry

PROBLEM:
Create 2 zones for a country with zone_name as one word (no spaces) where the first characters of the zone_name are identical e.g. London and Londonderry.

In my case:
zone_name = Londonderry, zone_id = 329
zone_name = London, zone_id = 332

Now, try to create an account with zone_name London. The account will be created but the zone_name entered will be Londonderry - the first on the list in zone_id order.

Now try to edit the address book entry to London. This works OK in Admin, but trying to do it from the customer's end returns the error:

Please select a County/State from the County/State drop-down menu below.

BUG APPLIES TO:
1.2.7d certainly, but a previous report of the same bug by profitshock http://www.zen-cart.com/forum/showthread.php?t=33138 suggests it's also in the 1.3 series.

PARTIAL SOLUTION:
In Admin, insert a space into one of the zone_names e.g. change London to London Town.

Trouble is that London is one of the biggest customer bases in the UK, so any discouragement to registering an account is quite a problem. Any comments or ideas for fixes would be much appreciated.

29 Jul 2006, 10:05 AM
#2
imac avatar

imac

New Zenner

Join Date:
Mar 2006
Location:
Durham, UK
Posts:
78
Plugin Contributions:
0

Re: [Done 1.3.5] zone_name Bug - e.g. London & Londonderry

Well then...

I've checked out 1.3.0.2 and it has exactly the same bug. What's more surprising is so does osCommerce :shocking:

On the oscCommerce forum I found this post from Thomas Steven:
http://forums.oscommerce.com/index.php?showtopic=130454&st=20&p=536359&#entry536359

Apparently, the SQL $zone_query -

$zone_query = tep_db_query("select distinct zone_id
from " . TABLE_ZONES . "
where zone_country_id = '" . (int)$country . "'
and (zone_name like '" . tep_db_input($state) . "%'
or zone_code like '%" . tep_db_input($state) . "%')");

  • is actually looking for a zone_name that has the same first characters as the input. So it's no surprise that when it finds 2 (London and Londonderry) it gets its nickers in a right old twist.:smile:

Thomas suggests changing this line:
and (zone_name like '" . zen_db_input($state) . "%'
to:
and (zone_name = '" . zen_db_input($state) . "'
or zone_name like '" . zen_db_input($state) . "'

I've searched the Zen 1.3.0.2 code and there seem to be 3 files using $zone_query = "select distinct zone_id ...

includes\modules\create_account.php
includes\modules\pages\address_book_process\header_php.php
includes\modules\checkout_new_address.php

I tried changing one of these files: includes\modules\create_account.php
That seems to solve the problem - but I don't know what repercussions that could have on the rest of Zen Cart operations.

I don't know exactly what the other 2 files do and if they need changing or not. But whilst sorting this out I noticed another issue with addresses in 1.3.0.2 which is currently ongoing on: http://www.zen-cart.com/forum/showthread.php?t=40630&page=2&highlight=change+shipping+address+tax

Upshot is that I won't be attempting to change the other 2 files until the tax issue has been resolved and I have a stable base to experiment on.

15 Aug 2006, 2:07 PM
#3
mrmarcus66 avatar

mrmarcus66

Zen Follower

Join Date:
Oct 2004
Location:
England
Posts:
109
Plugin Contributions:
0

Re: [Done 1.3.5] zone_name Bug - e.g. London & Londonderry

I am affected by this bug can the core team please advise. The website I have this issue with is https://www.skintightrubber.com.

Regards
Mark.

15 Aug 2006, 11:09 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: [Done 1.3.5] zone_name Bug - e.g. London & Londonderry

There are a number of files involved with this fix. It will be included in the next release.

.
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.