In privatemsg_privatemsg_name_lookup the str_replace strips out spaces, because of wrapping [user] in the t-function.

Removing the t(), makes it work.

Patch against current 1.x-dev follows.

Thanks,
Walter

CommentFileSizeAuthor
#1 user-spaces-1751252-2.patch627 bytesvalderama
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

valderama’s picture

FileSize
627 bytes

Here is a patch..

valderama’s picture

Status: Active » Needs review

setting to needs review,

thanks,
walter

Sutharsan’s picture

Status: Needs review » Reviewed & tested by the community

I think the patch is good, but IMHO for the wrong reason. It does not strip spaces, unless someone translated '[user]' with at space.

+++ b/privatemsg.moduleundefined
@@ -981,7 +981,7 @@ function _privatemsg_parse_userstring($input, $types_limitations = array()) {
 function privatemsg_privatemsg_name_lookup($string) {
   // Remove optional user specifier.
-  $string = trim(str_replace(t('[user]'), '', $string));
+  $string = trim(str_replace('[user]', '', $string));

What is t('[user]') doing here anyway? The string should not be translated at all, it is a token. It is not even the value of the token.

ptmkenny’s picture

Status: Reviewed & tested by the community » Needs work

Patch should not be accepted "as is" because of the issue with t() noted in #3.

Sutharsan’s picture

@ptmkenny, but what problem are we solving here? In my view the patch is good, because it removes an unwanted t().

ptmkenny’s picture

Status: Needs work » Reviewed & tested by the community

Ah, sorry, I misread your comment. Setting it back...

Berdir’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to all relevent patches, thanks for testing.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.