Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / error line 1054 after upgrading database, why??

error line 1054 after upgrading database, why??

Locked

Views: 1,300

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
4 Feb 2010, 9:01 PM
#1
tlyczko avatar

tlyczko

Zen Follower

Join Date:
Dec 2003
Location:
UPstate NY
Posts:
398
Plugin Contributions:
1

error line 1054 after upgrading database, why??

I have tried to find what causes this error 1054, which seems pretty common.

My error code is this:

1054 Unknown column 'o.orders_status' in 'where clause'
in:
[select count(*) as total from (orders s, orders_status o ) left join orders_total ot on (o.orders_id = ot.orders_id) where (o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total') ]

This is different than all the other forum posts I found on this topic.

This was a 1.2.x database upgraded to 1.3.8, using 1.3.8a code with all security patches plus additional bug patches as explained in the forums.

It occurs in admin when I click 'Orders' on the 'Customers' menu.

All the data upgraded/transferred properly, and a files search within the admin folder produced no results.

How can I fix this??

Thank you, Tom

4 Feb 2010, 9:29 PM
#3
tlyczko avatar

tlyczko

Zen Follower

Join Date:
Dec 2003
Location:
UPstate NY
Posts:
398
Plugin Contributions:
1

Re: error line 1054 after upgrading database, why??

I had already applied this bugfix before importing and upgrading the database.

The above-mentioned bugfixes that I applied are the ones listed in the forum thread provided.

This error is related to orders_status somehow.

My bug is not the exact same as described in that forum thread.

Specific step to reproduce is click the 'Orders' menu item under the word 'Customers,' the error message instantly appears.

Thank you, Tom

4 Feb 2010, 10:18 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: error line 1054 after upgrading database, why??

Then that indicates that your "orders_status" table structure has been damaged.
Or, you or someone has altered the code which draws the admin orders page, perhaps orders.php or one of its dependencies.

4 Feb 2010, 10:58 PM
#5
tlyczko avatar

tlyczko

Zen Follower

Join Date:
Dec 2003
Location:
UPstate NY
Posts:
398
Plugin Contributions:
1

Re: error line 1054 after upgrading database, why??

I can try:

  1. double-checking that I did the "s and o" bugfix correctly within orders.php
  2. re-importing the orders_status table
  3. trying out a new unpatched orders.php, then applying the patches etc.

However, I would really like to know where within the ZC code this select statement is created!! :)

Thank you, Tom

4 Feb 2010, 11:09 PM
#6
drbyte avatar

drbyte

Sensei

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

Re: error line 1054 after upgrading database, why??

tlyczko:

However, I would really like to know where within the ZC code this select statement is created!! :)
It's built from those exact same lines as indicated in the bugfix I pointed you to: from 715-750 of /admin/orders.php.

You're probably confused by the "select count ..." difference in the beginning of the query -- that's done by the split-page class which hacks off the front list of field names from the query in order to get a count of applicable records so it can give you pagination links. There's nothing wrong with the way it's doing that. Your problem is with whatever's after the word "from" in whatever alterations you've done to it.

Or, you've got bad database content. If that's the case, you'll have a number of odd problems even on the storefront, too.

I hope you did this on a test area, and not directly on your live site ... right?

4 Feb 2010, 11:28 PM
#7
tlyczko avatar

tlyczko

Zen Follower

Join Date:
Dec 2003
Location:
UPstate NY
Posts:
398
Plugin Contributions:
1

Re: error line 1054 after upgrading database, why??

It's a test site -- I had never before done a database install. :)
I can actually see/read the orders_status table from phpmyAdmin or mySQL Manager (or whatever is the new mySQL admin software).
I can see orders information if I look at them via different other routes.
I just can't see them by clicking on that 'Orders' link under 'Customers,' I never would have known about this if I had not clicked it...
I think I remember seeing a split-pages bugfix, I will check for that, whether I applied it or not, etc.
I'll see if split pages works for listing out customers per se, I bet it does, but I could certainly be wrong. :) :)
Knowing how/where the query is derived helps narrow down what to look for to fix things.
I have no addons installed, just the various bugfixes, I documented which bugfixes I did.
It won't get applied to a live site until I have created a new test/dev working site with all the old data in it etc.
I'll get to this tomorrow or during the weekend and I'll try to remember to update this thread.
Thank you again for responding so quickly!! :) :)
Thank you, Tom

5 Feb 2010, 3:13 PM
#8
tlyczko avatar

tlyczko

Zen Follower

Join Date:
Dec 2003
Location:
UPstate NY
Posts:
398
Plugin Contributions:
1

Re: error line 1054 after upgrading database, why??

I reviewed everything several times and did more trial and error etc.
I discovered I had originally mis-read the order status/id s and o fix, corrected it, and now it is working.
I had changed only the s and o without also reversing the orders status and id fields per se in the clauses.
It took a while to figure this out.
Thank you, Tom