Summary Links Web Part Malfunction

Leave a comment

Have you ever tried to add new columns to a Summary Links Web part and got an unexpected result?  Well, this happened to one of the clients I was working with.

It’s a simple task. Right?

When the user changed the layout of the Summary Links Web part to five columns per group, instead of getting five columns across the Web part, the columns were stacked on top of each other.

SummaryLinksLayout

It made no difference when it was changed to any value greater than one, the columns continued to stack on top of each other.

SummaryLinksGroups

After some research, it turned out that it was related to the theme applied to the site.  In my opinion, this is very strange.  The site’s theme was changed back to an OOTB theme, and the columns behaved the way they are expected.

SummaryLinksGroups2

Happy SharePoint-ing!

SharePoint ReferenceError: ‘Strings’ is Undefined

Leave a comment

Earlier this week I ran across the most unusual error in SharePoint.  The strangest thing was that it impacted IE only while Chrome continued to work.

Here’s the site in IE:

ieerror

And the same site in Chrome:

chromescreen

In the midst of troubleshooting, I did not get a chance to capture many screenshots. But the one thing I captured was the virus scan window; it popped up every time I refreshed IE browser window.

trendmicrovirus

It was pretty obvious to me that it was not SharePoint as I was able to work in Chrome.  But I continued to comb through logs just to be sure.

After a couple of hours, the security team reported that they rolled back the Trend Micro pattern file due to the widespread errors reported globally.  SharePoint in IE was working once again.

Trend Micro released a new pattern to correct this issue.  It can be downloaded here.

 

SharePoint List Cell Borders

Leave a comment

I received a request from one of my clients to put borders around each cell in a SharePoint list.  There were no out-of-box styles that I could use to fulfill this request.  I ended up using a simple script for it.

The standard list with some content without any styling:

ootblist

I added a Script Editor Web Part the page with the following code:


<style type="text/css">
.ms-vb-imgFirstCell.ms-vb-imgFirstCell.ms-vb-imgFirstCell {
border-right-width: 1px;
}
table.ms-listviewtable > tbody > tr > td {
border: 1px solid black;
}
.ms-viewheadertr th {
border: 1px solid black;
}
</style>

The same list with borders:

listwithcellborders

 

SharePoint 2013:Subsite Creation Error

Leave a comment

Users with ‘Full Control’ permission on a site collection, even site collection administrators, could not create a subsite.

The only error they receive is “Sorry, you don’t have access to this page”SubSiteAccessDenied

First, I thought it had something to do with permissions on the hidden list (/Lists/TaxonomyHiddenList).  I granted the users ‘Full Control’ on this list.  Nope, that wasn’t it.

Then, I thought it was related to the Master Pages or Page Layouts.  I granted the users ‘Full Control’ on this list, too.  Nope, that wasn’t it either.

After digging through the ULS, I found the following entries.

FollowedContent.FollowItem:Exception:System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))     at Microsoft.SharePoint.Utilities.SPUtility.HandleAccessDenied(Exception ex)     at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bPreserveItemUIVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bUnRestrictedUpdateInProgress, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValida… 667d969d-3189-d082-cda8-1bb13d261267
…tionCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback)     at Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion)     at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion)     at Microsoft.SharePo… 667d969d-3189-d082-cda8-1bb13d261267
…int.SPListItem.Update()     at Microsoft.Office.Server.UserProfiles.SPSocialDataStore.WriteFollowedItem(FollowedItem item, FollowedItemData data)     at Microsoft.Office.Server.UserProfiles.SPSocialDataStore.Follow(FollowedItem item, FollowedItemData data, Boolean checkLimit)     at Microsoft.Office.Server.UserProfiles.FollowedContent.FollowItem(FollowedItem item, Boolean isInternal) 667d969d-3189-d082-cda8-1bb13d261267
Could not follow the url http://myportal.local/dept/<SiteCollection/<Sub-Site>/ 667d969d-3189-d082-cda8-1bb13d261267
SiteFeedFeatureReceiver: exception thrown while trying to auto-follow the web: Microsoft.Office.Server.UserProfiles.FollowedContentException: InternalError : Could not follow the item http://myportal.local/dept/<SiteCollection>/<Sub-Site>/ at Microsoft.Office.Server.UserProfiles.FollowedContent.FollowItem(FollowedItem item, Boolean isInternal)     at Microsoft.Office.Server.UserProfiles.FollowedContent.Follow(Uri url, FollowedItemData data)     at Microsoft.SharePoint.Portal.SiteFeedFeatureReceiver.AutoFollowWeb(SPWeb web) 667d969d-3189-d082-cda8-1bb13d261267
Feature receiver assembly ‘Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’, class ‘Microsoft.SharePoint.Portal.SiteFeedFeatureReceiver’, method ‘FeatureActivated’ for feature ’15a572c6-e545-4d32-897a-bab6f5846e18′ threw an exception: System.Threading.ThreadAbortException: Thread was being aborted.     at Microsoft.SharePoint.Portal.SiteFeedFeatureReceiver.AutoFollowWeb(SPWeb web)     at Microsoft.SharePoint.Portal.SiteFeedFeatureReceiver.FeatureActivated(SPFeatureReceiverProperties properties)     at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce) 667d969d-3189-d082-cda8-1bb13d261267
Feature Activation: Threw an exception, attempting to roll back.  Feature ‘SiteFeed’ (ID: ’15a572c6-e545-4d32-897a-bab6f5846e18′).  Exception: System.Threading.ThreadAbortException: Thread was being aborted.     at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce)     at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce) 667d969d-3189-d082-cda8-1bb13d261267

From what I can translate, the “Site Feed” feature was not able to be activated thus not allowing the new site to appear (or written) to “Sites you’re following” on the user’s My Site. This is true when selecting a Team Site, Project Site, or Community Site template.

I realized that all My Sites have been set to read-only (Governance Policy).  By switching from ‘Read-only’ to ‘Not locked’ via Central Admin, the users were able to create subsites successfully.

Read-Only

Learn more about Centric’s Portals and Collaboration Practice

There has been an error while loading the form

Leave a comment

Have you ever tried just simply clicking on an item in a list and get the following error?

“There has been an error while loading the form because the fields in the form and SharePoint list do not match.”

LoadFormError

As you can see in the error message above that the ‘Approver’ field is the root cause of this error.

In my previous post when I was getting the workflow error on this list (I’ll call it List A), I changed this column for allowing multiple values from ‘yes’ to ‘no’.  Now, I can’t even open an existing item from List A.

The same settings were also made on a different list (I’ll call it List B) on the same site, and List B continues to work.

After much head scratching, I started comparing form settings of both lists.  List A has two options for loading forms.

FormDefaultOptions

While List B has only one option.

FormOptions

Both lists use out-of-box SharePoint list form, after selecting ‘Use the default SharePoint form’, I was able to open list items on List A again.

Learn more about Centric’s Portals and Collaboration Practice

 

Automating Site Directory in SharePoint 2013

Leave a comment

A while ago I posted on how to display Sites or Site Collections using Content Search Web Part here.

Well, since CSWP periodically displays “Sorry, something went wrong”, users are not happy with this solution.

So, I wrote a PowerShell script to update a list called “Site Directory”, and placed it on the home page.  I then added one additional logic to get new site collections created from the previous day.  After adding the script to Task Scheduler, I didn’t have to worry about missing newly created site collections.

To get all of the site collections created from the previous day, I used:


$Today = [DateTime]::Today
$Yesterday = $Today.AddDays(-1)

$siteCollections = Get-SPWebApplication http://demosite.vee.local | Get-SPSite -limit ALL | where {$_.RootWeb.Created -ge $Yesterday}

Now keep in mind, $Today will return today’s date at midnight and the same goes for $Yesterday (yesterday’s date at midnight).  I pointed this out to make sure that when you schedule this script in the Task Scheduler, you set it to run accordingly.  And, of course, replace the Web application with your Web application.

Writing it to a list was pretty straightforward, I added a category to the list, so I would have an additional option to display different views on the page.

In this list (Site Directory), there’s a hyperlink column.  I wanted the users to click on the hyperlink using a display name instead of the URL.  So, the $hyperlink in the script, will display the “friendly name”(ex: Coffee Beans) instead of the URL (ex: http://demosite.vee.local/dept/coffee%20beans).


foreach($siteCollection in $siteCollections)
{
  $web=$siteCollection.Rootweb;

  $web.Title + "," + $siteCollection.Url + "," + $web.Created | Out-File -Encoding Default -Append -FilePath $outFile;
  
  $siteCollection.Dispose()
};

$newItem = @{}
$sites = Import-Csv -path $outFile

$web = Get-SPWeb "http://demosite.vee.local";
$list = $web.GetList("http://demosite.vee.local/lists/Site Directory");

foreach($site in $sites)
{
  $siteURL =  $site.URL
  
  if($siteURL -match "/apps/")
  {
    $category = "APPS"
  }
  elseif($siteURL -match "/dept/")
  {
    $category = "DEPT"
  }
  else
  {
    $category = "DEFAULT"
  }
    $newItem = $list.items.Add();
    $newItem["Title"] = $site.'Title'
    $hyperlink = $site.URL + ", " + $site.Title
    $newItem["SiteURL2"] = $hyperlink
    $newItem["Category"] = $category
        
  #$newItem.Update();
  $web.Dispose();
};

Well, since I made this change, the users are happy.  No complaints! 🙂

 

CSWP: Display Template Listing Sites/Site Collections

1 Comment

One of the clients I’m working with wanted to list all of their site collections and place a “directory” on a single page with some groupings (based on managed paths).

The easiest way I could think of was to use Content Search Web Parts (CSWPs).

I used the following query:

QueryBuilderSiteCollection

My search result looked like this.

SiteCollectionPreview2

Note: You can change the query to display all sites within a site collection by using STS_Web instead of STS_Site.

The OOTB list of sortable items of the Query Builder didn’t have an option for me to sort the site title alphabetically.  So, I made a change to the SiteTitle in Search Scope (Managed Properties) to include sortable.  And I waited until Search finished crawling/indexing the modified setting.

After Search finished indexing, I was able to select the the setting I needed to sort the sites by their titles.

I selected the Two Lines Display Template.  However, the OOTB display was not exactly what the client was looking for.

TwoLineDT2

So I started modifying the display template to get rid of the icon/image displayed in front of each link and the spacing between the links.

I renamed my Display Template to “Item_NoImageOneLine.html”, changed the Title to “No Image One Line”, added a style tag, and commented out the image section.

<div class="cbs-Item" id="_#= containerId =#_" data-displaytemplate="Item1Line" style="padding-bottom:5px">
<!--<a class="cbs-ItemLink" title="_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_" id="_#= pictureLinkId =#_">
<img class="cbs-Thumbnail" src="_#= $urlHtmlEncode(iconURL) =#_" alt="_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_" id="_#= pictureId =#_" />
</a>-->
<div class="cbs-Detail" id="_#= dataContainerId =#_">
<a class="cbs-Line1Link ms-noWrap ms-displayBlock" href="_#= linkURL =#_" title="_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_" id="_#= line1LinkId =#_">_#= line1 =#_</a>
<!--#_

Here’s the final result.

TwoLineDTFinal

Learn more about Centric’s Portals and Collaboration Practice

Older Entries