I have just upgraded to 5.x-2.7 today and found an odd quirk which i think is in adsense injector (however I'm not ruling out other modules misbehaving since I upgraded many). Though I'd report the oddity in case others are seeing the same.

When I enable adsense-injector, at all - no matter what, if I use div's to enclose the ads are no ads at all - content on the front page (and in views) has the teaser list repeated twice. In the case of full posts showing on the front page, the post is posted twice.

I am also using the "readmore" tweak, however disabling this makes no difference, and I use "!--break--" to ensure that some posts go in full view on the front page. (So each post has that somewhere).

I checked that everything is ok under "input formats" and adsense tag is checked there.

Visually when you look at the front page, content is repeated - but when you read source it is not.

  
  
  <div class="content">
    <!-- google_ad_section_start -->

This is where my post goes. Text looks fine here. Only once. All tags are closed. 
End of post

<br><!--adsense: cached-->
<div class="adsense">
<script type="text/javascript"><!--type and style of advert that shows up OK
//--></script>
<script type="text/javascript"
 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- google_ad_section_end -->  </div>

Since I am not using Image attach, I don't want to use the dev-only (so far) Module Weight on my site, and am not using that, but I don't think this has anything to do with image styling for example. My skin (zen actually) is up to date but I'll have a look there as well.

Comments

Dabitch’s picture

Correction: I misread source - the text is repeated twice even when you read source but I see no reason as to why this should be.

Running with "readmore" tweak module turned off and another skin enterily produces the same results. Only when I turn off adsense_injector does it stop repeating on the front page (and some views). I can reove the "node body insertion" setting and I'll still have posted content repeating on the front page despite the fact that I am not showing any ads there.

Dabitch’s picture

Component: Miscellaneous » Code
Status: Needs review » Active

---- hmmm, I seem to have managed to set this under "patch" when I have not submitted one at all, fixing status with this post. (sorry)

tenouk’s picture

i got the same problem after apply the new adsense injector module
all blog and page on the frontpage show twice...
the problem seem come from adsense injector module... if i'm disable the module... everyting look normal....
http://nossdutytask.com/

Rhino’s picture

I have the same issue with adsense injector 5.x-2.7 using any theme. So it is the module, not the theming.

I'm not using the read more module.

The previous adsense injector module worked fine, how do I downgrade back to that? Just pop the old module back in the modules folder?

Dabitch’s picture

Just replace the newr version with the older one and run update.php

While sorting out other module upgrades, I dropped AdSense Injector 5.x-2.6 (2008-12-16) adsense_injector.module into my modules location, deleting the new version, and ran update.php

Adsense injector now works just like it should again.

nascimbeni’s picture

Same problem here - News articles and page on the frontpage show twice with Adsense 3.0 ( non beta )

I tried to go back to Adsense Injector 2.6 but no ad was showing - Treidn again with 2.7 ....At the end I deactivated Adsense injector after a couple of hour fighting with it ...

PS How do I run update.php ??

Paolo

Rhino’s picture

http://yousite.com/update.php should run update.php for you

I de-installed the module before installing an older version, then I ran update.php and it worked.

Any clues as to why this double-posting bug is happening?

Amon_Re’s picture

I've been hit by the same bug, the mentioned work arround doesn't seem to work, it happened with both 5.x-2.7 as the latest dev version.
Tried disabling it, downgrading to 2.5, run update.php & update again, and it still would show twice.

Anyone have some further idea's?

cantidubi’s picture

He comprobado que quitando el %teaser funciona correctamente, lo he dejado así:

I have found that removing the %teaser working properly, so I have left:

<br class="clear"/>[adsense:468x60:0123456789]

hswong3i’s picture

Assigned: Unassigned » hswong3i

Please try with following procedure during upgrade/reinstall:

  1. Disable adsense_injector from admin/build/module
  2. Run uninstall and remove all adsense_injector related table from DB.
  3. Completely remove the adsense_injector directory from site/all/modules
  4. Download and install with latest version.
  5. Enable and configure it.

Please let me know if this still can't help.

Dabitch’s picture

I have upgraded my way past this issue, am on Drupal 6 now. But thanks for the suggestions.

suarkuyak’s picture

Thanks cantidubi at #9. Your suggestion works for me.

mcurry’s picture

Version: 5.x-2.7 » 6.x-2.x-dev
Assigned: hswong3i » Unassigned
Status: Active » Postponed (maintainer needs more info)

Moving to 6.x dev, since 5.x is no longer supported.

mcurry’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I'm going to close this since it's been inactive for so long. If it's still a problem, please re-open and provide a URL where I can see the problem demonstrated.

mcurry’s picture

Assigned: Unassigned » mcurry
Status: Closed (cannot reproduce) » Active

I was able to reproduce this problem on an old Drupal 5 site, so it's a valid problem.

I was able to fix the problem by changing this line:


$node->content['teaser']['#value'] = strtr($template, array('%teaser' => $node->teaser));

to this:


      $node->content['body']['#value'] = strtr($template, array('%teaser' => $node->content['body']['#value']));

in adsense_injector.module, function adsense_injector_nodeapi(...)

I'll investigate in the D6 branch and back-port any patches to the 5.x branch.

mcurry’s picture

Version: 6.x-2.x-dev » 5.x-2.x-dev

Moving back to 5.x-2.x-dev branch for patch submission.

mcurry’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new776 bytes

Here's a patch for 5.x-2.x-dev based on comment # 15 above.

I'm going to commit it immediately so there will be no community review.

mcurry’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Committed to 5.x-2.x-dev. Drupal 5.x users please use the latest -dev build dated after this comment.

Marking as to be ported so I can fix it in 6.x and 7.x as needed.

mcurry’s picture

Status: Patch (to be ported) » Fixed

Looks like the patch doesn't need to be ported to 6.x and 7.

mcurry’s picture

Title: Front page (and view) nodes are shown twice when adsense injector is on after upgrading. » Front page (and view) body/teasers are shown twice.
mcurry’s picture

Even though the 5.x branch is no longer officially supported, here's an official release build 5.x-2.8 containing the fix.

If this doesn't work, reopen this issue but keep in mind that I won't do much (if anything) on the 5.x branch from here on out. I will accept community patch submissions and apply them to the source tree for testing, though.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.