Broken SharePoint - it's basically an art form

Problematic behavior of web.AddSupportedUILanguage(int lcid) in SharePoint 2013 and 2016

Reading Time: 4 minutes. Every now and then, an API or a method call comes along, that you need to be very careful with. “Microsoft.SharePoint.Client.Web.AddSupportedUILanguage()” seems to be one of them. In this post, I’ll try and document my findings and workarounds for said method!  Issues and solutions Posts Related to “Problematic behavior of web.AddSupportedUILanguage(int lcid) in SharePoint 2013 and 2016”:SharePoint Localization – a (somewhat) comprehensive how-to!SharePoint-Teams -integration using a tabA cautionary tale of relying on the automatic backups in SharePoint Online

Trying to upload a 10kb file to SharePoint: "Sorry, your files couldn't be uploaded. The upload might be too large or the server might be experiencing high network traffic."

How to enable custom scripts for a SharePoint site collection?

Reading Time: 5 minutes. This article explains how to enable custom scripts for any SharePoint site. Different instructions apply to SharePoint Online, and on-premises scenarios (SharePoint 2013, 2016 and probably 2019). Different solutions resolve the issue for different target sites: Modern SharePoint Team Sites (attached to Office Groups) SharePoint MySites Personal OneDrive sites Any SharePoint site collection created based on self-service site creation SharePoint Online tenant root site collection Any Classic SharePoint site collection Errors and causes Most typically I run into this when trying to insert a script web part with custom JavaScript into a site, that has NoScript enabled. That’s annoying – […]

MFW another API just stops working without returning any errors

How to fix Twitter embed in SharePoint

Reading Time: 4 minutes. Twitter has always been good for developers, except for those who’d like to embed anything – hence making it possible to interact with their contents on other sites than Twitter. I guess it’s understandable, but they seem to hate anyone trying to embed feeds, searches or anything on their sites. And they express their hate by making the developers’ lives more difficult… This time by silently breaking the embed script in a way, that’s tricky to work around. The Problem In February 2018, Twitter announced that their widgets will start rendering fallback markup on IE9 and IE10 “in the near […]

How to show any page in a pop-up in SharePoint

Reading Time: 5 minutes. This ages old trick deserves to be published – since it makes it easy to quickly show info from pretty much any another page on pretty much any classic SharePoint page (in a SharePoint-compatible pop-up). So, here goes: Using SharePoint’s JavaScript library to open an arbitrary pop-up Yes – SharePoint contains all the functionality out-of-the-box, and you almost don’t have to do anything yourself! Let’s see how this works. Posts Related to “How to show any page in a pop-up in SharePoint”:SharePoint Localization – a (somewhat) comprehensive how-to!How to enable custom scripts for a SharePoint site collection?Getting Connect-MsolService (and other […]

SharePoint doesn't work as intended

Opening a web part page in maintenance mode

Reading Time: 3 minutes. Can’t access a web part page because of a broken web part? Yeah, that’s a classic issue – and it’s nicely ported into Modern world, too! In these cases, web part page maintenance mode comes in handy! There’s a query parameter available for accessing it. For whatever reasons, it’s different for Classic and Modern mode, though. Why make things easy if you can make them dificult, right? 🙂  Posts Related to “Opening a web part page in maintenance mode”:SharePoint-Teams -integration using a tabSharePoint Localization – a (somewhat) comprehensive how-to!The effect of using Managed Navigation instead of Structural on SharePoint Online

SharePoint vs. Anonymous

Troubleshooting: Anonymous access on a public SharePoint site collection failing

Reading Time: 4 minutes. Ah, everyone’s favorite, classic topic! Debugging SharePoint On-Premises configuration issues is the best thing since sliced bread, right? This post is about allowing/enabling Anonymous Access to a site collection – a simple configuration, that “simply works” like once every ten times you try it. Symptoms A lot of different ways to hit your head on this one. In any case, your on-premises SharePoint doesn’t allow anonymous access to a site where you are trying to allow it. Most typically, they’ll just encounter 401 error when accessing the site, or they might be missing some of the content or styles, resulting […]

Let me explain SharePoint

Don’t remove the root web of your classic SharePoint Site Collection!

Reading Time: 5 minutes. A quick heads-up – if you remove the root site (or RootWeb, like it’s called in the code) of your classic SharePoint Site Collection, that’s going to cause you some grey hairs. It might even, in some rare cases, be unrecoverable! Why? Whereas you can always restore a normal site from the site collection recycle bin, the root site you can’t. You actually can’t access the recycle bin after removing the root site, nor can you make magic happen with PowerShell commandlets anymore. The Recycle Bin would be located at a URL like this: https:///_layouts/15/AdminRecycleBin.aspx, but after the site is removed, […]

Anonymous access in SharePoint 2013

Using PowerShell to modify anonymous access permissions on SharePoint On-Premises

Reading Time: 2 minutes. This post is about managing Anonymous Access on a SharePoint site (SPWeb) using PowerShell commandlets. It’s often a lot more feasible and even easier than using the browser interface! In some cases, it’s borderline impossible to avoid it anyway – since accessing the GUI switch might not be possible. Description Assume you have a site collection that’s you have published to the whole world. You’ll have anonymous access enabled at both web application and site collection -levels, and configured permissions at the root web -level. Now, let’s assume you want to disable anonymous access on a certain site deeper in […]

Malformed web.config causing a Parser Error

“Server Error in ‘/’ Application” or “Parser Error” – it’s actually a malformed web.config killing your ASP.NET-application or SharePoint

Reading Time: 2 minutes. This post describes how to resolve a kind of cryptic and oddly misdescriptive error message about Parser Error on your ASP.NET application or (an On-Premises) SharePoint site. I ran into this after deploying wsp-packages to a SharePoint farm, but you can apparently get this on ASP.NET MVC sites, too. The error doesn’t actually tell you what’s wrong, so figuring it out took a while. Hopefully it’ll help you, though! Symptoms: Parser Error from a random-looking location Once you navigate to your web- or SharePoint site, you only get an error like this: Server Error in ‘/’ Application. Parser Error Description: An error […]

PowerShell logo

Quickest way to download all the wsp-packages in a SharePoint farm

Reading Time: 1 minute. Sometimes – pretty often in the good old on-premises world, actually – you’ll need to have a copy of all the packages that are deployed to a certain farm. So – how to download all of the deployed farm solutions (essentially, cabinet files renamed to .wsp) from a farm? Luckily, it’s quite easy! Solution To download all deployed farm solutions (wsp-packages) from a SharePoint farm is pretty simple using PowerShell. No need to download individual packages through cumbersome interfaces! You don’t even have to open the Central Administration! 🙂  Posts Related to “Quickest way to download all the wsp-packages in […]

SharePoint2013

How to properly use SPWeb.AllowUnsafeUpdates?

Reading Time: 2 minutes. At times you may need to allow unsafe updates for SPWeb objects to get your code to run. This, in SharePoint’s C# full-trust code, is done by setting SPWeb.AllowUnsafeUpdates to true. However, as this is an exception to security settings, you should generally avoid it. When you can’t, it’s a good practice to limit the change to as small a scope as possible. This is true even though the setting is only persisted for the duration of the request (unless the SPWeb object was gotten from SPSite.GetWeb() or SPSite.Webs[]). Enabling AllowUnsafeUpdates for an SPWeb object Posts Related to “How to […]

SharePoint List Field Name creation dialog - the internal names for created fields are generated from the display name, and often end up being quite messy!

Programmatically creating readable internal names for new SharePoint fields

Reading Time: 4 minutes. This post is about a small programmatic workaround to creating new SPFields for SPLists in SharePoint with human-readable internal names. This is mainly a usability improvement for your editors (and doesn’t change your life that much), but at the very least they will probably appreciate it! In short, I’ll show you how to avoid SharePoint’s dirty encoding (like replacing a space with “_x0020_”). This appliesto when you’re using server-side code to generate fields. Problem: non-readable internal names for SharePoint list fields When you create a new field in SharePoint, SharePoint accepts the following syntax: string internalName = list.Fields.Add("Field name – […]