<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][12555] trunk: Move Avatars & Cover from xProfile to Members component : step 3</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/12555">12555</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/12555","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>imath</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-02-29 15:38:06 +0000 (Sat, 29 Feb 2020)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Move Avatars & Cover from xProfile to Members component : step 3
Move the Avatar upload directory filter from the xProfile functions to the Members functions.
Move the Avatar template functions from xProfile to the Members component.
See <a href="http://buddypress.trac.wordpress.org/ticket/8156">#8156</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpcorebpcoreavatarsphp">trunk/src/bp-core/bp-core-avatars.php</a></li>
<li><a href="#trunksrcbpmembersbpmembersfunctionsphp">trunk/src/bp-members/bp-members-functions.php</a></li>
<li><a href="#trunksrcbpmembersbpmemberstemplatephp">trunk/src/bp-members/bp-members-template.php</a></li>
<li><a href="#trunksrcbpxprofilebpxprofilefunctionsphp">trunk/src/bp-xprofile/bp-xprofile-functions.php</a></li>
<li><a href="#trunksrcbpxprofilebpxprofiletemplatephp">trunk/src/bp-xprofile/bp-xprofile-template.php</a></li>
<li><a href="#trunktestsphpunittestcasescoreclassbpattachmentphp">trunk/tests/phpunit/testcases/core/class-bp-attachment.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpcorebpcoreavatarsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-avatars.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-avatars.php 2020-02-29 15:33:10 UTC (rev 12554)
+++ trunk/src/bp-core/bp-core-avatars.php 2020-02-29 15:38:06 UTC (rev 12555)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1005,8 +1005,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $bp_params['upload_dir_filter'] = '';
</span><span class="cx" style="display: block; padding: 0 10px"> $needs_reset = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'user' === $bp_params['object'] && bp_is_active( 'xprofile' ) ) {
- $bp_params['upload_dir_filter'] = 'xprofile_avatar_upload_dir';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'user' === $bp_params['object'] && bp_is_active( 'members' ) ) {
+ $bp_params['upload_dir_filter'] = 'bp_members_avatar_upload_dir';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! bp_displayed_user_id() && ! empty( $bp_params['item_id'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $needs_reset = array( 'key' => 'displayed_user', 'value' => $bp->displayed_user );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1297,20 +1297,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'item_id' => $avatar_data['item_id'],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** This action is documented in wp-includes/deprecated.php */
+ do_action_deprecated( 'xprofile_avatar_uploaded', array( (int) $avatar_data['item_id'], $avatar_data['type'], $avatar_data ), '6.0.0', 'bp_members_avatar_uploaded' );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires if the new avatar was successfully captured.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 1.1.0 Used to inform the avatar was successfully cropped
- * @since 2.3.4 Add two new parameters to inform about the user id and
- * about the way the avatar was set (eg: 'crop' or 'camera')
- * Move the action at the right place, once the avatar is set
- * @since 2.8.0 Added the `$avatar_data` parameter.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.0.0
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $item_id Inform about the user id the avatar was set for.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $type Inform about the way the avatar was set ('camera').
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $avatar_data Array of parameters passed to the avatar handler.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'xprofile_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $avatar_data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'bp_members_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $avatar_data );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_send_json_success( $return );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1355,8 +1354,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'user' === $avatar_data['object'] ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** This action is documented in wp-includes/deprecated.php */
+ do_action_deprecated( 'xprofile_avatar_uploaded', array( (int) $avatar_data['item_id'], $avatar_data['type'], $r ), '6.0.0', 'bp_members_avatar_uploaded' );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /** This action is documented in bp-core/bp-core-avatars.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'xprofile_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'bp_members_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $r );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 'group' === $avatar_data['object'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** This action is documented in bp-groups/bp-groups-screens.php */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $r );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1936,11 +1938,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_avatar_is_front_edit() {
</span><span class="cx" style="display: block; padding: 0 10px"> $retval = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // No need to carry on if the current WordPress version is not supported.
- if ( ! bp_attachments_is_wp_version_supported() ) {
- return $retval;
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> if ( bp_is_user_change_avatar() && 'crop-image' !== bp_get_avatar_admin_step() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $retval = ! bp_core_get_root_option( 'bp-disable-avatar-uploads' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcbpmembersbpmembersfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-members/bp-members-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-members/bp-members-functions.php 2020-02-29 15:33:10 UTC (rev 12554)
+++ trunk/src/bp-members/bp-members-functions.php 2020-02-29 15:38:06 UTC (rev 12555)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2848,3 +2848,47 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'bp_get_current_member_type', buddypress()->current_member_type );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+/**
+ * Setup the avatar upload directory for a user.
+ *
+ * @since 6.0.0
+ *
+ * @param string $directory The root directory name. Optional.
+ * @param int $user_id The user ID. Optional.
+ * @return array Array containing the path, URL, and other helpful settings.
+ */
+function bp_members_avatar_upload_dir( $directory = 'avatars', $user_id = 0 ) {
+
+ // Use displayed user if no user ID was passed.
+ if ( empty( $user_id ) ) {
+ $user_id = bp_displayed_user_id();
+ }
+
+ // Failsafe against accidentally nooped $directory parameter.
+ if ( empty( $directory ) ) {
+ $directory = 'avatars';
+ }
+
+ $path = bp_core_avatar_upload_path() . '/' . $directory. '/' . $user_id;
+ $newbdir = $path;
+ $newurl = bp_core_avatar_url() . '/' . $directory. '/' . $user_id;
+ $newburl = $newurl;
+ $newsubdir = '/' . $directory. '/' . $user_id;
+
+ /**
+ * Filters the avatar upload directory for a user.
+ *
+ * @since 6.0.0
+ *
+ * @param array $value Array containing the path, URL, and other helpful settings.
+ */
+ return apply_filters( 'bp_members_avatar_upload_dir', array(
+ 'path' => $path,
+ 'url' => $newurl,
+ 'subdir' => $newsubdir,
+ 'basedir' => $newbdir,
+ 'baseurl' => $newburl,
+ 'error' => false
+ ) );
+}
</ins></span></pre></div>
<a id="trunksrcbpmembersbpmemberstemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-members/bp-members-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-members/bp-members-template.php 2020-02-29 15:33:10 UTC (rev 12554)
+++ trunk/src/bp-members/bp-members-template.php 2020-02-29 15:38:06 UTC (rev 12555)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1510,7 +1510,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * False otherwise
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_displayed_user_use_cover_image_header() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return (bool) bp_is_active( 'xprofile', 'cover_image' ) && ! bp_disable_cover_image_uploads() && bp_attachments_is_wp_version_supported();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (bool) bp_is_active( 'members', 'cover_image' ) && ! bp_disable_cover_image_uploads();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** Avatars *******************************************************************/
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2645,3 +2645,34 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !empty( $url ) )
</span><span class="cx" style="display: block; padding: 0 10px"> return $url;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+
+/**
+ * Render an avatar delete link.
+ *
+ * @since 1.1.0
+ * @since 6.0.0 Moved from /bp-xprofile/bp-xprofile-template.php to this file.
+ */
+function bp_avatar_delete_link() {
+ echo bp_get_avatar_delete_link();
+}
+
+ /**
+ * Return an avatar delete link.
+ *
+ * @since 1.1.0
+ * @since 6.0.0 Moved from /bp-xprofile/bp-xprofile-template.php to this file.
+ *
+ * @return string
+ */
+ function bp_get_avatar_delete_link() {
+
+ /**
+ * Filters the link used for deleting an avatar.
+ *
+ * @since 1.1.0
+ *
+ * @param string $value Nonced URL used for deleting an avatar.
+ */
+ return apply_filters( 'bp_get_avatar_delete_link', wp_nonce_url( bp_displayed_user_domain() . bp_get_profile_slug() . '/change-avatar/delete-avatar/', 'bp_delete_avatar_link' ) );
+ }
</ins></span></pre></div>
<a id="trunksrcbpxprofilebpxprofilefunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-xprofile/bp-xprofile-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-xprofile/bp-xprofile-functions.php 2020-02-29 15:33:10 UTC (rev 12554)
+++ trunk/src/bp-xprofile/bp-xprofile-functions.php 2020-02-29 15:38:06 UTC (rev 12555)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -706,52 +706,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_setup_globals', 'xprofile_override_user_fullnames', 100 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Setup the avatar upload directory for a user.
- *
- * @since 1.0.0
- *
- * @package BuddyPress Core
- *
- * @param string $directory The root directory name. Optional.
- * @param int $user_id The user ID. Optional.
- * @return array Array containing the path, URL, and other helpful settings.
- */
-function xprofile_avatar_upload_dir( $directory = 'avatars', $user_id = 0 ) {
-
- // Use displayed user if no user ID was passed.
- if ( empty( $user_id ) ) {
- $user_id = bp_displayed_user_id();
- }
-
- // Failsafe against accidentally nooped $directory parameter.
- if ( empty( $directory ) ) {
- $directory = 'avatars';
- }
-
- $path = bp_core_avatar_upload_path() . '/' . $directory. '/' . $user_id;
- $newbdir = $path;
- $newurl = bp_core_avatar_url() . '/' . $directory. '/' . $user_id;
- $newburl = $newurl;
- $newsubdir = '/' . $directory. '/' . $user_id;
-
- /**
- * Filters the avatar upload directory for a user.
- *
- * @since 1.1.0
- *
- * @param array $value Array containing the path, URL, and other helpful settings.
- */
- return apply_filters( 'xprofile_avatar_upload_dir', array(
- 'path' => $path,
- 'url' => $newurl,
- 'subdir' => $newsubdir,
- 'basedir' => $newbdir,
- 'baseurl' => $newburl,
- 'error' => false
- ) );
-}
-
-/**
</del><span class="cx" style="display: block; padding: 0 10px"> * When search_terms are passed to BP_User_Query, search against xprofile fields.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.0.0
</span></span></pre></div>
<a id="trunksrcbpxprofilebpxprofiletemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-xprofile/bp-xprofile-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-xprofile/bp-xprofile-template.php 2020-02-29 15:33:10 UTC (rev 12554)
+++ trunk/src/bp-xprofile/bp-xprofile-template.php 2020-02-29 15:38:06 UTC (rev 12555)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1205,34 +1205,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Render an avatar delete link.
- *
- * @since 1.1.0
- */
-function bp_avatar_delete_link() {
- echo bp_get_avatar_delete_link();
-}
-
- /**
- * Return an avatar delete link.
- *
- * @since 1.1.0
- *
- * @return string
- */
- function bp_get_avatar_delete_link() {
-
- /**
- * Filters the link used for deleting an avatar.
- *
- * @since 1.1.0
- *
- * @param string $value Nonced URL used for deleting an avatar.
- */
- return apply_filters( 'bp_get_avatar_delete_link', wp_nonce_url( bp_displayed_user_domain() . bp_get_profile_slug() . '/change-avatar/delete-avatar/', 'bp_delete_avatar_link' ) );
- }
-
-/**
</del><span class="cx" style="display: block; padding: 0 10px"> * Render an edit profile button.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0.0
</span></span></pre></div>
<a id="trunktestsphpunittestcasescoreclassbpattachmentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/testcases/core/class-bp-attachment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/testcases/core/class-bp-attachment.php 2020-02-29 15:33:10 UTC (rev 12554)
+++ trunk/tests/phpunit/testcases/core/class-bp-attachment.php 2020-02-29 15:38:06 UTC (rev 12555)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -238,13 +238,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* No error */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $user_avatar = $avatar_attachment->upload( $_FILES, 'xprofile_avatar_upload_dir' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_avatar = $avatar_attachment->upload( $_FILES, 'bp_members_avatar_upload_dir' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $user_avatar['file'], $bp->avatar->upload_path . '/avatars/' . $u1 .'/mystery-man.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* File size error */
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'bp_core_avatar_original_max_filesize', array( $this, 'max_filesize' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $user_avatar = $avatar_attachment->upload( $_FILES, 'xprofile_avatar_upload_dir' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_avatar = $avatar_attachment->upload( $_FILES, 'bp_members_avatar_upload_dir' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'bp_core_avatar_original_max_filesize', array( $this, 'max_filesize' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( empty( $user_avatar['error'] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,7 +253,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_FILES[ $avatar_attachment->file_input ]['name'] = 'buddypress_logo.pdf';
</span><span class="cx" style="display: block; padding: 0 10px"> $_FILES[ $avatar_attachment->file_input ]['type'] = 'application/pdf';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $user_avatar = $avatar_attachment->upload( $_FILES, 'xprofile_avatar_upload_dir' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_avatar = $avatar_attachment->upload( $_FILES, 'bp_members_avatar_upload_dir' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( empty( $user_avatar['error'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // clean up!
</span></span></pre>
</div>
</div>
</body>
</html>