1

We ran into the problem when upgrading SharePoint portal with custom solution from 2010 to 2013 version using database attach procedure.

Problem is that after mounting content database to SharePoint 2013, we got a number of javascript errors and also people editors on custom forms do not work anymore.

Both problems we describe below have connection with strange controls id's. We have tried installing our custom solution to new web application and created new site collection with new content DB and it did not produce any of those errors. Problem occured only in web application when we updated SP2010 content database to 2013 version.

Problem 1: Javascript error is present in 2010 mode (before updating site collection to 2013 mode) and after updating the site collection to 2013 mode. When we have default v4.master page applied, javascript errors occur: SCRIPT1010:Expected identifier, SCRIPT5009: "_spNavigateHierarchy is undefined".

spNavigateHierarchy undefined

Looking deeper into problem, we found out that error occurs due to missing form id in _spNavigateHierarcy function:

spNavigateHierarchy function

Page source reveals that form id of page is not standard »aspnetform« but strange control id:

FormId

We found out that if we remove TreeViewAndDataSource delegate control from master page, javascript errors disappear, but that is not solution for the problem.

Problem2: People picker OK button is disabled even if browsed user is selected on people selection popup. Editor cannot click on OK button and add user to selection:

People selection popup

Problem is that input id of button is wrong. Expected id of OK button in entityeditor.js javascript file is: g_OKButtonID="ctl00_PlaceHolderDialogButtonSection_btnOk";.

OKButton

Button is initially disabled on page load. OK button should be enabled on user selection, but it cannot be due to missing/wrong control ID (different control ID as in javascript).

Update procedure we used:

a) Create new Sharepoint 2013 web application in classic autentication mode:

New-SPWebApplication -name "WebAppMigration" -Port 80 -ApplicationPool "MigrationAppPool" -ApplicationPoolAccount (Get-SPManagedAccount "DOMAIN\username")

b) Install custom solutions in 2010 compatibility mode:

Add-SPSolution -LiteralPath "C:\WSP\Solution.wsp"

Install-SPSolution -Identity Solution.wsp -GACDeployment  -CompatibilityLevel 14 –Force

c) Add safe controls in web.config

d) Create new database on SQL Server and add farm account with db_owner and db_securityAdmin rights.

e) Restore Sharepoint 2010 content database into created database

f) Test content database:

Test-SPContentDatabase -Name "contentdatabase" -WebApplication "webapplicationurl"

g) Mount content database:

Mount-SPContentDatabase -Name " contentdatabase " -DatabaseServer "databaseserver" -WebApplication "webapplicationurl"

h) Uninstall custom solutions:

Uninstall-SPSolution -Identity Solution.wsp
Remove-SPSolution -Identity Solution.wsp

i) Install custom solution in 2013 compatibility mode:

Add-SPSolution -LiteralPath "C:\WSP\Solution.wsp"

Install-SPSolution -Identity Solution.wsp -GACDeployment  -Force

j) Upgrade site collection

k) Convert application into claims:

Convert-SPWebApplication -Identity " webapplicationurl " –From Legacy -To Claims -RetainPermissions

1 Answer 1

1

We did not find source of the problem, but our solution was to generate web control ID's in .NET v2 mode:

<configuration>
    <system.web>
        <pages clientIDMode="AutoID" />

Now controls have right prefix "ctl00_".

Source: .NET 4 prefixing changes.

Your Answer

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

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