We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Unknown column 'order' in 'order clause'

How Do I?

DoctorLove's avatar
DoctorLove
38 posts
10 years ago
DoctorLove's avatar DoctorLove

Hello,

we’ve recently updated a website to EE 2.9.3, but when linking to an non existent page, it should redirect to a 404 page. Instead, we get this:

Error Number: 1054

Unknown column 'order' in 'order clause'

SELECT `route_parsed`, `template_name`, `group_name` FROM (`exp_templates`) JOIN `exp_template_routes` ON `exp_templates`.`template_id` = `exp_template_routes`.`template_id` JOIN `exp_template_groups` ON `exp_templates`.`group_id` = `exp_template_groups`.`group_id` WHERE `route_parsed` is not null AND `exp_templates`.`site_id` = '1' ORDER BY `order`, `group_name`, `template_name` ASC

Filename: libraries/Template_router.php

Line Number: 83

Now, I checked the database and there is indeed no ‘order’ in exp_templates. To know what type this field should be, I did a clean install elsewhere on 2.9.3 and noticed this field isn’t there at all. The request to it though, in Template_router.php, is.

Any ideas?

Thanks!

       
airways's avatar
airways
154 posts
10 years ago
airways's avatar airways

The order column is on the template_routes table, which is joined to in that query.

If you’re upgrading then maybe this table is empty? That would certainly count as a bug.

Try going to Design > Templates > Template Route Manager and click the “Update” button at the bottom. This should update the contents of the template_routes table to have values for your templates.

If this doesn’t work, you may want to submit a bug to the bug tracker, which you may want to do anyway.

       
DoctorLove's avatar
DoctorLove
38 posts
10 years ago
DoctorLove's avatar DoctorLove

Thanks for your response.

The table itself is not empty, but the order field doesn’t exist in it. I tried to do as you said (update the template route manager), but when I go to the Template Route Manager page, it gets me this error:

Error Number: 1054

Unknown column 'order' in 'order clause'

SELECT `route_parsed`, `template_name`, `group_name` FROM (`exp_templates`) JOIN `exp_template_routes` ON `exp_templates`.`template_id` = `exp_template_routes`.`template_id` JOIN `exp_template_groups` ON `exp_templates`.`group_id` = `exp_template_groups`.`group_id` WHERE `route_parsed` is not null AND `exp_templates`.`site_id` = '1' ORDER BY `order`, `group_name`, `template_name` ASC

Filename: libraries/Template_router.php

Line Number: 83

So yeah, pretty much the same error 😊 I could just add a ‘order’ field to this table myself, using Sequel Pro, but I need to know the correct type of this field.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.