Download & Extend

revenue sharing doesn't work if referral is zero

Project:AdSense
Version:4.6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

in _adsense_choose_client() you the following logic causes revenue sharing to not work if the $percent_referral is 0:

if (!$percent_author || !$percent_referral || !$author_client) {
return $site_client;
}

Comments

#1

Priority:normal» critical

This is pretty critical.

#2

Brenda,

This should not affect your site, since you already have the referral percentage set to a non-zero amount.

It only affects those who do not use the User Referral module, but have revenue sharing enabled.

I will investigate this over the weekend.

#3

Priority:critical» normal

Oops, you're right. I tested it briefly and didn't see any ads of the other coming up, but it was just a fluke. :)

#4

Jeremy

Can you try this patch and see if it works on your site?

Thanks.

AttachmentSize
adsense_1.patch 1.23 KB

#5

This one is a bit better. Give it a shot.

AttachmentSize
adsense_2.patch 1.4 KB

#6

I'm using 4.6.

I don't know how to apply patches so I did this code change. It seems to work fine. But I guess referals won't work now ?

//Old Code
//  if (!$percent_author || !$percent_referral || !$author_client) {
//    return $site_client;
//  }

// New Code
  if (!$percent_author || !$author_client) {
    return $site_client;
  }

I got to learn how to apply those patches.

Marcel

#7

Attaching the full module. If it works well for you, then let me know, and I will commit it.

AttachmentSize
adsense.module 27.97 KB

#8

That last patched module works for me.

Thank you ! :)

Marcel

#9

Status:active» closed (fixed)

Committed for 4.6, 4.7 and HEAD.