U4-3051 - GetAncestorOrSelfDocuments gets stuck in infinite loop

Created by Pete Duncanson 07 Oct 2013, 12:40:28 Updated by Lee Kelleher 13 Nov 2013, 12:11:32

DocumentExtensions.GetAncestorOrSelfDocuments has a habit of falling into an infinite loop. It struggles when it finds the root node which has an id of -1

If you follow the path of method calls (well constructors) you see that uQuery is expecting it to return a null yet it always finds a node so never throws a "node not found" error which uQuery is expecting to flag up the end of the loop so there is no null. This is causing it to keep looking until it times out.

Not sure how best to fix it as I'm not sure what it might affect. I'd suggest

This raised its head after going from 4.7 > 6.1.6 so new API mods caused it along the way.

Cheers

Pete

Comments

Lee Kelleher 12 Nov 2013, 20:50:21

I have just come across this very bug on one of my client's websites. I'm writing a patch and will submit a pull-request.


Lee Kelleher 12 Nov 2013, 21:25:51

Submitted a pull-request: https://github.com/umbraco/Umbraco-CMS/pull/244


Priority: Normal

Type: Bug

State: Fixed

Assignee: Lee Kelleher

Difficulty: Normal

Category: Architecture

Backwards Compatible: False

Fix Submitted: Pull request

Affected versions: 6.1.5, 6.1.6

Due in version: 6.2.0

Sprint:

Story Points:

Cycle: