1

In Drupal 7.. I'm trying to create a rule that copies the user's profile picture into an image field on another content type. How can I select the 'picture' from a user's account, as a source for copying? The event is after updating an existing account, which provides the source 'account'. The File Field Rules module provides the copy action, but it requires a source field, and the user-picture isn't a field.

Another approach I tried is with the file URL. The FileField Sources module allows the use of a remote URL in an image field, but if I try to set the value of the image field with the token [account:picture:url] Rules doesn't allow it.

There is a similar question here Rules: Copying field from user's account to field in content type but the solution is with an additional field attached to the user, not with the default 'picture' one.

thanks, d

  • i have not tryed, solution could be with views-rules module and inject user picture in to your rule. – pinueve Jan 17 at 19:49
  • yesss!! it works. you made my day! if you put it in an answer (ie not a comment) i can mark it as solving my problem... thank you.. – dnoncoder Jan 19 at 6:42
  • done, thanks in advaced to accept and up-vote my answer, regards – pinueve Jan 19 at 18:11
2

Install views rules module, make a views-rule of users, if you need UID as a contextual filer add it as always, then in middle column set your UID as an integer in parameters settings, add user pictures as a field, now in middle column settings, set user-pictures as an file entity. then in your rule, fetch entity by id with your variable UID, now you have user picture avilable and can be copied to your content type file field. Done, cheers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.