Item version missing closing vitem xml tag

book

Article ID: 158687

calendar_today

Updated On:

Products

Management Platform (Formerly known as Notification Server) Deployment Solution

Issue/Introduction

Item version missing closing vitem xml tag.

Possible related errors:

Unhandled error.
Unable to load version {GUID.EN_US}
 

Cause

State table xml has a missing </vItem> tag off of the end.  Use the SQL to determine how many records have this problem:

SELECT ivd.Name, ivd.ModifiedDate, ivd.Description, ivd.State
FROM ItemVersionData ivd
WHERE ivd.state like '<vItem>%' and ivd.State not like '%</vItem>'

Environment

Deployment Solution 7.5 and later

Resolution

All of the items in the ItemVersionData state field should be properly formatted xml. The following SQL can automaticly fix missing end tags:

UPDATE ItemVersionData 
SET [State] = cast([State] as nvarchar(max)) + '</vItem>' 
WHERE [State] like '<vItem>%' and [State] not like '%</vItem>' and LEN(cast([State] as nvarchar(max))) < 4000 and [State] like '%></imaging>'

 

Attachments