Now:
3. Apply the attached drupal-core-filtercache.patch on your local Drupal
copy. Even if it got outdated and it does not apply anymore, it is
quite straightforward. What it modifies in Drupal core is:

- clears filter cache in case filter settings or filter ordering
changed (if filtercache module is available)
- only define check_output() if filtercache.module is not available

Filtercache.module provides a replacement for check_output() and performs
the caching within this function.
But if your on this problem:
Fatal error: Cannot redeclare check_output() (previously declared in /var/www/html/modules/filter.module:151)
in /var/www/html/modules/filtercache.module on line 34

Do it:
in filter.module in 151 string need comment out this code

<code>
+ /*
function filter_check_output($text) {

  if (isset($text)) {
    // Filter content on output:
    $filters = filter_list();

    // Give filters the chance to escape HTML-like data such as code or formulas
    // (from this point on, the input can be treated as HTML)
    if (variable_get("filter_html", FILTER_HTML_DONOTHING) != FILTER_HTML_ESCAPE) {
      foreach ($filters as $module => $filter) {
        $text = module_invoke($module, "filter", "prepare", $text);
      }
    }

    // HTML handling is done before all regular filtering activities
    $text = filter_default($text);

    // Regular filtering
    foreach ($filters as $module => $filter) {
      $text = module_invoke($module, "filter", "process", $text);
    }

    /*
    ** If only inline elements are used and no block level elements, we
    ** replace all newlines with HTML line breaks.
    */


After you can turn on filtercache.module in /admin/modules pages
If all quit, remove your comment /*

Comments

dmjossel’s picture

Project: »
Component: »
Assigned: » Unassigned
Category: » support
Priority: » Normal
Status: » 0

The patch to only define check_output in filter.module if filtercache.module doesn't exist doesn't seem to work, since it requires the filtercache module to be present, detected, and enabled. This cannot be done while both modules are present, since the functions conflict. It cannot be done without filter.module since filtercache.module calls functions in it. Commenting out the filter_check_output function also doesn't work, as filtercache.module calls it.

In short, there doesn't appear to be any workable installation procedure for this module; either the two definitions collide, or one module is calling anonexistent function.

axel’s picture

Category: support » bug

And ever if filtercache already work, this error appears sometimes on site. I never see it (under Mozilla), but user of IE reported about it to me today.

By my opinion next construction don't work by some reason:

(from filter.module after drupal-core-filtercache.patch)

if (!module_exist('filtercache')) { 
  function check_output($text) { 
    return filter_check_output($text); 
} 

I don't know all rules for conditional function declaration in PHP, but seems
that function check_output declared here anyway and ignores 'if' condition.
For info: I test it on PHP 4.3.3 on my localsystem.

Then I change this fragment of code to that:

function check_output($text) { 
  if (!module_exist('filtercache')) { 
    return filter_check_output($text); 
  } else { 
    return filtercache_check_output($text); 
  } 
} 

And in filtercache.module rename check_output to filtercache_check_output. Now filtercache may be turned on and off safely.

gábor hojtsy’s picture

I have just fixed this problem in CVS (in a different way).

drumm’s picture

Project: » Drupal core
Version: » x.y.z
Component: » filter.module
Issue summary: View changes
Status: 0 » Closed (fixed)

Data cleanup.

drumm’s picture

Issue summary: View changes