Duplicate Event Category

Home Forums Calendar Products Events Calendar PRO Duplicate Event Category

Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #20432
    moderntribe
    Participant

    Hi, Bob!
    I’m the lead dev on The Events Calendar and would love to help you get this figured out. I want to make sure I understand your last post: There is a row (or more) in the wp_cms_term_taxonomy table that has a term_id that doesn’t match any of the term_ids in the wp_cms_terms table? If so, ignore the rest of this post and let me know. Otherwise…:
    The way WordPress works, every term/category MUST have a unique slug (regardless of whether it is an events category of a post category). When you create a new Events Category that has the same name/slug as an already existent Post Category, WordPress simply assigns that term to the same already-existing category name, and in the process, the same slug as well. What this means is that both the Event and Post category are tied to the same name and slug indefinitely (notice, you change one’s name/slug, and it will change the other’s—go ahead, try it!). If, however, you create an Event category and assign it the same name BUT a different slug from the Post Category, it will create an entirely new linked name and slug (meaning the two categories will forever NOT be tied together).
    I am 95% sure this is a WordPress thing and not an Events Calendar thing (though I will investigate further to confirm). How should WordPress have been designed to handle it? It should allow multiple slugs to share the same name as long as they’re from different taxonomies and it should NEVER link two categories to the same name/slug just because it already exists.
    What does it all mean for you? Probably when one of the categories was first created, it either had a different name or a different slug from the other one, and thus they were not tied together and also forced to not share a slug. If you don’t mind them having the exact same name and slug forever, the problem should be able to be fixed by deleting one of them, and then creating a new one with the exact same name and slug as the other, thus making two categories that are linked to the same name and slug (and will forever be so). If you don’t want to delete one, or have a problem with them being linked indefinitely, then there isn’t much else you can do other than assign a different slug to one of them.
    Let me know if that all makes sense to you and if it helps you to find a solution to your problem. Good luck!

    #20440
    Bob
    Participant

    First, no, the event category I’m trying to resolve has a term_id in the wp_cms_term_taxonomy table that does match a term_id in the wp_cms_terms table.

    Regarding the the first behavior you explained, that’s exactly what we want. That is, we want a Posts category and an Events category to share the same term/slug. And, indeed, we have at least one other category where they do share. So it may be that the significant difference was whether they actually shared the same name when they were created. I’ll go see if I can delete and recreate one of them so that they share both name and slug, and I’ll report back here.

    #20441
    Bob
    Participant

    Looks like that was the key. Event Category name and slug had to both match the existing Post Category name and slug at creation time, then the term/slug was shared.

    I think you’re saying this behavior is not specific to The Events Calendar, so going in the opposite direction this would be true as well, correct? Or, presumably, any other Category created in any other Taxonomy? (Sorry if I’m getting the terms wrong or jumping to conclusions.)

    #20444
    moderntribe
    Participant

    Yes, going either direction should cause the same effect (not 100% sure on this, but darn close to).

    #20601
    Jonah
    Participant

    Hey Bob, are you all set here? Just wanted to check in…

    – Jonah

    #977076
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 6 posts - 16 through 21 (of 21 total)
  • The topic ‘Duplicate Event Category’ is closed to new replies.