Can't add new Taxonomies

This topic contains 5 replies, has 3 voices, and was last updated by  Jeff 9 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #25788

    Jeff
    Buyer
    Post count: 188

    Guys, I’m working on a plugin for GD and added a new hierarchical taxonomy, let’s call it gd_place-breeds.

    When I try to save a listing (gd_place) that uses that taxonomy, I get an error:

    
    
    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-breeds = ',59,', marker_json = '{"id":"66","lat_pos": "39.89576' at line 2]
    UPDATE wp_geodir_gd_place_detail SET gd_place-breeds = ',59,', marker_json = '{"id":"66","lat_pos": "39.895763615428","long_pos": "-75.123472163455","marker_id":"66_59","icon":"","group":"catgroup59"}' where post_id = 66

    In your function geodir_set_post_terms(), the code tries to insert/update my gd_place-breeds selection into the wp_geodir_gd_place_detail table which doesn’t have that column. And doesn’t need it. Now obviously I could add the column, but it’s not necessarily appropriate there. The code is forcing any plugin or extension to add more columns to the gd_{type}_detail tables with no way of bypassing that requirement.

    I’m also not sure why my custom taxonomy would be linked/updated along with the lat/long of a listing. It’s a little weird.

    Any thoughts?

    #25812

    Guust
    Moderator
    Post count: 29970

    I alerted the wizards.

    #25839

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Jeff,

    The system prob thinks this is a custom field and is trying to add it to the main table for quick access and being able to filter quickly. Will your field benefit from this, if so i can help you add this if not i can have a look and see if we can stop it.

    Thanks,

    Stiofan

    #25874

    Jeff
    Buyer
    Post count: 188

    Thanks Stiofan.

    This plugin already adds a few custom fields so I’ve got that part down. A comma separated list of “breeds” isn’t going to be of much use here.

    I consider this a bit of a bug in GeoDirectory – if any developer or plugin wants to add new taxonomies they can’t without making it a custom field.

    Although it does appear that if the word ‘tag’ is in taxonomy name it’ll by-pass the problem code. Not ideal.

    #25932

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Jeff,

    I see how this could be a pain/bug, i think there is a very simple solution, i have already added it to core and it will be in the next release, please let me know if there is any problems for you.

    post_functions.php line 1292
    Change from:

    } else {

    To

    } elseif($taxonomy == $post_type.'category') {

    Thanks,

    Stiofan

    #25959

    Jeff
    Buyer
    Post count: 188

    Thanks Stiofan, that seems to have done the trick for that part.

    With debug on, posting still throws these errors:
    Undefined variable: prev_package_id in plugins/geodir_payment_manager/geodir_payment_actions.php on line 1554

    Undefined variable: prev_expire_date in plugins/geodir_payment_manager/geodir_payment_actions.php on line 1555

    FYI.

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount