[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
Tue Sep 13 17:00:17 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:  djpaul
     Type:  defect (bug)  |      Status:  closed
 Priority:  high          |   Milestone:  2.7
Component:  Core          |     Version:
 Severity:  major         |  Resolution:  fixed
 Keywords:  has-patch     |
Changes (by djpaul):

 * owner:   => djpaul
 * status:  new => closed
 * resolution:   => fixed


 In [changeset:"11093"]:
 #!CommitTicketReference repository="" revision="11093"
 BuddyPress, Emails: set value of `bp-emails-unsubscribe-salt` option for
 new installs.

 The initial value was set in `bp_get_default_options()` and worked because
 that function adds missing options to the database when it's ran.
 For version updates, the new option was already being explictly added

 However if a plugin is active and loads before the `plugins_loaded` hook,
 and calls add_option()` or `update_option()` (or multisite equivalents), a
 fatal error is caused by the `bp_core_clear_root_options_cache()`
 This is because `wp_generate_password()` in used in
 `bp_get_default_options()` to set the `bp-emails-unsubscribe-salt` option,
 which is only available via `wp-includes/pluggable.php`. That file is only
 loaded by WordPress after plugins are loaded.

 This change sets the default value in `bp_get_default_options()`, and then
 explicitly updates the value to the unsubscribe halts in the existing
 email installation function.

 Fixes #7227
 See #7254

 Props r-a-y, DJPaul

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7227#comment:8>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list