It almost seems harsh posting this to the Forward module issue queue, but I have had to patch the forward.module file, so I guess it's right. I will link the User Referral issue to here #1347626: Referral Forward doesn't work, redirected to homepage - once I have an issue number for this thread!
The problem identified was that when the "User Referral Forward" module was turned on, certainly in a couple of cases, it broke the process, and the forward module simply bummed out and didn't e-mail, or redirect correctly. I have hunted this down to the following reason:
In forward_form_submit, it examines the URL to be e-mailed out, and tries to load a node based on the first two URL args (normally "node" and the id). When the referral module is hooking this up with a referral code, it pushes the "node/%nid" to args(2) and (3). Therefore the forum_submit doesn't realise it is still actually sending a node and it errors in the alternative 'else' block.
If you simply swap the generated url components around, ie:
from /referral/bf34ij/node/234
to /node/234/referral/bf34ij
Then the forward module functions correctly again. However unfortunately the referral module then doesn't identify it's part of the URL and the connection there is broken!
SO, I submit a patch to the forward module (which was the easiest and most robust way to handle this) that tells the form_submit hook to examine both the first and second element pairs of the URL for the node ID to load and send. This certainly works in my case, and has been tested by my office. Obviously, I welcome community input, especially in cases where the referral module is not in use..!
I'll stop typing there, as this post is now longer than the patch. Classic.
Cheers.
| Comment | File | Size | Author |
|---|---|---|---|
| forward-referralintegration.patch | 967 bytes | srlawr |
Comments
Comment #1
socialnicheguru commentedapplying patch and will report back once I test with user referral
Comment #2
john.oltman commentedComment #3
john.oltman commented