If i click on a Messagelink in a Users Profile, it adds [user] at the end of the Subject and the Site Title.
See Screenshot.
I have created a different Role, and i have Installed a fresh Version of Drupal 6.20 and Privatemsg 6.x-2.x-dev with no other Modules, but it doesn work.
I have tested this local on my Computer and also on a live Site.

CommentFileSizeAuthor
Bildschirmfoto-1.png28.35 KBSammelzwerg

Comments

berdir’s picture

Title: Write new message to contains : [user] » Only add the unique identifier for users added through the URL if necessary
Category: bug » task
Issue tags: -link, -profile

This is not a bug, you'll notice that sending messages works just fine ;)

We did it like this to ensure uniqueness. With just users, it is somewhat redudant but just take realname.module into the equation, where you might have 5 users with the real name "John Wayne", then the recipient would look like "John Wayne [user:123]".

However, that uniqueness stuff should only be added if it's necessary, so let's try to figure that out here.

zhongguo999999’s picture

Version: » 6.x-2.x-dev

I think that it is somewhat redundant if I don't use the realname.module.

Others:
1. the [user] can't be translated to the language preferred by the user.
2. The user(consumer) will get lost in the [user:123].
3. The user(consumer) can choose whether to display the [user] if it's necessary.

berdir’s picture

No, the user can not decide if it is necessary or not. That's something only the system can figure out. realname.module is just one example, it might also be possible that there is a user and a role of the same name. Or a relationship, or a group...

So we need to implement a way to check if there are any possible cases where the user name is not unique and only then display it. Until then, we have to display it always, just to be sure.

beumont’s picture

I just got rid of the "To" with the following code. The messaging is still working on my website so this is my solution :)

<?php
function custom_1_form_privatemsg_new_alter(&$form, &$form_state) {
  // Check if a default value is configured for the to field.
  if (!empty($form['recipient']['#default_value'])) {

    // Display a visible markup element.
    $form['recipient_display'] = array(
      '#value' => '',
      '#weight' => -10,
    );

    // Convert the recipient field to a value type and force the default value.
    $form['recipient']['#type'] = 'value';
    $form['recipient']['#value'] = $form['recipient']['#default_value'];
  }
}
ptmkenny’s picture

Category: task » support
Status: Active » Closed (works as designed)