parent_node variable missing in hook_form_alter()
threexk - June 30, 2009 - 00:59
| Project: | Node Relativity |
| Version: | 5.x-2.5 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
In 5.x-2.4, child nodes had a variable $form['#node']->parent_node at hook_form_alter() that linked them to their parents. In 5.x-2.5, it seems to have disappeared. So far I haven't found the commit that removed it. This breaks my code that depends on that link.
Without this link, to determine the parent node in hook_form_alter() I think you'd have to parse the URL, which is considering a hack, right?

#1
I am using this variable to customize the node form based on the parent node.
#2
The culprit seems to be this change in hook_nodeapi():
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/relativity/...
which removed op 'validate' and its supporting code, at the same time by relying on arg() in the 'insert' part it also broke the ability to create relationships programmatically