Closed (fixed)
Project:
Google AdSense integration
Version:
8.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Apr 2016 at 08:30 UTC
Updated:
19 May 2017 at 07:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
malcomio commentedComment #4
jcnventuraThanks!
Comment #6
pjeutr commentedSeems the #format index also needs to be checked.
I got
Notice: Undefined index: #format in Drupal\adsense\AdsenseAdBase->display() (line 88 of modules/adsense/src/AdsenseAdBase.php).Adding the next line, solves it (Same solution as previous patch)
'#format' => isset($content['#format']) ? $content['#format'] : NULL,Comment #7
jcnventuraHow can you not have a format defined? What kind of ad is that?
Comment #8
pjeutr commentedIn the block settings I chose:
Ad format -> Responsive ad unit
Responsive ad shape -> Auto sizing
Ad alignment -> Centered
I was using an autosize ad, this is the code google suggests
Comment #9
pjeutr commentedI just used the same ad block within another site in the same codebase (multisite) without any problems.
The site where the problem occurs is a migrated site form D6 to D8. So I suppose the problem is caused by something else.
I will try to look in it later, just ignore me for now ;)