I know it's only for D7, but is this worth the effort?

$ drush cc
Enter a number to choose which cache to clear.
  [0] : Cancel
  [1] : all
  [2] : theme
  [3] : menu
  [4] : css+js
  [5] : block
$

Comments

gr33nman’s picture

Version: 7.x-2.0-alpha2 »

It might be useful for 6 too under certain circumstances.

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new1.04 KB

Here is a patch for this

dawehner’s picture

StatusFileSize
new1.17 KB

Oh attached the wrong patch

gr33nman’s picture

Issue tags: +drush, +drush-3.0, +clear block cache

Thank you. This will be my first patch test, so please bear with me...

Of course, drush is outside drupal core, for me at /home/username/usr/drush_3.0.
I assume I need to do this:

$ cd ~/usr/drush_3.0/commands/core
wget http ://drupal.org/files/issues/drush-block_clear.patch
patch -p0 drush-block_clear.patch

Then test drush, specifically:

$ drush cc
Enter a number to choose which cache to clear.
...  
[5] : block
$ 5 

This is of course after backing up my files and data...

Is that correct?

gr33nman’s picture

Component: Code » PM (dl, en, up ...)
Status: Needs review » Reviewed & tested by the community

I figured the patch process out. Here's how to do it for others:
When you look at the file, you can see the index is here:
Index: commands/core/clear.cache.inc
So,

cd ~/home/user/usr/drush_3.0
wget http://drupal.org/files/issues/drush-block_clear.patch
$ ls
LICENSE.txt  README.txt  commands  drush  drush-block_clear.patch  drush.api.php  drush.bat  drush.info  drush.php  drush_logo-black.png  examples  includes
$ patch -p0 < drush-block_clear.patch
patching file commands/core/clear.cache.inc

cd ~/mysite.com/sites/all/default
drush cc
Enter a number to choose which cache to clear.
  [0] : Cancel
  [1] : all
  [2] : theme
  [3] : menu
  [4] : css+js
  [5] : block
  [6] : nodeaccess
5
'block' cache was cleared                           [success]

Works for me. I am not sure how to confirm whether the block cache was actually cleared though. I can only report that the interface for this patch appears to be working correctly.

If someone else could confirm or also test, that would be great. Cheers, dereine for this patch!

moshe weitzman’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Also added a hook where anyone can add/more candidates.

Status: Fixed » Closed (fixed)
Issue tags: -drush, -drush-3.0, -clear block cache

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