Closed (fixed)
Project:
lm_paypal
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Apr 2007 at 02:17 UTC
Updated:
24 Oct 2012 at 06:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
LeeMcL commentedAccording to http://drupal.org/node/137206 I am missing calls to hooks to inform other modules of role changes. I cannot find what these hooks are called so I've posted a comment on the end of that issue asking for their names so I can add them.
I guess these hooks are new as they didn't exist when I wrote LM_PayPal.
Lee
Comment #2
MrGeek commentedThe author posted a response to your question here:
http://drupal.org/node/137206#comment-233399
Comment #3
toemaz commentedI use lm_payal subscriptions for D5 and I'm in need of capturing when a role has been assigned to a user. Using user_save instead of inserting the role directly into the database solve this issue. So I rewrote function lm_paypal_user_gain_role a little. The same should be done with
The same rewrite should be done for lm_paypal_user_loose_role
Remark: this code is for the D5 release but it's applicable to D6 as well since user_load and user_save didn't change.
Comment #4
toemaz commentedAttached patch which correctly uses user_save instead of directly performing an sql query which is not according the Drupal coding standards. The function user_save() has to be called so other modules can be invoked!
Comment #5
lyricnz commentedThat looks okay from a visual inspection. Did you run the simpletests?
Comment #6
lyricnz commentedUgh, simpletests seem pretty broken at the moment, due something committed by another maintainer.
Comment #7
fehin commentedI ran 6x with the patch through coder and it did not change the user_save line. Can I use that line as-is in 7x?
I need the user_save function for creating a rule to flag user on role change. I'm having a problem with that now because the current setup does not indicate account as been updated when the new role is assigned.
Comment #8
toemaz commented@fehin add api.drupal.org to your bookmarks
http://api.drupal.org/api/drupal/modules%21user%21user.module/function/u...
Comment #9
fehin commentedHi toemaz, thanks for the link.
The only difference between D6 and D7 is "array=" is replaced with "edit=". I'm not that good with drupal API yet but it looks like your current code should work with D7 too. Am I correct?
Comment #10
toemaz commentedThat's correct, but I haven't checked it beyond checking the function only.
Comment #11
fehin commentedThank you! I appreciate it.
Comment #12
john franklin commentedFixed in b38bc43. Modified version of the patch in #4 using user_multiple_role_edit().