Support

Account

Home Forums Bug Reports Unable to add term with same name, different parent

Solving

Unable to add term with same name, different parent

  • We use a taxonomy to store applications and their version numbers. For example:

    Adobe After Effects
    – CS5
    – CC 2015

    Adobe Premiere Pro
    – CS5
    – CC 2015

    Right now, if the Adobe After Effects > CS5 term already exists, and we try to add “CS5” as a term with “Adobe Premiere Pro” as the parent from an ACF taxonomy field, we get an error that the term already exists, and the term won’t be created.

    This can be fixed in the acf_field_taxonomy->ajax_add_term() method by changing:

    // exists
    if( term_exists($args['term_name'], $field['taxonomy']) ) {
    ...
    

    to

    // exists
    if( term_exists($args['term_name'], $field['taxonomy'], $args['term_parent']) ) {
    ...
    
  • Thanks for the report. I’ll mark this topic for the developer’s attention.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Unable to add term with same name, different parent’ is closed to new replies.