[buddypress-trac] [BuddyPress Trac] #7227: Fatal error - Call to undefined function wp_generate_password() in bp-core\bp-core-options.php on line 77
buddypress-trac
noreply at wordpress.org
Mon Sep 5 16:04:29 UTC 2016
#7227: Fatal error - Call to undefined function wp_generate_password() in bp-core
\bp-core-options.php on line 77
--------------------------+------------------
Reporter: r-a-y | Owner:
Type: defect (bug) | Status: new
Priority: high | Milestone: 2.7
Component: Core | Version:
Severity: major | Resolution:
Keywords: has-patch |
--------------------------+------------------
Comment (by DJPaul):
I have revisited this area of code since working on another patch.
`bp_get_default_options()` is getting called on every page load, via
`bp_core_set_avatar_constants()`, which causes options to be added if
they're missing in the database. See near the "Missing some options, so do
some one-time fixing." bit. I'm tempted to remove those fixer lines,
because I'm not sure why they are there. Anyone else think it's a good
idea?
That aside, for upgrades, `bp_update_to_2_7()` is instantly updating the
option with a new key. If we set the key in `bp_core_install_emails()`,
it'd be set in `bp_update_to_2_5()`. New installs would have gotten it...
I'm not sure how, probably working on the assumption that
`bp_get_default_options` would run once via `bp_add_options()`.
To avoid having to include `pluggable.php`, because i'm worried about
causing load-order issues with other plugins that override pluggable
function, how about:
1) We update `bp_core_get_root_options()` and prevent it adding "missing
options".
2) And we update `bp_get_default_options()` and add a note saying that
this function should not rely on any WordPress functions.
3) As a consequence, we set the default value of `bp-emails-unsubscribe-
salt` to an empty string in `bp_get_default_options`.
4) We continue to set `bp-emails-unsubscribe-salt` in `bp_update_to_2_7`,
but we add setting it in `bp_version_updater` in the `bp_is_install()`
bit, thus setting it for new installs.
This should stop a "get" function setting database values, prevent the
fatal error that this ticket describes, and make it clearer where the
default options are set for on new install/update.
(I don't think we should set `bp-emails-unsubscribe-salt` in
`bp_core_install_emails()` because that can be called from one of the BP
Tools, and updating this nonce will break all previous unsubscribe
nonces.)
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7227#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list