Skip to content
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

The best of the forks #123

Merged
merged 63 commits into from
Oct 14, 2014
Merged

The best of the forks #123

merged 63 commits into from
Oct 14, 2014

Conversation

christianwach
Copy link
Contributor

#121 prompted me to create this overdue PR. See explanation there.

sboisvert and others added 30 commits February 4, 2013 17:55
bp_groups_setup_nav action is part of the default theme I suspect as it's not present on my install of 1.6.4 and we don't use the default theme.
changing it to bp_init did the trick, so I'm offering it up as a change. Without it, it would just 404.

Thanks!
This lets me focus on just the Course-related changes without having to be distracted by unresolved issues in other parts of the plugin
…uddyPress

Setting the filter to false will allow the plugin to be activated without complaining that BuddyPress isn't activated, and can be used for other similiar checks in the future
This will run at the exact same time as bp_init, but will fire when BuddyPress is installed and when it isn't
These simulate the existance of BuddyPress for places in the BPSP code that expects certain BP objects/functions to exist
…t directly

The call to bp_get_group_permalink() was moved because it's only used inside the if ( !empty( course[0] ) ) check, and calling it earlier leads to an undefined function error when BuddyPress is not activated
Otherwise it causes "headers already sent" warnings
Otherwise the post types couldn't be accessed directly until some other action flushed the rules
Either BPSP will call a function that's undefined (because the mock isn't setup), or BuddyPress will try to redeclare a mocked function.
Otherwise it can't be accessed and a PHP warning is thrown.
If it isn't initialized, a PHP notice will be thrown
edit_course_screen() performs a capability check and dies if it fails, so there's no need to also check capabilities in standalone_screen_handler before edit_course_screen() is called.
They can both use the same ones, so there's no need to maintain separate/overlapping lists
The default values are needed for the single template too.
Without this, a PHP warning will be thrown when bp_get_group_permalink() is called
@stas
Copy link
Member

stas commented Oct 6, 2014

OMG, please give me some time to take a look before we merge this 🙏

@christianwach
Copy link
Contributor Author

@stas Sorry, I should have copied what I said on Twitter in here:

https://twitter.com/interactivist/status/519160895248023552

Please consider this PR a bookmark for my branch!

}

return $content;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, although I wonder why not register a group custom post type and use it instead of the one provided by BuddyPress? I'm not sure what are the implications for using these magic values/IDs, especially if somebody decides to migrate later to a BuddyPress installation.

/cc @christianwach

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stas This code was from a commit by @iandunn who would probably be better placed to answer your query. I did not thoroughly test the standalone version. My own view is that it would be highly unlikely for anyone to use BP Courseware without BP, let alone then convert to using BP. I agree with your suggestion - a group CPT would help conversion to a BP context should that occur.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not register a group custom post type and use it instead of the one provided by BuddyPress

It's been a long time since I worked on that, but I'm guessing I chose that route because I didn't see any reason to implement any BuddyPress-specific features, since the point was the make it available to users who weren't running BP. You make a good point about the potential for someone migrating to BP later on, although I'm not sure if that'd be common enough to warrant the extra time.

Also, just as FYI, my entire branch was still alpha, and will probably needs some work before merging into stable BPCW.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @iandunn
I would rather merge this an improve later, rather than wait until it is stable.

@stas
Copy link
Member

stas commented Oct 12, 2014

I left a couple of suggestions. Overall I think this is good to merge!
Since the biggest changes are relevant to the standalone feature, I think we can continue with the current approach to handle the ACL and groups support and consider changing that in nearest future with a more pragmatic alternative.

Huge thanks to @iandunn @christianwach @sboisvert and @16nsk

@lloc, @Mamaduka, if you have suggestions, please leave a comment, otherwise I will consider this as good to merge.

@lloc
Copy link
Contributor

lloc commented Oct 13, 2014

It would be fine for me.

@christianwach
Copy link
Contributor Author

@stas Thanks for reviewing the PR. Look forward to following development!

stas added a commit that referenced this pull request Oct 14, 2014
@stas stas merged commit c7c26c7 into Courseware:master Oct 14, 2014
@Mamaduka
Copy link

@stas thanks for merging this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants