Archive | SP2010 RSS feed for this section

Edit mode panel does not render at all on system pages

18 Jul

This one is a pretty odd one.

we had the need to emit some different css based on if a page was in edit mode or in display mode on a recent project, and so we put two edit mode panels on the master page.

one with PageDisplayMode set to display.. and the coresponding HTML that we wanted to render..

and another edit mode panel set to edit that renders the other one.

Now, keep in mind there are only two settings for that flag. display or edit.

Worked great, went to our pages, detail pages, list pages, web part pages etc.. edited the page.. and all the changes we expected to see were there and happy.

Now, I repeat, keep in mind there are ONLY two settings for that flag. display or edit.

We then went to a system page, view all site content or site settings.. and the branding/design was ALL kinds of messed up? what gives?

As it turns out, the edit mode panel for some reason.. rendered nothing.

neither edit mode panel was rendered. Which I would have *assumed* would have been impossible since we had a panel configured for every possible option. and Since this was the same master page everything else was using.

and so since this is SharePoint.. my assumptions were wrong.

So there is either a secret third option? or some weird change that only the system pages make.

I don’t know, we ended up finding another approach that did not use edit mode panels.. but this was something I could not find any blog posts about.

So heads up. Edit model panels.. on master pages.. don’t render at all on certain system pages.

 

SP2013 disables org chart viewer.. but only on YOUR profile page

1 Jul

Put this in the strange but true category.

We received a defect report from a client doing a 2013 migration stating that the org chart viewer wasn’t working. Gave us a link to the page where it wasn’t working. Of course we went to verify the defect, but when we looked the org chart viewer was there.

Thought that was closed, but they insisted it wasn’t there. So assuming it was some sort of training issue, we went to show them where the viewer was and how to get to it. But when we went to see the same page on thier machine.. no Org chart. what?

So we went to a few other peoples profile pages. All of them worked. Just not theirs. Was this some wierd cache issue? Had they customized their page in a way that broke this?

Well with this new information, we went back to look at our own profile page. And turns out when anyone looks at their own profile, they cannot see the org chart viewer. So thinking this must be a bug, we went to go find a bug report from someone else, and hopefully find a fix or work around.

This was the post we found: http://blogs.msdn.com/b/chandru/archive/2013/04/01/sp15-organization-chart-in-mysites.aspx

Granted the date on the post is April Fool’s day, which always makes me suspicious. But concerns aside, it basically indicates, “yeah it does that because we thought turning it off was better than making it perform better”. And we did find another post not on April Fool’s Day, that matches the comments, and even links to that post. (http://social.technet.microsoft.com/forums/sharepoint/en-US/71046c9d-b7f6-4cff-81dd-5edf67bd9e11/sharepoint-2013-issue-with-org-chart-not-visible)

So there you have it, by design, and if you want it, custom event reciever and feature stapling to fix it. (unless I assume you are in office 365, then you are out of luck)

 

Misleading VS message trying to deploy a solution

17 Jun

I was working on a SP2010 project and working from a box I did not build, and I was getting the following error when trying to deploy my solution:

Error occurred in deployment step ‘Recycle IIS Application Pool’: Cannot connect to the SharePoint site: http://xxx/. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project

I thought, That’s odd I am pretty sure I am a local admin.

Double checked, sure enough I was, I should be able to do an IISreset.

So I pulled up a command line and was in fact able to successfully run an IISreset. But still was getting this error from VS.

I saw some threads that indicated I may need to also be a site collection Admin in order to do the IISreset from VS during a deploy. So I checked, I was a site collection admin, but still was getting the error from a VS deploy.

For fun I thought lets close and restart Visual Studio, no help. Restart the box, no help.

Did a little more digging and came across this thread.

http://mushannak.blogspot.com/2013/02/error-occurred-in-deployment-step.html

That was it, the local DB did not have my account as the owner on the content database.

Changed that and I was able to successfully deploy, no thanks to that error message though.

Jpgs in Sharepoint 2010 dont show in final page for IE8 and lower

11 Sep
  1. Ok, so here is the situation, I have a site owner. They have full permissions on the site, and can see all the other images in the same library. In fact they can see other JPGs in the same library. When you go to the library they can see the images in the link, when they mouse over they see the pop up with the image. BUT when they go to a page that has the image in it they see a red X. And if they open the image directly, red X. But it is limited in our data to only one JPG. What gives?
  2. We ran the normal permissions checks, ran a fiddler trace, tried it from different users, and machines. And it appeared to be machine, not user specific. since the user could see the image on other machines. And it was not machine specific since other browsers on this persons machine could resolve the image. It wasn’t a caching issue since we cleared that out.
    Turns out it was IE8 specific. And here is what it appears to have been.
  3. IE 8 could not render the JPG since apparently the graphic artist saved it as CMYK and not RGB. And since the newer versions of IE and therefore the newer versions of SharePoint graphics routines could handle it, it was able to generate the thumbnails that the user was seeing in the administrative interfaces. So the user could see it in the library list, mouse over and see the correct image, assign it to a page, see it in other browsers, and on other machines (which had IE9) and just not on the final page in IE8 (or 6 or 7).
  4. Solution was straight forward, open it up in Microsoft Expression Design 4, and save the image as a PNG or JPG with RGB color palettes.
    Problem solved.

SharePoint 2010 Taxonomy store and Ampersand issue

10 Sep
  1. I ran into a weird issue while I was working with the SharePoint taxonomy term store to upload some managed metadata. I had modified the code to check for existing terms, and if they were not there to insert them. turns out there were no errors when I had tested it, but when I ran it against the production file I would get errors, that I was trying to insert a duplicate key.
    I did some tracing, and for some reason Ampersands in the term name were causing failures. further investigation showed that even though the term was in the comparison list, the compare criteria was failing.
    After a little more time, and some unsuccessful approaches, I notices that the ampersand in the watch window looked a little different from the comparison string vs the input string.
  2. && << look similar don’t they?
    SharePoint doesn’t think so
  3. So I thought it was a different font, or bolded, or something. I tried pasting into excel and getting the unicode for the mystery character, and it did indeed come back as not an ampersand.. but what was it.. A little more searching and I cam e across this:
  4. that was the smoking gun. The system was transforming the input text as I was putting it in. so when I pulled it back out to compare to the new list, it was just subtly different enough to fail the comparison, and then once I tried to insert the text, it would transform it on the way in and throw an ugly error about key violations.
    Solution in my case was straight forward, I did not need to transform the text back into it original form. I just needed to know if what I was looking at was already in there. So I Used the TaxonomyItem.NormalizeName method to pre transform my input text and then compared that to what was already in the terms collection.
    worked out much better.

Creating a Copy of a Custom Sitemap in SharePoint 2010

10 Sep
  1. I wanted it cached and I was planning to use the HTTPruntime to handle the caching in my code. The issue I ran into was that since the root object was a complex reference type with deep nested elements, the changes and trimmings I made to the data ended up propagating all the way back into the HTTP Run time cached object. I came across this link which seemed to cover the issue.
  2. However that method required that and iclonable interface be implemented. So that did not work since the object was just a bare data class/structure.
  3. This method looked promising, but also did not work. So I accepted that I was going to have to create my own copy logic and attach it to the base object as a method. So I did some searching and found this very helpful article.
  4. the only change I needed to make was swapping out one argument type here.
  5. the original article called for a fieldinfo array to be grabbed from the type, but the way I had it set up, I needed to grab the propertyInfo array from getproperties. And since this was a List<string> type in my example, I then had to iterate over it to copy the object.

    Once I made these changes, I was able to new up a copy of the original object, avoid all the calls back to the taxonomy store, and make whatever trims and modifications I wanted without corrupting the base object.
    pretty handy, and not to hard to pull off.