Skip to:

Opened 6 years ago

Closed 6 years ago

#7657 closed enhancement (fixed)

Feature request : additional arguments in '_cover_image_uploaded' action

Reported by: pscolv's profile pscolv Owned by: djpaul's profile djpaul
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9.2
Component: Media Keywords: good-first-bug



I'm trying to generate thumbnails of the cover image, and I found a dynamic hook that could have allowed me achieving that (in bp-core-attachments.php) :
do_action( $object_datacomponent? . '_cover_image_uploaded', (int) $bp_paramsitem_id? );

However, when in my callback function, I'm unable to do anything, since the only parameter in my possession is the item_id, and in particular I'm missing the cover image url.

Suggested change : add parameters to the action, which are available "for free" since they are already computed and about to be sent back to java : $name, $cover_url, $feedback_code

This way the '_cover_image_uploaded' hook allows much more possibilities as of today !



Attachments (1)

7657.patch (642 bytes) - added by pscolv 6 years ago.
Patch for ticket #7657

Download all attachments as: .zip

Change History (14)

#1 @pscolv
6 years ago

  • Summary changed from Feature request : additional parameter in '_cover_image_uploaded' action to Feature request : additional arguments in '_cover_image_uploaded' action

#2 @DJPaul
6 years ago

  • Component changed from Core to Media
  • Keywords good-first-bug added
  • Milestone changed from Awaiting Review to 3.0

@pscolv Absolutely1 We'll get this done for 3.0. Do you want to try to create a patch for this improvement?

#3 @pscolv
6 years ago

Cool... thanks @DJPaul. I'm already experiencing that change on my side, so I could propose a patch yes, but I'm not familiar with the process there.

Let me know what I should do, will be glad to help.



#4 @DJPaul
6 years ago

Are you familiar with either Git (or Github) or SVN?

#5 @pscolv
6 years ago

I'm familiar with both yes... I'm developing my website using Git at the moment...

#6 @DJPaul
6 years ago

OK, let's give it a go! might a good place to start reading.

Basically, we need to:

1) Download a copy of BuddyPress from our Git or SVN repos.
2) Make the change in the code.
3) Test the change works.
4) Create a patch.
5) Upload that patch to this ticket.

It doesn't matter if you use SVN or Git to make the patch. Use whatever you're comfortable with. The Git repo URL is git:// (branch master) and SVN is A Github clone is available at

Once you've made the code change and tested it, you'll create the patch via svn diff or git diff. I hope the WordPress "Creating a Patch" documentation that I linked above explains the syntax for this, if you're unfamiliar with it.

Then, grab that new patch file (it's just a text file - take a look at it), and upload it to this ticket via "Attach file" button. After you've done that, be sure to come back to this comment area and say something like "I've attached a patch, please take look" -- that'll make sure we notice the new patch.

#7 @pscolv
6 years ago


I started preparing the patch, unfortunately I'm seeing several regressions on my website when I'm using the trunk SVN version of buddypress, BEFORE I apply any change.

1) On the change-cover-image page, the area allowing to upload the cover image doesn't appear anymore.
I'm calling this part from my buddypress child theme, with the following code :
<?php bp_attachments_get_template_part( 'cover-images/index' ); ?>
=> Is this deprecated in BP3.0 ?

2) I'm repeatedly getting the following admin notice : "BuddyPress Xprofile Custom Fields Type plugin needs BuddyPress 2.5, please install or upgrade BuddyPress."

Do you consider those "regressions" as normal on your side, given the changes in BP 3.0 ?
How should I proceeed here ? I can still create the patch, but I will not be able to test it on this BP version. I tested it on 2.9.2 however.



#8 @DJPaul
6 years ago

Given 3.0 is not finished, I'd be inclined to call such things bugs, rather than regressions.

I don't have any ideas about your first point. For your second point, it looks like that plugin author needs to check the version number better. cc @donmik FYI.

#9 @DJPaul
6 years ago

Don't worry about testing it on your live website. That's extremely good of you to try, and perhaps you found a bug while doing it. Thank you!

I had assumed from your writing you had a local development website, or a copy of your website where you could try, but given you've already tested on 2.9.x, that's fine.

#10 @pscolv
6 years ago

Hi Paul,

I (finally) created the patch and attached it to this ticket. Let me know if everything's OK.



P.S. I tried again to test my website against the latest buddypress version from the SVN repo, and I still get a blank area where I should see the cover image upload form.

6 years ago

Patch for ticket #7657

#11 @DJPaul
6 years ago

I'll take a look at this next week! Thanks again!

#12 @DJPaul
6 years ago

Good patch @pscolv!

#13 @djpaul
6 years ago

  • Owner set to djpaul
  • Resolution set to fixed
  • Status changed from new to closed

In 11879:

Core, Media: add parameters to dynamic _cover_image_uploaded action.

Adds the parameters returned in the AJAX response, to make this dynamic action more useful for PHP developers.

Fixes #7657

Props pscolv

Note: See TracTickets for help on using tickets.