Extension, Module

Archived
Forum
(read-only)

Member categories

ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6

Back to this add-on's main page
View Other Add-ons From Yuri Salimovskiy

     

Error - No Category Provided

Support Request

Todd Richards
Todd Richards

I’ve got two category groups that are being used.  On one page I’m listing all of the categories that a member belongs to using the following

{exp:member_categories:categories category_group="11|3|4"}
<li><a href="{path=/members/groups/{category_url_title}}">{category_name}</a></li>
{if no_results}none{/if}
{
/exp:member_categories:categories} 

This works correctly, and I have tested by removing and adding back a category for them.  When the user clicks on one of the categories listed, it goes to another page to a) check that they have access and b) display the list of entries.  Here is the code that is being used.

{exp:member_categories:check category_id="{segment_3_category_id}"}

 {exp
:channel:entries channel="my_channel"
 
category="{segment_3_category_id}"
 
status="Open"
 
dynamic="no"
 
limit="100"
 
paginate="bottom"
 
}

     Display the content 
if they have access to it....

 
{/exp:channel:entries}

{
/exp:member_categories:check} 

When the user clicks on one of the categories from Group A, it pulls up the items as it should.  However, if they click on one of the categories from Group B, we see the error message “Error - No Category Provided”.  If I add in errors=“no”, the page comes up but with nothing listed.  I have tested this myself as a super admin (with access to all of the categories).

ADDITIONAL TESTS

If I replace the segment_3_category_id with the corresponding category number (regardless of whether it’s from Group A or Group B), then the content displays like it should.

I added another category to the Group A (group that is working) that is nearly identical to one from Group B (group that isn’t working), and that one worked as it should. 

Is there a problem using multiple groups?  Any other thoughts on what is happening?

Todd

Yuri Salimovskiy
# 1
Developer
Yuri Salimovskiy

Hi Todd,

it looks like {segment_3_category_id} does not have correct value until the time is passed to the module.
Try using category_url_title parameter instead of category_id

Todd Richards
# 2
Todd Richards

Hi Yuri -

Yes, that is what I was thinking too.  However, it works for a lot of them so that’s what perplexed me.  I forgot to mention that I did try category_url_title as well.  The same thing is happening in the Library channel (with 45 categories).  Most of them work fine but a few give me the same error message. And like the one above, it’s the same categories that are giving the error.  It would be different if it were random but it’s not.

Todd

Yuri Salimovskiy
# 3
Developer
Yuri Salimovskiy

It could also be related to Mo’ Variables (or whatever add-on is giving you {segment_3_category_id} variable). Does {segment_3_category_id} actually give you correct ID?

Todd Richards
# 4
Todd Richards

It’s LowSeg2Cat.  For the ones that are working correctly, {segment_3_category_id} is giving me the correct values.  The ones that aren’t, no value is being give.  I’d really like to keep the URLs “clean” (without the category ID), but the {category_url_title} isn’t working either.  :( 

Again, it’s so strange that most work but some don’t.  If I remove the {exp:member_categories:check}, then of course it works without error.  But that doesn’t quite serve the purpose.

Yuri Salimovskiy
# 5
Developer
Yuri Salimovskiy

So you are either not passing correct url_title as 3rd URL segment, or there is a bug in Seg2Cat, not in Member Categories. In that case, file a support request to Low.