Thursday, 8 March 2012

Multi-Tenant SharePoint 2010 workflows appearing only in English Language sites

I was facing a problem with a Multi-Tenant SharePoint 2010 setup. Basically my setup was following the  guidelines in the White paper: SharePoint 2010 for hosters (SharePoint Server 2010). The interesting part in the white paper related to the problem is the script in the Appendix at the end of the document to create the default Foundation, Standard, and Enterprise feature packs.  When I configured my Farm I ran this script. Basically the script creates the 3 features packs and enables the corresponding sets of SharePoint Features for those features packs.

I have the SharePoint 2010 Arabic language pack installed in the farm. The problem occurred when I wanted to add the "Approval - SharePoint 2010" workflow on a document library on an Arabic language site. The workflow is an out of the box workflow that is a part of the Standard and Enterprise Feature packs.

On the English Site (within the same collection), I was able to add the workflow without any problem and I was getting this when I add the workflow. 

While in the Arabic Site I was getting only Disposition Approval and Three-State workflows to select from.

This problem had me pulling the couple of hairs I still have left in my head for sometime, especially that in other farms it works just fine. After some investigation and help from my colleagues Tarek Yehia and Shady Khorshed I finally figured it out.

Basically the script that created the Standard and Enterprise feature packs had the following 3 lines

AddFeature -identity $sfp -FeatureDefinition ReviewPublishingSPD1033 -ea SilentlyContinue
AddFeature -identity $sfp -FeatureDefinition ReviewWorkflowsSPD1033 -ea SilentlyContinue
AddFeature -identity $sfp -FeatureDefinition SignaturesWorkflowSPD1033 -ea SilentlyContinue

Notice the 1033 in the feature names (which is Locale ID for English United States). It means that the Tenant is subscribed to the English Language features but not to the Arabic Language Feature which has Locale ID of 1025 (Arabic Saudi Arabia).
So I wrote a quick powershell script to add the Arabic language features to all the feature packs where the corresponding English Language Feature was installed. 

$allPacks = Get-SPSiteSubscriptionFeaturePack 

foreach ($featurePack in $allPacks)
    $featureDefinitions = $featurePack.FeatureDefinitions | ? { $_.DisplayName -match "1033" } | % { $_.DisplayName.Replace("1033", "1025") }
    foreach($feature in $featureDefinitions)
        if (-not ($feature -eq $null))
            Add-SPSiteSubscriptionFeaturePackMember -Identity $featurePack -FeatureDefinition $feature -ErrorAction SilentlyContinue

After running this script, I deactivated the Workflows and Publishing Workflows features on the site collection, then reactivated them again, and everything worked like a charm. And I was able to add the previously missing workflows to my Library.

I kept the script for the future, because I will need to run it whenever I add a new language pack to my farm (after changing the 1025 to the LCID of the language I am installing).

1 comment:

  1. you can use " Enable-SPFeature -Identity ReviewPublishingSPD1025 -url http://YourSite"
    it works for me