In admin/rules/trigger, I have cloned the default trigger "Send welcome message with privatemsg when a new user is created".
I have enabled the clone but not otherwise made any other changes.
I expected a welcome private message to be sent to the new user.
Instead, when I tested the feature and tried to register a new account, upon submitting the register form, I got a blank page in return. Reloading the page showed the following errors:
warning: Attempt to assign property of non-object in privatemsg.module on line 2781.
warning: Attempt to assign property of non-object in privatemsg.module on line 2782.
Apparently no message was sent.
It may be relevant to note that new users must be approved by an administrator. New user accounts are blocked by default. Maybe there could be a trigger for when a user logs in for the very first time?
Presently, the very simple feature that worked very well with the Drupal 5 version became very complicated to set up and enable in 6--2 and is not working at all.
Comments
Comment #1
BerdirThis should work just fine, there is even a default rule that is pre-configured to do just this. It doesn't matter if the user is blocked, just make sure he has the permission to receive private messages.
Export your rule and post it here so that I can try to reproduce.
Comment #2
jennifer.chang CreditAttribution: jennifer.chang commentedThank you for looking into it.
I experienced the bug on the live site and I could reproduce locally, after enabling rules and privatemsg for the first time. I don't see the 'receive private message' permission, but authenticated users have the 'read private message' and 'write private message' permissions. Same problem.
I *had* used the pre-configured role. On one site I edited it and when I enabled and saved it, I noticed the machine name was conveniently altered. On the other site, I used the 'clone' button and beside enabling it, I didn't do any specific change.
Here is the exported rule:
On the local / test site, I got even more errors than I had when I first tested on the live site:
I tried to debug the first of those error and inserted some calls to dpm() at the start of the first function:
Both $recipient and $author are expected to be objects, Unexpectedly, it's not the $recipient that caused problems (at least at this stage) but the $author (i.e. user/1) who is not an object representing a user but an array representing the message:
At this stage, I got stuck because I didn't manage to figure out who was the calling function.
That's all I've got.
Comment #3
jennifer.chang CreditAttribution: jennifer.chang commentedP.S.
Above, I inserted some spaces in the PHP tags, because they were messing with the formatting of the comment within this issue.
'body' => 'Hey < ?php $account->name; ? >, welcome on our site!'
Comment #4
Mobo CreditAttribution: Mobo commentedHi I get the exact same error. Really hope that we can find a fix !
Thanks
Mobo
Comment #5
jennifer.chang CreditAttribution: jennifer.chang commented@Berdir: have you been able to reproduce with the requested info that I provided?
Comment #6
konordo CreditAttribution: konordo commentedSame issues too. I made it working by building the rule from scratch, instead of using the pre-configured one that comes with the module (The author does not appear to be a user object, as jennifer.chang says above).
I understand this is not really helpfull, sorry for that - I will try to come back to it if time allows.
Comment #7
oadaeh CreditAttribution: oadaeh as a volunteer commentedThis issue is being closed because it is against a branch for a version of Drupal that is no longer supported.
If you feel that this issue is still valid, feel free to re-open and update it (and any possible patch) to work with the 7.x-1.x branch (bug fixes only) or the 7.x-2.x branch.
Thank you.