Hi, everyone.

I want to track referrals, there is affiliate which can help me, but there are some problems.

My test environment XAMPP on localhost.

I show a url http://localhost/drupal/dp68/?a=3&k=jason in my blog, The user jason uid=3 and making Affiliate Enabled.

But nothing was log when click http://localhost/drupal/dp68/?a=3&k=jason, what is the problem about affiliate. there are no log in my database.

Comments

Mamouri’s picture

I have same problem

rj’s picture

Same problem, subscribing.

aangel’s picture

Hmmm, I know this is quite a statement, but I don't think this version has actually been tested on Drupal 6.x. Or perhaps the wrong code was uploaded.

The reason I say that is because the call to affiliate_record() is still in hook_menu() when for Drupal 6 it needs to be in hook_init().

hook_menu() in Drupal 6 is called now only when the menu is being rebuilt. Thus, during normal operation, the code to record the incoming affiliate uid is never called.

I removed affiliate_record(); from affiliate_menu(), then moved it to a new function:

/**
 *  Implementation of hook_init().
 */
function affiliate_init() {
      affiliate_record();
}

Now it is being called, but other things aren't working. Still investigating...

Lem-2’s picture

Agreed, 6.x-1.3 just does not work. Arrived independently at the same conclusion as aangel.

I applied the fix, and it appears to work. I am curious what "other things" he found to be broken- my quick testing did not reveal anything, but I was not very rigorous.

lark’s picture

Why its state is recommended?
It isn`t work at all!

sikjoy’s picture

aangel is correct. The hook_init() is the proper place to call affiliate_record().

Drupal 6 only calls hook_menu() on each page load if caching is turned off.

sikjoy’s picture

Perhaps it was tested with caching disabled. That's the only way I can see that it would work in it's current state.

aangel’s picture

Issue summary: View changes
Status: Active » Closed (outdated)