Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The following code in bio_menu():
34 : // user has a bio
35 : if ($nid) {
36 : $node = node_load($nid);
37 : $access = node_access('update', $node);
38 : }
39 : else {
40 : $node = (object) array('type' => $type, 'uid' => arg(1));
41 : $access = (($user->uid == arg(1)) && node_access('create', $type)) || user_access('administer nodes');
42 : }
Specifically line 40 has 'uid' => arg(1) which is useless since in node_form():
2052 : // If this is a new node, fill in the default values.
2053 : if (!isset($node->nid)) {
2054 : foreach (array('status', 'promote', 'sticky') as $key) {
2055 : $node->$key = in_array($key, $node_options);
2056 : }
2057 : global $user;
2058 : $node->uid = $user->uid;
2059 : }
$node->uid will be overridden anyways in line 2058.
Comments
Comment #1
owahab CreditAttribution: owahab commentedComment #2
owahab CreditAttribution: owahab commentedAfter testing, I found out that in line 40:
adding a 'name' => $user->name (without removing uid) makes managing bio nodes from paths rather then user/uid/bio working better.
Comment #3
sunPlease submit a proper patch.