We can't insert a new dataset in backend javascript error

This topic contains 7 replies, has 3 voices, and was last updated by  Stiofan O’Connor 8 years, 1 month ago.

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

Open Support Ticket
  • Author
    Posts
  • #187776

    Marco
    Expired Member
    Post count: 19

    We can’t insert/edit a new dataset.

    update_listing_cat — post.php:782

    TypeError: maincat_obj.find(‘.chosen_select’).chosen is not a function. (In ‘maincat_obj.find(‘.chosen_select’).chosen(‘destroy’)’, ‘maincat_obj.find(‘.chosen_select’).chosen’ is undefined)

    Wordpress 4.5.2

    #187909

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    probably a conflict with another plugin using chosen.js

    If you provide a link and admin credentials in a private reply we’ll have a look.

    Let us know,

    Thanks

    #188243

    Marco
    Expired Member
    Post count: 19
    This reply has been marked as private.
    #188597

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    that means something is hijacking the $post var. Does it happen if you switch to another theme? Because if the theme is responsible for this, there isn’t much we can do on our side.

    Let us know,

    Thanks

    #188598

    Marco
    Expired Member
    Post count: 19
    This reply has been marked as private.
    #188690

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hello Marco,

    Can you please provide more info, i am not sure what function or file you are referring to, if you can post a link to the page that is not working and wp-admin details in a private reply i’ll take a look.

    Thanks,

    Stiofan

    #189208

    Marco
    Expired Member
    Post count: 19
    This reply has been marked as private.
    #189458

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    So to make it:

    
    
    function geodir_admin_current_post_type() {
    	global $post, $typenow, $current_screen;
    	
    	$post_type = NULL;
        if (isset($_REQUEST['post']) && get_post_type($_REQUEST['post']))
    		$post_type = get_post_type($_REQUEST['post']);
        elseif ($post && isset($post->post_type))
    		$post_type = $post->post_type;
    	elseif ($typenow)
    		$post_type = $typenow;
    	elseif ($current_screen && isset($current_screen->post_type))
    		$post_type = $current_screen->post_type;
    	elseif (isset($_REQUEST['post_type']))
    		$post_type = sanitize_key($_REQUEST['post_type']);
    
    	return $post_type;
    }

    The $post global value should not be being take over but i see how this could help you, i will change it to this but if i find any conflicts i will have to change it back.

    Thanks,

    Stiofan

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

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

Open Support Ticket