U4-7681 - Legacy CMSNode.Parent uses old SqlHelper API and doesn't keep a reference

Created by Shannon Deminick 08 Jan 2016, 12:32:32 Updated by Sebastiaan Janssen 12 Jan 2016, 13:48:59

This is an issue because there are a few places where this API is used - namely during publishing in PublishNodeDo which will cause some SQL to execute unnecessarily.

Further to this, any call to CMSNode.Parent.Id can be entirely replaced by using the underlying non-legacy entity type's Id. For example in PublishdNodeDo, we can do this instead:

before:

var parentId = d.Level == 1 ? -1 : d.Parent.Id;

after:

var parentId = d.Level == 1 ? -1 : d.ParentId;

This single change in PublishNodeDo will save an SQL query for every item that is published.

Comments

Shannon Deminick 08 Jan 2016, 13:00:48

PR for review: https://github.com/umbraco/Umbraco-CMS/pull/1004


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.0.0, 7.1.0, 7.0.1, 7.0.2, 7.0.3, 7.0.4, 7.1.1, 7.2.0, 7.1.2, 7.1.3, 7.1.4, 7.1.5, 7.3.0, 7.1.6, 7.1.7, 7.1.8, 7.1.9, 7.2.1, 7.2.2, 7.2.3, 7.2.4, 7.2.5, 7.2.6, 7.2.7, 7.4.0, 7.2.8, 7.3.1, 7.3.2, 7.3.3, 7.3.4

Due in version: 7.3.5

Sprint: Sprint 6

Story Points:

Cycle: