U4-4548 - Installer: Error when upgrading database in UpdateRelatedLinksData.cs

Created by Vincent Baaij 28 Mar 2014, 15:02:03 Updated by Sebastiaan Janssen 31 Mar 2014, 09:57:34

In upgrading a 4.7 database to 7.1rc, the installer throws an error. I've tracked it down to Persistence\Migrations\Upgrades\TargetVersionSeven\UpdateRelatedLinksData.cs in the Umbraco.Core project.

In the UpdateRelatedLinksDataDo method the following code does not return any records (in my database at least) var propertyData = database.Fetch( "WHERE propertyTypeId in (SELECT id from cmsPropertyType where dataTypeID IN (@dataTypeIds))", new );

Because there are no records, the code after that throws an error

var nodesIdsWithProperty = propertyData.Select(x => x.NodeId).Distinct(); var cmsContentXmlEntries = database.Fetch( "WHERE nodeId in (@nodeIds)", new );

I've solved it by placing the following code between the two blocks: if (!propertyData.Any()) return string.Empty;

A pull request for this has been sent.

Comments

Sebastiaan Janssen 31 Mar 2014, 09:57:16

The PR (https://github.com/umbraco/Umbraco-CMS/pull/338) has been merged in, thanks!


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted: Pull request

Affected versions:

Due in version: 7.1.0

Sprint:

Story Points:

Cycle: