Disabled tags still render when using the Pane CTools content type

Created on 30 July 2018, almost 7 years ago
Updated 20 July 2025, 8 days ago

We have a bunch of tags rendering around the page on a site. 2 of these tags are embedded on the page using Display Suite which leverages the CTools content type API to render the tag as a "dfp_pane".

We have some other custom code which uses hook_dfp_tag_alter to disable all DFP slots on a page if a condition it met (in our case, if the body content contains a blacklisted keyword (to avoid Adsense violations)).

In this code, we do `$tag->disabled=TRUE` and this works for all blocks on the page.

However, the dfp_pane render callback does not respect this.

Our solution was to change the dfp_tag() function from:

  if (!$tag) {
    watchdog('dfp', 'Unknown ad tag %machinename passed to dfp_tag().', array('%machinename' => $machinename), WATCHDOG_WARNING);
  }
  else {

into

  if (!$tag) {
    watchdog('dfp', 'Unknown ad tag %machinename passed to dfp_tag().', array('%machinename' => $machinename), WATCHDOG_WARNING);
  }
  else if (!$tag->disabled) {
🐛 Bug report
Status

Closed: outdated

Version

1.5

Component

Code

Created by

🇬🇧United Kingdom nicholasthompson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024