I'm not very familiar with the D6 version, so it could be that I'm misinterpreting the functionality, but I noticed that if you submit a title name without a nid in the node hierarchy "parent node" textbox (e.g. by pasting it in), it is possible to set a node as its own parent. I'm not sure if this is a bug or by design, so feel free to change the status.

I've added a validation check (patch in comments below) when no nid has been given to prevent a node being set if _nodehierarchy_widgets_parent_autocomplete_options returns the current nid. Additionally, I added a more specific validation message for cases where someone tries to set a node as its own parent, either via an explicit nid or by title.

Comments

cfennell’s picture

cfennell’s picture

Component: Drupal/PHP Code » Autocomplete Widget
ronan’s picture

Status: Needs review » Fixed

Awesome, thanks. Commited to dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.