When attempting to clear cache:

Error: Class CToolsCssCache contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (DrupalCacheInterface::__construct)

The cache handler doesn't appear to need to do any particular initialization, but since this class implements Drupal's abstract, the __construct() method must be present.

CommentFileSizeAuthor
ctools-cache-handler.patch553 bytesbradjones1

Comments

bradjones1’s picture

Status: Needs review » Closed (won't fix)

I stand corrected - this is only an error in Drupal core < 2013-08-05:

http://cgit.drupalcode.org/drupal/commit/includes/cache.inc?h=7.x&id=f58...

fuzzbuzz’s picture

I am having this same issue. How do I fix it?

joelpittet’s picture

Upgrade Drupal @see https://www.drupal.org/upgrade

fuzzbuzz’s picture

I figured a minor upgrade would be the solution. Oh boi.

By the way, I am running running Drupal 7.20. The panels updated properly, but not Ctools. I had to roll back the panel update and Ctools update to remove the errors. I will settle for not doing the minor core and module updates right now.

colony’s picture

I have this error, updated D7 core and all modules. Also tried above patch, no dice. Help?
A google search has a bunch of these errors indexed.....

colony’s picture

Status: Closed (won't fix) » Active

Maybe not fixed, or maybe new issue.

joelpittet’s picture

Likely a new issue. Can you confirm the version of ctools and drupal you are on when this error occurs?

Or maybe OPCode is holding on to the file for too long if you have APC/Zend OpCode cache enabled?

colony’s picture

I'm on D7.34 ctools 7.x-1.x-dev
Did clean reinstall of ctools dev version and now it seems to be working, sans patch
Somehow the error message got embedded in one of my blocks, so cleared
Turned off the various caches

joelpittet’s picture

Status: Active » Closed (won't fix)

Thanks @colony, I'm re-closing this.

samwank’s picture

@colony how did you go about having a clean reinstall of ctools ? is there an easier route since i am finding that i have to uninstall alot of modules for me even to uninstall alot modules to even uninstall the ctools

gfury’s picture

Patch seemed to work for me.

The error was occurring when I ran the update script.

Core 7.22
Ctools 7.x-1.6

doakym’s picture

I had the next error:

 PHP Fatal error:  Class 'CToolsCssCache' not found in /var/www/web/includes/cache.inc on line 31

and this patch works for me.

rupesh_jagtap’s picture

Patch worked for me.

I also got the same error -

Error: Class CToolsCssCache contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (DrupalCacheInterface::__construct)

I tried given patch and it worked for me. Thanks @bradjones1

yannickoo’s picture

Thank you for the patch, works fine :)

drall’s picture

Using Core 7.22, upgraded ctools to 7.x-1.7. Update failed, running update.php failed (this error displayed instead of successful update messages), and this error message displayed visibly throughout website.

From advice elsewhere, ran cron: failed. This patch worked: update.php completed, cron run succeeded, error message no longer displays. Thank you for this patch!

Status: Closed (won't fix) » Needs review

Status: Needs review » Needs work

The last submitted patch, ctools-cache-handler.patch, failed testing.

joelpittet’s picture

Status: Needs work » Closed (won't fix)

This keeps re-opening.

There are some nasty security holes in older versions of Drupal Core earlier than 7.32. See https://www.drupal.org/SA-CORE-2014-005

So if you get this error message: UPGRADE YOUR DRUPAL CORE, it will solve both that horrible security issue and this minor ctools issue.

Status: Closed (won't fix) » Needs review
techgirlgeek’s picture

I am on the latest version of CTools and Core, and am just now getting this error.
* Core: 7.35 & 7.36
* Ctools: 7.x-1.7

I have not tried the patch yet, but just wanted to update this thread that this error is still occurring with updated versions of both. However, in my case, I think another module introduced this error. Everything was fine, then we merged in some updates from other modules, and features, and that's when we began to see the errors. I updated menu_block, since the latest update does reference fixing a ctools fatal error, alas, that didn't seem to fix the issue either.

I will update this if I find the root cause of our specific issues.

UPDATE: This was operator error, and if I could delete this post I would. Someone moved all of our contrib modules from sites/all/modules to sites/all/modules/contrib, as they should be, but not all of ctools moved.

Pascal.s’s picture

Patch also works for me.
I'm updating an old site from 7.22 to latest version 7.37

mglaman’s picture

Status: Needs review » Closed (won't fix)

Per #18, marking this back to won't fix.

johnv’s picture

This happened to me because I only updated the existing files after updateing from CTools 7.x-1.4 to 7.x-1.7.
After adding all files to the repository , the cache-flush went OK.

jeromewiley’s picture

UPDATED SEE BELOW

--Upgrading CTools from 1.4 to 1.7 on Drupal 7.22.
--When I clicked on the ctools-cache-handler.patch link above, all I get is redirected to a partial text file (cuts off in midsentence) for
--updating a .css file.
--Where can I download the patch?
--Are there any caveats to upgrading only CTools and not the rest of Drupal?

UPDATE:

I attempted to interpret the Git shorthand, and figured out that you have to add the lines:

function __construct($bin) {
}

to the css-cache.inc file (in the /includes folder.)
Made this addition (approximately line 10 in the file, after the class declaration and before the comments re {@inheritdoc}.)
Ran update.php again (from the Modules page in the dashboard), and the error message is gone.
Appears to have worked.

Imaaxa-Cory’s picture

I implemented #24 and it allowed me to run the update with no more problems.

Is there plans to include the fix to the module?

mrdemeanour’s picture

I'm running Core 7.39, CTools 7.x-1.9. I am seeing this problem.

- css-cache.inc is NOT missing.
- CToolsCssCache seems to be a correct implementation of DrupalCacheInterface.
- The suggested solution at https://www.drupal.org/node/2425979 doesn't work.
- Clearing caches doesn't work, either using drush cc or using drupal_flush_all_caches().
- Clearing the registry doesn't work.

If someone knows the cause of this, I would love to know; nobody in this thread has offered an explanation (and for that reason, I think that 'won't fix' is an inadequate response).

It may be a minor bug; but it is reported as a Fatal Error in the log, and I need to eliminate this problem as a candidate cause of problems with my sites.

keshav-vaishnav’s picture

Hi I am just trying to work with drupal, working on my localhost, drupal 7.41 and ctools 7.x-1.9 facing the same issue.
I uploaded a video but instead of showing video getting following error
Fatal error: Class CToolsCssCache contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (DrupalCacheInterface::__construct) in C:\wamp\www\arjunagroup1\sites\all\modules\ctools\includes\css-cache.inc on line 52

Call Stack

#
Time
Memory
Function
Location

1
0.0000
247488
{main}( )
..\index.php:0

2
0.2950
16861960
menu_execute_active_handler( )
..\index.php:21

3
0.3100
17392232
drupal_deliver_page( )
..\menu.inc:532

4
0.3100
17393648
drupal_deliver_html_page( )
..\common.inc:2544

5
0.3100
17394352
drupal_page_footer( )
..\common.inc:2660

6
0.3100
17395088
system_run_automated_cron( )
..\common.inc:2687

7
0.3100
17395432
drupal_cron_run( )
..\system.module:3490

8
0.3875
17474472
module_invoke( )
..\common.inc:5220

9
0.3875
17474808
call_user_func_array:{C:\wamp\www\arjunagroup1\includes\module.inc:833} ( )
..\module.inc:833

10
0.3875
17475400
system_cron( )
..\module.inc:833

11
1.7900
18684528
cache_clear_all( )
..\system.module:3028

12
1.7900
18684576
_cache_get_object( )
..\cache.inc:176

13
1.7900
18684864
spl_autoload_call ( )
..\cache.inc:31

14
1.7900
18684896
drupal_autoload_class( )
..\cache.inc:0

15
1.7900
18684976
_registry_check_code( )
..\bootstrap.inc:3012

16
1.7975
18694040
require_once( 'C:\wamp\www\arjunagroup1\sites\all\modules\ctools\includes\css-cache.inc' )
..\bootstrap.inc:3088

I added a new method in my css-cache.inc :-
function __construct($bin) {
}

but stil problem is not resolved

dewancodes’s picture

It fixed for me when I remove the following line from : /public_html/includes/cache.inc

function __construct($bin);

line#239

Thanks for the help

OLANREWAJU TEMITOPE’s picture

Fatal error: Class CToolsCssCache contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (DrupalCacheInterface::__construct) in /home/clinical/public_html/coastwiseoperations/sites/all/modules/ctools/includes/css-cache.inc on line 52

Mike Pac’s picture

Fatal error: Cannot redeclare CToolsCssCache::clear() in D:\Newsman\sites\all\modules\ctools\includes\css-cache.inc on line 53

Mike Pac’s picture

How can I resolve the above problem in Drupal 7

fjgarlin’s picture

I run into the same issue whilst on an old version of core. As mentioned, updating core fixed the error.