Support » Plugins » Media Categories 2 – not saving correctly when two categories with same name

  • I am using Media Categories 2 to tag my attachments.

    However there is a big problem. I have two sub-categories with the same name – different parent, different slug, different ID etc.
    If I edit an attachment that is tagged with one of these categories, do not change anything and saves, it tags it with the other category instead, which unlinks it from the page I want to show it…

Viewing 7 replies - 1 through 7 (of 7 total)
  • Just so I’m clear on your situation as I look into this,… are you using this plugin out-of-the-box, or have you made use of the filter and chosen some taxonomy other than categories?

    You said you were using it to “tag” your attachments, so I’m wondering if your using post_tags or some other taxonomy.

    No, I am using it out of the box.

    anything new?

    Sorry for the slow reply – ive been away from work a while due to the NATO summit here in Chicago.

    I have managed to duplicate the error your describing. It occurs when two categories with the same name are chosen for an attachment. The reason is the way WordPress tries to handle taxonomy terms when they are assigned to an attachment. The plugin saves the slugs, but for some reason, when you refresh the page, it changes them to the Name. When the names collide, it just eliminates one of them.

    I have not had time to try to resolve this yet – but I intend to do so by the end of the week.

    Thanks for your bug report, I probably wouldn’t have caught this one on my own.

    Anyway – it happened to me when I chose only one, and when saving it reassigned to the other, not when I chose both.

    Good to know. I think whats happening is when it grabs the category by name, it just looks for which ever category comes first with that name in the query response.

    Thanks again.

    After looking in more detail, its clear that the problem is how WordPress handles taxonomies when they are assigned to attachments (which they normally aren’t).

    I’ve submitted at core trac ticket in hopes of solving this within WordPress.

    That will not be very soon however, so until then I’ve devised a workaround to the problem and released it as Media Categories 1.3.1

    Let me know if this solves you problem and if you have any others.

    Thanks again for the bug report! This sort of thing really helps me to justify open source in a corporate environment.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Media Categories 2 – not saving correctly when two categories with same name’ is closed to new replies.