On one Drupal 6 Intranet portal I enabled Content Profile, Token, Pathauto, Node Auto Title and Revisioning.

I log in as user 1 (Admin), and browse the user list. I click on a user that has no profile yet, and click on the "Create Profile" link. I see the new editable profile page which bears the name of the user I'm creating the profile for as non-editable title. So far this is what I expect.

When I'm done editing the user's profile, I hit "Save". Now I get status messages that tell me that some weird things happened while saving. Indeed, the page title is replaced with my name (the user who edited the profile), and the automatic URL aliases attempt at creating aliases for me instead of the user.

The replacement token pattern I use for Pathauto is: "who_is/[title-raw]"
The replacement token I use for automatic profile page title generation is: "[user-name]"

Clearly this Drupal setup is having problems in knowing which [user-name] to use: the account being edited or the user that edits a profile belonging to another account.

I am reporting this bug here, but it may be linked to recent upgrades of a couple modules:

  • Automatic Nodetitles recently went from version 6-x-1.1 to 6-x-1.2
  • Revisioning recently went from version 6.x-2.6 to 6.x-2.7
  • Module Grants (on which Revisioning depends) recently went from version 6.x-2.5 to 6.x-2.6

Best regards,

Olivier

Comments

ShutterFreak’s picture

Update: this does only apply when someone creates a new profile for another user.

The module behaves as expected when editing someone else's existing profile.

ShutterFreak’s picture

In debugging this issue I checked the entries in the 'node' table and in the 'node_revisions' table.

All node entries relating to the content type associated to the "content profile" module featured the following behavior:

  • In the node table the 'uid' value is correct, but the 'title' value reflects the author's name and not the name of the user whose profile is being created.
  • In the node_revisions table the uid is not correct and reflects the author's uid, not the uid of the user whose profile is being edited. The title is also incorrect: it represents the author's name instead of the user name.

To fix my setup I have to follow the following steps:

  1. Retrieve a list of nids of nodes linked to the content profile module and the auto_nodetitle module for which the title is NOT the user name:
    SELECT nid FROM node n LEFT JOIN users u ON n.uid = u.uid WHERE n.type = 'profile' AND n.title <> u.name;
    
  2. For each of the returned nodes, set the node title to the user name:

    UPDATE TABLE node n SET TITLE = (SELECT name FROM users u WHERE u.uid = n.uid) WHERE n.nid = NID;
    UPDATE TABLE node_revisions r SET uid = (SELECT uid FROM node n WHERE r.uid = n.uid), title = (SELECT name FROM users u WHERE u.uid = n.uid) WHERE r.nid = NID;

    (replace NID with the a value returned by the previous query) (note: I did not try these queries so they may not work out of the box - but the idea is there)

Hope this helps in pinning down this bug.

fago’s picture

Category: bug » support
locomo’s picture

subscribe