There are a dozen places cache_clear_all is called with arguments from drush. Encountered this while running drush updb in D8.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
FileSize
896 bytes
tim.plunkett’s picture

Title: Exception: cache_clear_all() no longer takes arguments, use cache() instead. » module_list() and cache_clear_all() have changed
jonhattan’s picture

Title: module_list() and cache_clear_all() have changed » module_list() and cache_clear_all() have changed in drupal 8

Looking at cache() implementation I see

  // Temporary backwards compatibiltiy layer, allow old style prefixed cache
  // bin names to be passed as arguments.
  $bin = str_replace('cache_', '', $bin);

Should we call cache('update') instead of cache('cache_update') in this patch?

tim.plunkett’s picture

FileSize
890 bytes

Yep.

jonhattan’s picture

Component: Miscellaneous » Base system (internal API)
Status: Needs review » Needs work

On a second look at drush, we need to replace calls to cache_clear_all() in more places.

Two options are: define cache_clear_all again for drupal 8 in commands/core/drupal/environment.inc or use a wrapper function for all versions. For example drupal_cache_clear_all() although there exist several X_cache_clear_all already in drush... doc on them should be improved also.

tim.plunkett’s picture

FileSize
894 bytes

I'm not really confident with doing #5 myself, but this is an update to #4 since core has changed some.

hansfn’s picture

Version: » 8.x-6.x-dev

OK, I also stumbled upon this problem when running "drush updatedb" in a D8 installation.

1) Shouldn't this have higher priority? Breaking the updatedb is rather critical ...
2) Looking at the patch, I'm wondering if it breaks on D7? Shouldn't the same version of Drush work on both D8 and D7?
3) Regarding the options in comment #5. I think "define cache_clear_all again for drupal 8 in commands/core/drupal/environment.inc" is the least messy, but I don't know the Drush code that well.

PS! I was forced to set a version - I hope I selected the right one.

tim.plunkett’s picture

1) D8 doesn't have an upgrade path, so you shouldn't be using updb anyway, until the alphas (or betas?) come out
2) Drush has versioned files. update.inc, update_6.inc, and update_7.inc
3) Yes, that's why this is "needs work"

The version number is correct, drush changed them around since I last commented.

greg.1.anderson’s picture

Status: Needs work » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.

greg.1.anderson’s picture

Issue summary: View changes

Clarified version

digitaldonkey’s picture

Issue summary: View changes

Info: You can use drupal_flush_all_caches(); in D8.