diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-04 07:26:25 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-04 07:26:25 +0000 |
commit | 28d47535988600fd8516424b38a4bbb9a0316ad6 (patch) | |
tree | d10b555e08f12bfcc410898c4992b55faa7aec45 /modules/update/tests | |
parent | ad19ce7a0b8bf580098a74ce32693f3e117bd6b3 (diff) | |
download | brdo-28d47535988600fd8516424b38a4bbb9a0316ad6.tar.gz brdo-28d47535988600fd8516424b38a4bbb9a0316ad6.tar.bz2 |
#929756 by dww: Fixed Update manager UI uses stale project data.
Diffstat (limited to 'modules/update/tests')
-rw-r--r-- | modules/update/tests/update_test.module | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/update/tests/update_test.module b/modules/update/tests/update_test.module index 252edb361..34608363a 100644 --- a/modules/update/tests/update_test.module +++ b/modules/update/tests/update_test.module @@ -40,6 +40,32 @@ function update_test_system_info_alter(&$info, $file) { } /** + * Implements hook_update_status_alter(). + * + * This checks the 'update_test_update_status' variable and sees if we need to + * alter the update status for the given project based on the setting. The + * setting is expected to be a nested associative array. If the key '#all' is + * defined, its subarray will include .info keys and values for all modules + * and themes on the system. Otherwise, the settings array is keyed by the + * module or theme short name and the subarrays contain settings just for that + * module or theme. + */ +function update_test_update_status_alter(&$projects) { + $setting = variable_get('update_test_update_status', array()); + if (!empty($setting)) { + foreach ($projects as $project_name => &$project) { + foreach (array('#all', $project_name) as $id) { + if (!empty($setting[$id])) { + foreach ($setting[$id] as $key => $value) { + $project[$key] = $value; + } + } + } + } + } +} + +/** * Page callback, prints mock XML for the update module. * * The specific XML file to print depends on two things: the project we're |