When I enable this filter for "Filtered HTML" or "Full HTML", and have it either at -10 or +10 position, all the page content disappears (the title is still shown). It does not matter if the page contains a soundcloud tag, or not.

I'm using drupal 6.17 and all modules are up to date w.r.t. security upgrades.

Let me know if I can provide any further information (I know this is a rather minimal bug report).

Comments

PaulJacobson’s picture

Priority: Normal » Major

I'm seeing a similar issue. Creating an input format with Soundcloud filter enabled causes a node using this input format to only display the title information, and the linked soundcloud file. Any text content is removed from the output.

PaulJacobson’s picture

I've had a quick look at the issue and it seems the filter only outputs replacement text for a soundcloud tag. If there is no match you get no output. I've hacked the "replace" sections from the inline module into the process routine and this appears to work under 6.17.

function soundcloud_filter_process($text, $format = -1) {
  if (preg_match_all('/\[soundcloud(\:(.+))?( .+)?\]/isU', $text, $matches)) {
    $output = '';
    $s = $r = array();
    
    foreach ($matches[0] as $c => $code) {
      $sc = array(
                'url' => $matches[2][$c],
                'width' => variable_get('soundcloud_filter_width_'.$format, 100),
                'height' => variable_get('soundcloud_filter_height_'.$format, 81),
                'showcomments' => variable_get('soundcloud_filter_showcomments_'.$format, 'false'),
                'autoplay' => variable_get('soundcloud_filter_autoplay_'.$format, 'false'),
                'color' => variable_get('soundcloud_filter_color_'.$format, '#000000'),
      );

      $encoded_url = urlencode($sc['url']);
      $parsed_url = parse_url($sc['url']);

      if ($matches[3][$c] && preg_match_all('/\s+([a-z]+)\=([^\s]+)/i', $matches[3][$c], $override_params)) {
        foreach ($override_params[0] as $p => $par) {
          $sc[$override_params[1][$p]] = $override_params[2][$p];
        }
      }

      $params = 'url='.$encoded_url.'&show_comments='.$sc['showcomments'].'&auto_play='.$sc['autoplay'].'&color='.str_replace('#', '', $sc['color']) ;
      $output = theme('soundcloud_filter_embed', $params, $sc['height'], $sc['width'], $parsed_url['host']);
    }
    $s[] = $matches[0][$c];
    $r[] = $output;
  }
  return str_replace($s, $r, $text);
}
hemmer’s picture

The above fix works for me on 6.19. Thanks

attila.fekete’s picture

Status: Active » Fixed

Thanks for the report! The fix by PaulJacobson works fine.

Commited.

Status: Fixed » Closed (fixed)

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