Workaround to avoid crashing bbPress' frontend profile page#414
Workaround to avoid crashing bbPress' frontend profile page#414CryoutCreations wants to merge 4 commits intoWordPress:masterfrom
Conversation
class-two-factor-core.php
Outdated
| public static function user_two_factor_options( $user ) { | ||
|
|
||
| /* workaround for two factor options crashing bbpress' profile page */ | ||
| if ( function_exists('bbp_is_user_home_edit') && bbp_is_user_home_edit() ) return; |
There was a problem hiding this comment.
This is currently relying on a specific integration and historically this plugin doesn't have any conditional logic to account for specific integrations. Could we somehow convert this into something that can be placed in the class-two-factor-compat.php file which currently deals with Jetpack specific things?
https://github.com/WordPress/two-factor/blob/master/class-two-factor-compat.php
Which of the functionality in this method is actually not compatible with the front-end output?
There was a problem hiding this comment.
You might want to check out my comment where I outline frontend integration with this problem (and a few more) here: #335 (comment)
For this specific issue, it would probably be better to redeclare the admin functions on the frontend when needed.
There was a problem hiding this comment.
This is currently relying on a specific integration and historically this plugin doesn't have any conditional logic to account for specific integrations. Could we somehow convert this into something that can be placed in the
class-two-factor-compat.phpfile which currently deals with Jetpack specific things?https://github.com/WordPress/two-factor/blob/master/class-two-factor-compat.php
Which of the functionality in this method is actually not compatible with the front-end output?
I updated the PR to include an example error screenshot.
Until the required admin functions are exposed on the frontend (should they?), it might be possible to rewrite the workaround in the compat file to conditionally remove the two action hooks instead. I'll look into this.
…o-factor-compat class; Also changed function check from bbp_is_user_home_edit() to bbp_is_single_user_edit() as this is more generally used
2770524 to
98f8893
Compare
|
Per @kasparsd's request I moved the bbPress conditionality check to the Hopefully the code now meets the logic separation requirements. |
|
Per yesterday's bug scrub, while we want to be compatible with official plugins we're going to punt this to a future release so that the 0.8.0 release can focus on the U2F deprecation. |
georgestephanis
left a comment
There was a problem hiding this comment.
Honestly, I'd rather see if we can just change how we're working upstream so that it doesn't have issues displaying on the front-end.
It looked like the issue is that we were calling convert_to_screen() -- #175 -- but I'm not seeing that in the current codebase.
I'd like to see:
- Is this still a problem with bbpress, and if so,
- If we can rearchitect some of our stuff to be more portable.
I'd rather avoid this sort of targeted workaround for bbp if it's going to cause issues for anything else that tries to display user settings on the front-end.
|
@georgestephanis perhaps we close this PR and #175 and allow things to get resolved within bbp? |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @lucian@cryoutcreations.eu, @CryoutCreations. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
@georgestephanis @jeffpaul isnt the reason here that If i see Given that this is removed soon (#439) i think its good to close this and focus on #335 to build a proper integration option. |
|
Closing as per #439 merging |
This workarounds skips the addition of the TwoFactor fields to the user profile when it's part of bbPress' frontend profile edit page. These are settings that shouldn't probably by editable on the forum profile anyway.
Fixes the
Fatal error: Uncaught Error: Call to undefined function convert_to_screen()reported in #175Frontend profile page error example:
