Great module, thanks! I use it on many sites.
I have 'borrowed' the invite code to do a similar module called "referral", the invite module did about 90% of what I wanted and only about 10% of the functionality was extraneous so it was, I think, a good choice. There is just one problem that I can't quite figure out. The functionality I have added is that "referrals" allow a discount to be applied to the next purchase ... but the "purchase" is an auto mechanic shop, not online shopping, so I needed to add to the invite DB table two new dates (when the referrer and the referred people use their discount) ... as well as a way of manually adding a referral record.
The DB setup and new referral was a breeze, a simple form using the drupal_get_form() callback, but the "edit a referral paid date" requires a page callback similar to the invite_admin_details page. I am calling with 'page arguments'=>array(4) which I understand should provide me with arg(4) as the argument but what is HAPPENING is that arg(4) is being interpreted as a UID and converted into a $account record. This is a problem for me because arg(4) is intended to be a reg_code not a uid and so all hell breaks loose with this data mismatch.
I am really not a drupal coding expert however I do follow and use the docs at api.drupal.org, by my reading, the page callback should be giving me the arg not a user record. I figured that this might mean a hook_menu_alter was involved but I can't find any evidence of that. It is clear that invite_admin_details expects a user record, however, and so I am reaching out here because I hoped those familiar with this code would know immediately what is happening, why, and what I should be doing to combat the behaviour.
Comments
Comment #1
smk-ka commentedWhat object an URL argument will be expanded to is controlled by hook_menu(): using invite_admin_details as example, just replace %user in the $item's path with %invite, and given a reg_code as argument it will be expanded into a readily loaded invite object. For example, you could create a new menu item with a path like this (replace myhandler with your action):
$items['admin/user/invite/myhandler/%invite'] = array(...Comment #2
Dave Kinchlea commentedSometimes the brilliance of the system simply eludes me ... thanks very much!
Comment #3
smk-ka commentedNp, closing.
Comment #4
Dave Kinchlea commented