Hi,

after upgrade from module version 6.x-2.7 to 6.x-3.0 injected content not display.

PHP error notification by every page view in drupal logs:

Invalid argument supplied for foreach() in /htdocs/drupal/sites/all/modules/adsense_injector/adsense_injector.admin.inc on line 57.

Textbox "Node body ad insertion template" not display - see the attachment.

What runs here wrong?

Many thanks and greetings
Frank

Comments

dalu’s picture

same in
/sites/all/modules/adsense_injector/adsense_injector.module on line 352.

mcurry’s picture

Status: Active » Postponed (maintainer needs more info)

I'm investigating. In the meantime, I've made the 6.x-2.7 release the recommended version.

What PHP version are you using?

What happens if you click "Reset to defaults" button in the AdSense/Content Injector settings page? Does that make any difference?

mcurry’s picture

I think I see the problem - it's due to a conflicting variable name in the variables table between version 6.x-2.x and 6.x-3.x.

Resetting the settings to the default values (click the Reset to defaults button) should correct the problem.

I'll add code to deal with the problem and issue a new release for 6.x.3.x soon. But in the meantime, please let me know if the Reset to defaults button fixes the problem.

An alternative is to delete the variable named adsense_injector_body_view. You can use drush, Admin menu, or execute the following PHP snippet.

  variable_del('adsense_injector_body_view');

This problem is partially due to the fact that the module has never had an uninstall handler, so variables are not deleted on module uninstall. I'll create an issue/task to remind me to add one, but that won't fix the 6.x-2.x to 6.x-3.x upgrade path for the foreseeable future.

mcurry’s picture

Title: Not work after upgrade to 6.x-3.0 » Cannot configure node body insertion template settings after upgrade to 6.x-3.0
Status: Postponed (maintainer needs more info) » Active

Updating title to better reflect symptoms.

I've added detailed instructions on how to upgrade in the handbook. I've also updated the 6.x-3.0 release notes to discuss the problem and workarounds.

frank.dev’s picture

Many thanks for your support, mcurry (and sorry for my bad "english"). The workaround works fine for me. :)

Frank

mcurry’s picture

Status: Active » Needs work

You're welcome. Your english worked well enough for me :D

I apologize for not catching this during development. Thanks for your patience.

markconroy’s picture

Hitting 'Reset to Defaults" did the trick for me as well, though now the ad seems to be placed lower than it used to be.

I have change the xpath to /[p1] which moved it up a bit, but i'd like to have it at the top again. Is this possible.

Thanks for your work on this module, very helpful.

mcurry’s picture

StatusFileSize
new23.26 KB

@Mark C:
Yes! Simply paste your old template text, sans the %body tag, into the Top ad insertion text configuration field (be sure to remove it from the Inline ad insertion text configuration field -- put nothing there if you don't want to insert inline using XPath.)

markconroy’s picture

Ooops! I don't have it anymore, since I hit "Reset to Defaults". Ah well, easy come, easy go. (It was whatever was the default stuff - what would that have been?)

mcurry’s picture

Status: Needs work » Closed (won't fix)
mcurry’s picture

Status: Closed (won't fix) » Needs work
mcurry’s picture

Status: Needs work » Fixed

I've committed a version with a hook_uninstall handler that deletes all the old variables. So, when using the 6.x-3.x or 6.x-3.1 (or later) builds, you can uninstall adsense_injector module and the old configuration settings will be erased. Re-install the module and you should be able to access the settings as expected.

Status: Fixed » Closed (fixed)

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