Helping you Build Your Own Social Network!

Faster, better and easier!

CREATE and SAVE GALLERY button errors

(12 posts) (2 voices)
  • Started 9 months ago by inhousemedia
  • Latest reply from Brajesh Singh

  1. I just selected PERSIST in firebug and see this after pressing SAVE GALLERY button:
    JSON.parse: unexpected non-whitespace character after JSON data
    [Break On This Error] resp=JSON.parse(response);

    When I press CREATE GALLERY tab on pages it does nothing, and when I select CREATE GALL. from drop down menu on toolbar the SAVE GALLERY button does nothing.

    Any fix for this? I am using BuddyPress Template Pack Version 1.1.4 with BuddyPress Version 1.2.9,
    which is compatible

    Activity and POST UPDATES buttons and pages work fine.

    Posted 9 months ago #
  2. Hi Junior Pierre
    sorry for not getting back to your message. I was on a very bad connectivity for last couple of days.

    I have registered on your site and checked the section. I see the errors on create page(even form loading does not work there).

    1. Please make sure you are using bp-gallery v 1.0.9 and not 1.0.9.1?
    2. Can you disable other plugins and test if it is solely caused by gallery because the extra space can be output by any of the file.

    Posted 9 months ago #
  3. Thank you Brajesh!

    I am using bp-gallery v 1.0.9 with BuddyPress Version 1.2.9, and BuddyPress Template Pack Version 1.1.4

    I deactivated ALL OTHER plugins and received this from PERSIST in firebug:

    +POST http://zigga.biz/network/wp-admin/admin-ajax.php

    Response:{"error":{"msg":"You don't have sufficient permission to create gallery."}}0

    JSON.parse: unexpected non-whitespace character after JSON data
    [Break On This Error] resp=JSON.parse(response);
    genera...r=3.2.1 (line 201)

    this.element.zIndex is not a function
    [Break On This Error] a.previous=f}if(false!==a._trigger("se...mplete").removeAttr("aria-haspopup");
    ui.aut...r=1.8.5 (line 19)

    this.element.zIndex is not a function
    [Break On This Error] a.previous=f}if(false!==a._trigger("se...mplete").removeAttr("aria-haspopup");

    +POST http://zigga.biz/network/wp-admin/admin-ajax.php

    Response:
    {"error":{"msg":"You don't have sufficient permission to create gallery."}}0

    JSON.parse: unexpected non-whitespace character after JSON data
    [Break On This Error] resp=JSON.parse(response);

    located at: http://zigga.biz/network/wp-content/plugins/bp-gallery/inc/js/general.js?ver=3.2.1

    thank you!

    Posted 9 months ago #
  4. so just to clarify the CREATE GALLERY buttons on the MY GALLERY page is not working and the SAVE GALLERY button on the create gallery page.

    Posted 9 months ago #
  5. Thank you Junior Pierre
    I got the issue. The issue is related to the ajax url. IN general bp, the ajax url points to wp-load.php while I see it in your case pointing to admin-ajax.php.
    That seems to be the reason of the issue. I will post some solution in an hour.

    Posted 9 months ago #
  6. Thank you Brajesh I am very grateful for your time and effort!

    Posted 9 months ago #
  7. Hi Junior Pierre,
    sorry I could not reply yesterday. I was havinng high fever.

    Please check your bp-custom.php/theme if you have something like this in your theme

    remove_action( 'wp_head', 'bp_core_add_ajax_url_js' );

    or

    remove_action( 'init', 'bp_core_add_ajax_hook' );

    The bp_core_add_ajax_url is the one which adds a front end ref point for ajax

    These are part of bp-core and as far as I see from your debug data, these are not working properly.

    You may want to try by first adding this line
    add_action( 'wp_head', 'bp_core_add_ajax_url_js' );

    In your functions.php/bp-custom.php and if that does not fixes the issue, then you can try this too

    add_action( 'init', 'bp_core_add_ajax_hook' );
    Posted 9 months ago #
  8. Hi Brajesh. I tried entering both to function.php:

    /**
    * add any of your custom functions below this section
    */
    add_action( 'wp_head', 'bp_core_add_ajax_url_js' );
    add_action( 'init', 'bp_core_add_ajax_hook' );
    ?>

    I created a bp-custom.php file in plugins folder and added the above code. Was that correct? or is bp-custom.php suppose to be in another directory

    also do I remove the code from functions.php if it doesn't work?

    I get same error:
    {"error":{"msg":"You don't have sufficient permission to create gallery."}}0

    Posted 9 months ago #
  9. Hi
    Just checked again.
    The problem is related to the ajaxurl, one of your plugin is overwriting it to wp-admin/admin-ajax.php

    Well, Please remove the above code if you have put(and yes, you should not put two copies of the same code in functions.php/bp-custom.php ever).

    Put this line in bp-custom.php or functions.php

    add_action( 'wp_footer', 'bp_core_add_ajax_url_js',300 );

    This line will override the url back to wp-load.php.

    I hope this fixes it, otherwise we will have to look further.

    Posted 9 months ago #
  10. Thank You Brajesh!

    You are a genius!!! Everything is working fine due to the following code in functions.php:

    add_action( 'wp_footer','bp_core_add_ajax_url_js',300 );

    Posted 9 months ago #
  11. Hi Junior,
    Thank you for the patience. It was all your help and patience that we finally got it working :)

    Thank you :)

    Posted 9 months ago #

Reply

You must log in to post.