function _update_authorize_clear_update_status

Same name in other branches
  1. 9 core/modules/update/update.authorize.inc \_update_authorize_clear_update_status()
  2. 8.9.x core/modules/update/update.authorize.inc \_update_authorize_clear_update_status()
  3. 10 core/modules/update/update.authorize.inc \_update_authorize_clear_update_status()
  4. 11.x core/modules/update/update.authorize.inc \_update_authorize_clear_update_status()

Clears cached available update status data.

Since this function is run at such a low bootstrap level, the Update Manager module is not loaded. So, we can't just call _update_cache_clear(). However, the database is bootstrapped, so we can do a query ourselves to clear out what we want to clear.

Note that we do not want to just truncate the table, since that would remove items related to currently pending fetch attempts.

See also

update_authorize_update_batch_finished()

_update_cache_clear()

1 call to _update_authorize_clear_update_status()
update_authorize_update_batch_finished in modules/update/update.authorize.inc
Implements callback_batch_finished().

File

modules/update/update.authorize.inc, line 331

Code

function _update_authorize_clear_update_status() {
    $query = db_delete('cache_update');
    $query->condition(db_or()->condition('cid', 'update_project_%', 'LIKE')
        ->condition('cid', 'available_releases::%', 'LIKE'));
    $query->execute();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.