[buddypress-trac] [BuddyPress Trac] #7254: PHPUnit tests does not call plugin activation hook.

buddypress-trac noreply at wordpress.org
Tue Sep 13 17:00:18 UTC 2016


#7254: PHPUnit tests does not call plugin activation hook.
------------------------------+------------------
 Reporter:  DJPaul            |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  2.7
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:                    |
------------------------------+------------------

Comment (by djpaul):

 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
 elsewhere.

 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()`
 function.
 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/7254#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list