napsterrahul1 / buddypress-media

Automatically exported from code.google.com/p/buddypress-media
0 stars 0 forks source link

Saving after editing a picture produces a broken image URL in version 0.1.8.8 #71

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
*** YOU MUST ANSWER ALL QUESTIONS. IF A QUESTION IS NOT RELEVANT YOU MUST
WRITE "NOT APPLICABLE" IN THE QUESTION FIELD. ***

[What steps will reproduce the problem? (We need detailed, specific steps.
If we cannot reproduce the defect on a dev machine, we cannot fix it.)]
1. Upload a picture (I used JPEG format)
2. Edit the picture to adjust title/description
3. Save the edit (value for title/description not relevant)

[What is the expected output? What do you see instead?]

I expect to see the image rendered again.

[What version of BP Media are you using?]

Version 0.1.8.8 of BP Album+

[What version of WordPress are you using?]

3.1

[What version of BuddyPress are you using?]

1.2.8

[What version of PHP are you using?]

5.3.4

[If the problem is layout related (broken page layout, etc) or browser
related (page just freezes, cannot connect to server) ...what happens when
you load the page in AT LEAST TWO of the following browsers:]
1.FireFox - (Report version number)
2.Internet Explorer - (Report version number)
3.Safari - (Report version number)
4.Google Chrome - (Report version number)

NOT APPLICABLE

[What is the URL of your web host?]

NOT APPLICABLE  (This is on a local install, not publicly accessible)

[If you are running a public site, what is the URL to a page that shows the
problem?]

NOT APPLICABLE

[Do you know how to use phpMyAdmin?]

Yes

[Do you know how to edit PHP code?]

Yes

[Please provide any additional information below]

After an Edit/Save operation, the image is rendered
with a call to bp_album_picture_middle_url() from 
wp-content/plugins/bp-album/includes/templates/album/single.php

This function is located in
wp-content/plugins/bp-album/includes/bp-album-templatetags.php

and returns the output of bp_album_get_picture_middle_url()

The case of concern is for
$bp->album->bp_album_url_remap == false

An example of the output generated for the img source is:
http://www.mydomain.comhttp//mydomain.com/wp-content/blogs.dir/3/files/album/13/
faceyourmanga.jpg

Where:
bp_get_root_domain() returns   "http://www.mydomain.com/"

and
$pictures_template->picture->pic_mid_url = 
"http://mydomain.com/wp-content/blogs.dir/3/files/album/13/faceyourmanga.jpg"

The URL is not correct.  What I expect to see is:
http://www.mydomain.com/wp-content/blogs.dir/3/files/album/13/faceyourmanga.jpg

Original issue reported on code.google.com by scarter...@gmail.com on 5 Mar 2011 at 3:09