Skip to:
Content
Pages
Categories
Search
Top
Bottom

AJAX on group extension admin page

  • Avatar of matom
    matom
    Participant

    @matom

    Hi,

    I’ve come across a weird issue with AJAX (jquery) calls from the admin page of a group extension and I’ve been looking for a solution for a few days now without much luck.

    I have a child theme of the BP Default theme and a group extension that loads and displays data depending on user selection. This was all working fine in BP 1.5.2 / WP 3.4.1. Since updating to BP 1.7.2 and WP 3.5.1 this no longer works correctly. Instead of loading/displaying the data it supposed to it loads and displays the full html of the admin page again.

    In order to debug this I’ve tried the following:

    1. Clean install of WordPress 3.5.1 with Buddypress 1.7.2 the only activated plugin
    2. Activated TwentyTwelve theme
    3. Added a basic group extension to the theme’s functions.php. This extension only contains a link on the group admin page and does nothing else.
    4. Registered a simple “Hello World” ajax function in functions.php
    5. Added some jquery in a seperate Javascript file to load and display the output from the “Hello World” function when the link on the group extension admin page is clicked

    -> Testing this at this stage works fine and the output is “Hello World” as expected.

    However I then switched the theme it to a child theme of BP default. This theme has nothing else than functions.php containing the group extension and the “Hello World” AJAX function, the Javascript file (using exactly the same code as above).

    -> Testing this the output is now the full html of current admin page again instead of “Hello World”.

    Has anyone else come across this problem?

    Is this a bug within the BP default theme?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of tolisvt
    tolisvt
    Participant

    @tolisvt

    Hello,
    I am having the same problem. In the edit screen of a Group extension I have a dropdown and on change i get some data via an AJAX function using (jQuery.post) to fill some part of the form. However i get the whole HTML of the current page. I also use a child theme of BPdefault. Has anyone else come across this problem and solved it? Any help would be valuable.
    Thanks

    Avatar of matom
    matom
    Participant

    @matom

    Hi @tolisvt,

    Did you find a solution for this?

    I’ve tried so many things but can’t get to the bottom of this.

    What I’ve found out is that it somehow has something to do with the request URL (ie. http://my-domain/groups/my-group/admin/my-group-extension/). I’ve copied the generated HTML of the group extension admin page into the groups/single/home.php of the default BP theme, replacing everything so it runs the same HTML on every single group page, with the result that:

    - /groups/my-group/ -> returns the data correctly
    - /groups/my-group/admin/edit-details -> returns the data correctly
    - /groups/my-group/admin/my-group-extension/ -> returns the incorrect data (the full HTML of the current page)?

    If anyone knows why this might be and what I can do to solve it, please let me know. I really need to get this resolved.

    Thanks.

    Avatar of matom
    matom
    Participant

    @matom

    I’ve posted a ticket about this issue:

    http://buddypress.trac.wordpress.org/ticket/5052

    Avatar of matom
    matom
    Participant

    @matom

    I’ve tried this with 1.8-beta2 as I was pleased to find out that the Group Extension has been rewritten – thanks to the dev team for this change.

    It no longer outputs the full HTML, but unfortunately it’s still not correct. Instead it now outputs:

    Are you sure you want to do this? Please try again. (Please try again links to the page it’s on)

    I’ve updated the ticket here: http://buddypress.trac.wordpress.org/ticket/5052

    @boonebgorges – I’ve been banging my head against this issue for quite a while now – so any help would be much appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.