Closed (fixed)
Project:
Google AdSense integration
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Feb 2018 at 18:40 UTC
Updated:
20 Oct 2018 at 10:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tepelena commentedComment #3
tepelena commentedThe problem was that the block was not restricted to specific content type.
Comment #4
tepelena commentedComment #5
ZapevalovAnton commentedWhat? Restricted to specific content type?
Comment #6
tamerzg commentedThis issue is still active and reproduce when you check Page Level Ads checkbox and leave default settings (Page level visibility -> )
Then visit the frontpage and you will see <> printed at the top of the page.
Comment #7
tamerzg commentedAnd here is the patch.
Issue is in adsense_page_attachments() where in case of pages which don't include Page Level Ads, an HTML comment is being printed using html_head attachments. However '#tag' property is empty which is wrong. If you look at the documentation (https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...) you can see that #tag requires one of 3 values: - meta, link, script. Having empty #tag value causes Drupal to print <>, which is also a bug.
Its probably not envisioned for use case of printing only HTML comment. Patch changes #tag type to meta, which will print the comment but without having <>. However it will print empty in the header. Maybe instead it would be better to disable the comments?
Comment #8
jcnventuraThanks for the patch. I've decided to use 'inline_template' and get rid of the adsense_comment template.
Comment #10
jcnventura