Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am getting the following error when trying to add AdSense block (using the AdSense module) using the Add content feature for a region.
An error occurred while attempting to process /panels/ajax/add-pane-config/panel_context%3Anode_view%3Anode_view_panel_context_2/content/block/adsense_managed-0
Other blocks work just fine, but not this one. I have also tested the block in other places and it works as expected.
Comments
Comment #1
tsvenson CreditAttribution: tsvenson commentedUsing the Custom content pane and the PHP filter it is possible to get around this bug.
Simply paste in the relevant code from the AdSense module help instructions and it is working.
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedDoes the adsense module use
<script>
tags in the block?Comment #3
tsvenson CreditAttribution: tsvenson commentedIf your talking about the output, then yes since it is needed for the ads to work.
This is how the source code of the page looks when I place the block in a region outside panels control:
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedIt probably breaks when the block is rendered via AJAX in the admin UI. If you look at blocks (and only blocks) they are actually rendered beneath the collapsible arrow. That script tag probably confuses the client when it tries to render and causes a crash. So for now, your best workaround is to go ahead and use a custom pane which won't render that way.
Comment #5
tsvenson CreditAttribution: tsvenson commentedThanks for the explanation. Since I get the same result using the custom pane its not a big issue anymore.
Is this something that will happen with every block that uses the <script> tag? Just wondering since I plan to use a few modules that I believe will use it as well.
Comment #6
merlinofchaos CreditAttribution: merlinofchaos commentedLikely yes. I need to fix that and defang the script tags.
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted a fix to CTools to prevent this.
Comment #8
tsvenson CreditAttribution: tsvenson commentedHi merlin,
I just updated to the ctools 1.3 & panels 3,3 you released today and I still get the same error trying to add the AdSense block.
Comment #9
tsvenson CreditAttribution: tsvenson commentedForgot to change it back to active.
Comment #10
merlinofchaos CreditAttribution: merlinofchaos commentedHm. I don't see how this can be happening. I'm filtering the block output and that should remove all script and object tags.
Comment #11
merlinofchaos CreditAttribution: merlinofchaos commentedTry current -dev. It should work now.
Comment #13
Mechanical Engineer CreditAttribution: Mechanical Engineer commentedyeah thank you it's now fixed :)
Comment #15
a.ross CreditAttribution: a.ross commentedStill not working in 1.8 nor latest -dev.
Comment #16
mropanen CreditAttribution: mropanen commentedAlso not working in 7.x-1.0