2

After migrating our farm from SharePoint 2010 to SharePoint 2013 (in 2010 mode) we are seeing that URLs to images are now double-encoded. Specifically in locations where we target MySite profile images.

Pre-migration:

https://mysites.company.com/User%20Photos/Profile%20Pictures/company_username_MThumb.jpg

Post-migration:

https://mysites.company.com/User%2520Photos/Profile%2520Pictures/company_username_MThumb.jpg

Any suggestions on how to fix this are appreciated. My last resort option would be to use jQuery to modify the URLs on page load but, I would like to explore other avenues first.

1
  • An interesting note. This only occurs with migrated images. New users who are added don't have this problem with their profile pictures. Oct 17, 2013 at 16:26

4 Answers 4

1

Did you run Update-SPProfilePhotoStore for profile photo store to be compatible with SharePoint Server 2013?

1
  • We did. Also we ran it again this morning to no avail. Some additional information. If you click the check box and select "View Item" the user's photo shows up just fine. It is almost as if SharePoint is only double-encoding the spaces in the URL when viewing the list as a whole. Sep 19, 2013 at 13:13
1

Since none of the answers provided corrected the issue for us, we are going to resort to using IIS rewrite rules to point the double-encoded URL to the single-encoded URL. This appears to be the only way to correct this issue aside from visually upgrading to SharePoint 2013 (which also fixes the issue).

Thank you all for everyone's efforts though. I'm still curious to know why this got double-encoded if anyone ever figures it out.

1
  • Could you share the rewrite rules?
    – Dennis G
    Dec 9, 2013 at 13:04
0

There is an article here with a couple of suggestions.

http://sharepoint-kb.blogspot.com/2011/10/url-problem-2520-20.html

  1. Select a view with broken images in Thumbnails view mode
  2. Choose Site Actions > Edit Page
  3. From the library Web Part's Edit drop-down, choose Edit Web Part, Apply, and OK
  4. When you Exit Edit Mode, the Thumbnails appear correctly
  5. Repeat for each view with broken Thumbnails

and/or

  1. Clone the view "All Pictures" to a view called "Temp" and assigned Temp to be the default view.
  2. Delete the "All Pictures" view
  3. Clone the view "Temp" to "AllItems" assigning AllItems to be the default view.
  4. Delete the view "Temp"
  5. Set the title fo the AllItems view to be "All Pictures"

Aside from the view GUID everything appears to be identical, but with links functioning properly.

3
  • Thanks @monkeywrench. Unfortunately following those instructions did not fix the issue. The URLs on the images are still double encoded when viewing the list. Sep 19, 2013 at 15:13
  • Sorry to hear that. I saw another article about ISA causing the problem as well. Here is the link. forums.isaserver.org/m_2002079836/mpage_1/key_/tm.htm Sep 19, 2013 at 18:18
  • We are not using an ISA server so the normalization verification isn't a factor. Sep 19, 2013 at 19:10
0

this is a Hack - but you could use jQuery within your master page to replace your %2520 with a %20 - if you select the Dvi of s4-workspace this only adjusts the html here and not in the whole body with will result in orphaned child nodes.

jquery would be

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript">

$(document).ready(function() { var strNewString = $('#s4-workspace').html().replace(/\%2520/g,'%20'); $('#s4-workspace').html(strNewString); }); </script>

1
  • Per my original posting "My last resort option would be to use jQuery to modify the URLs on page load but, I would like to explore other avenues first.". I appreciate you posting the suggested script though. Oct 17, 2013 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.