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

Channel model get_channel_categories method broken

Development and Programming

bmds's avatar
bmds
8 posts
14 years ago
bmds's avatar bmds

I have been working on a module that needs to access a list of the categories assigned to a channel. However calling the get_channel_categories method always returs false. Using db->last_query() returns a query other than the one that should have run so i after looking at the code i constructed the SQL manually and tried it directly on the db:

SELECT cat_id, cat_name FROM `exp_categories` WHERE group_id = 2 ORDER BY cat_name, group_title

The error you get back from the db is:

#1054 - Unknown column 'group_title' in 'order clause'

Looking at the table structure there is no column named even remotely close to this in the categories table. Thinking that it might have been a missed join i checked the category_groups table however the appropriate field is called group_name.

It doesn’t really make sense in the query to order by group_title as all of the categories will be from one group anyway.

       
Dan Decker's avatar
Dan Decker
7,338 posts
14 years ago
Dan Decker's avatar Dan Decker

Hello bmds,

Welcome to the Forums!

This issue is related to Development and Programming and beyond our scope of technical support, so I’m going to migrate this thread to that Community. They may have suggestions or workarounds that can get you moving forward. If you feel you have stumbled upon a bug, you can report it to the Bug Tracker.

Thank you for using ExpressionEngine and happy coding!

       
bmds's avatar
bmds
8 posts
14 years ago
bmds's avatar bmds

Hi Dan Thanks, i do believe it is a bug in ExpressionEngine as that method will fail regardless of the data you provide it as the query that it generates is malformed. In case you are interested the bug is here: https://support.ellislab.com/bugs/detail/16383/

Thanks Barney

       

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.