Let's take this circumstance:
- We are on a child node edit form: URL
node/2365/edit - We submit the form
I'm expecting to have the parent tokens [parent-*] correctly calculated after submitting the form. As an example I get wrong titles using the Automatic Nodetitles when using [parent-*] tokens in title pattern. All [parent-*] tokens are empty.
This is happen because the $node->parent_node is wrong calculated in
function relativity_nodeapi(&$node, $op, $teaser, $page) {
if (is_numeric(arg(4))) {
//check if parent node actually exists
if (db_result(db_query("SELECT COUNT(nid) FROM {node} WHERE nid=%d", arg(4)))) {
if (array_key_exists(arg(2), relativity_node_list())) {
$node->parent_node = arg(4);
}
}
}
elseif ($_POST['parent_node']) {
$node->parent_node = $_POST['parent_node'] + 0;
}
...
In our case (URL node/2365/edit) neither arg(4) or $_POST['parent_node'] are set to match the parent node.
Here's a patch that fixes this bug.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | relativity_fix_parent-629650-D6.patch | 1.55 KB | claudiu.cristea |
| relativity_fix_parent-D6.patch | 1.04 KB | claudiu.cristea |
Comments
Comment #1
claudiu.cristeaTicket http://drupal.org/node/569386 deal with this.
Comment #2
claudiu.cristeaReworked patch against DRUPAL-6--1.
Comment #3
claudiu.cristea