Hello,

with the latest version of your module I get this error:

Notice: Array to string conversion in token_replace() (line 102 of /.../includes/token.inc

In the past I had have the same conflict with the two modules Realname an Namefield as you can read in this thread:

http://drupal.org/node/1649458

Any ideas?

Best regards
Frank

Comments

fraweg’s picture

No idea in that ? :-(

spleshka’s picture

Unfortunately, have no ideas.

fraweg’s picture

This issue is only in the new version. The rc2 works with no problems...

No help in this issue?

dave reid’s picture

It appears that this module duplicates the [user:password] token that is added by core in user_mail_tokens() which causes this error.

http://drupalcode.org/project/rpt.git/blob/refs/heads/7.x-1.x:/rpt.modul...

spleshka’s picture

I think that problem may occur because of this code:

elseif (isset($data['user']) && !isset($data['user']->password)) {
  $replacements['[user:password]'] = t('Your password');
}

In previous release this module didn't provide any replacement if user object has no password. Some time ago this lines were added. Are they odd here?

fraweg’s picture

Hello,

thanks a lot for your post!

I think that problem may occur because of this code:

Yes this could be the problem. I test the "old rc2" version with this patch:

http://drupal.org/node/1774492 #3

After apply the patch the issue was there.

But I am not a developer. What can I change to make this work?

Best regards
Frank

spleshka’s picture

Just comment the code like this:

// elseif (isset($data['user']) && !isset($data['user']->password)) {
  // $replacements['[user:password]'] = t('Your password');
// }

Or just remove this line from module. This is a temporary solution, but it will work for now.

fraweg’s picture

OK ... thanks a lot for your help in this issue!

Best regards
Frank

plazik’s picture

Component: Miscellaneous » Code
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new498 bytes

Patch from solution in #7 comment.

sumthief’s picture

Patches attached in #7 and #9 solve problem temporary.

I think we just need do checking by tokens which exists at the moment when hook invokes like it done in other modules (as example 'user' module in core). Otherwise it will create replacement every time when hook_tokens invokes and user passed as data.

captainack’s picture

Thanks guys. #10 worked for me :)

kala4ek’s picture

Status: Needs review » Reviewed & tested by the community

Seems #10 is ok.

caschbre’s picture

Status: Reviewed & tested by the community » Needs work

The patch file generated in #10 should be regenerated from the rpt module folder and not the drupal root folder. The patch as-is can only be applied if the module is in sites/all/modules/contrib/rpt which won't be the case for all sites.

sumthief’s picture

StatusFileSize
new945 bytes

Thank you for the catch @caschbre.

Here is regenerated patch to 7.x-1.x branch.

sumthief’s picture

Status: Needs work » Reviewed & tested by the community

Set back RTBC.

tyler.frankenstein’s picture

+1 on #14 being RTBC, works for me.

  • kala4ek committed 62042b5 on 7.x-1.x authored by sumthief
    Issue #1973974 by sumthief, tyler.frankenstein, caschbre, kala4ek:...
kala4ek’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed #10 into latest dev release.

Status: Fixed » Closed (fixed)

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