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_titleThe 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.
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!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.