-
Notifications
You must be signed in to change notification settings - Fork 25
Buddypress support #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…pdown list like post status.
} | ||
} | ||
|
||
class P2P_BP_Group_Query { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should move this class to a separate file (call it bp-group-query.php
, so that it gets loaded on-demand automatically).
moved P2P_BP_Group_Query to separate file bp-group-query.php fixed query object type check in side-bpgroup.php
I have updated the pull request following your comments. |
Did you actually test the changes you made? |
Yes, but still I'm still getting the issue of all connections are automatically added to the dropdown on page load. |
Ok, I'll give it a try myself soon. In the mean time, you might find this class chart helpful: https://github.com/scribu/wp-posts-to-posts/wiki/Class-diagrams |
How exactly are you registering the connection type that you're testing with? I tried this: p2p_register_connection_type( array(
'name' => 'posts_to_groups',
'from' => 'post',
'to' => 'bpgroup'
) ); It just assumes that 'bpgroup' is a custom post type. The solution is to apply this patch: diff --git connection-type-factory.php connection-type-factory.php
index bc9a784..5f6f50e 100644
--- connection-type-factory.php
+++ connection-type-factory.php
@@ -54,7 +54,7 @@ class P2P_Connection_Type_Factory {
private static function create_side( &$args, $direction ) {
$object = _p2p_pluck( $args, $direction );
- if ( in_array( $object, array( 'user', 'attachment' ) ) )
+ if ( in_array( $object, array( 'user', 'attachment', 'bpgroup' ) ) )
$object_type = $object;
else
$object_type = 'post'; You'll then get:
That is because you named the file incorrectly - |
…ype like user and attachment.
I have updated the files after your comments. I have investigated the issue further and its down to how the sql is generated in prepare_query() in side-bpgroup.php. Its not generating the correct sql to either include or exclude results. I can adjust the sql so records an not connected on page load but in doing so it stops the search box from working. |
updated query sql.
Ok, no more fatal errors. The search box doesn't work for me because the ajax response is malformed due to a notice:
In order to see this notice, you have to enable WP_DEBUG in wp-config.php. If you're not familiar with JavaScript development, you should read http://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Errors |
…ing by buddypress group hierarchy
I have resolved the outstanding issue and have been able to and and remove connection successfully. The following features still need to be included
I will add these one its confirmed that the base functionality is working outside of my development install. |
The AJAX still doesn't work for me, due to the same error as before:
Are you sure you have PS: Sorry for the delay. |
Oh, there is no connection_type because the admin box calls You need to make |
This is the first draft of adding buddypress group support to p2p.
There is an issue which needs to be reviewed.,
Additional features that need to be added
All these option should be defined in connection registration