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

Error with Channel module category_tree method

Developer Preview

Focus Lab Dev Team's avatar
Focus Lab Dev Team
1,129 posts
about 14 years ago
Focus Lab Dev Team's avatar Focus Lab Dev Team

Not sure where the logic is going so I don’t have a fix here. On a page with the categories tag pair in the channel module I received the following error:

A PHP Error was encountered Severity: Notice Message: Undefined variable: channel_ids Filename: channel/mod.channel.php Line Number: 5832

I tracked it down to the following code:

if (count($channel_ids) && $strict_empty == 'yes')
{
 $sql .= "AND exp_channel_titles.channel_id IN ('".implode("','", $channel_id)."') ";
}

Two notes:

1) The variable “channel_ids” isn’t defined at all at this point. However, “channel_id” (no “s”) is defined. 2) I noticed in the 2.4 diff that the old code just checked if $channel_id was an empty string. So for now I reverted back to that so my page functions as expected.

I’m certainly interested in what the intended logic is here. My guess is that somewhere along the way $channel_id is supposed to be an array, but I wasn’t sure.

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
about 14 years ago
Kevin Cupp's avatar Kevin Cupp

Thanks for catching this, Erik. We added the ability to specify multiple channels in the channel:category and category_archive tags, and apparently missed a couple variable changes. Changing occurrences of “channel_id” to “channel_ids” on these lines should fix it:

5466 5749 5832

Thanks again! Kevin

       
Focus Lab Dev Team's avatar
Focus Lab Dev Team
1,129 posts
about 14 years ago
Focus Lab Dev Team's avatar Focus Lab Dev Team

Great. Thanks Kevin

       

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.