diff --git a/core/includes/actions.inc b/core/includes/actions.inc index 760de83..c236a1e 100644 --- a/core/includes/actions.inc +++ b/core/includes/actions.inc @@ -160,7 +160,7 @@ function actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a function actions_list($reset = FALSE) { $actions = &drupal_static(__FUNCTION__); if (!isset($actions) || $reset) { - $actions = module_invoke_all('action_info'); + $actions = module_signal_all('action_info'); drupal_alter('action_info', $actions); } @@ -378,6 +378,6 @@ function actions_delete($aid) { db_delete('actions') ->condition('aid', $aid) ->execute(); - module_invoke_all('actions_delete', $aid); + module_invoke1_all('actions_delete', $aid); } diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc index cda55b4..edc875b 100644 --- a/core/includes/ajax.inc +++ b/core/includes/ajax.inc @@ -559,7 +559,7 @@ function ajax_footer() { // modules that need very fast Ajax responses, and therefore, run Ajax // requests with an early bootstrap. if (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update')) { - module_invoke_all('exit'); + module_signal_all('exit'); } // Commit the user session. See above comment about the possibility of this diff --git a/core/includes/common.inc b/core/includes/common.inc index 1bd8b19..8363bd0 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -2530,7 +2530,7 @@ function drupal_deliver_html_page($page_callback_result) { function drupal_page_footer() { global $user; - module_invoke_all('exit'); + module_signal_all('exit'); // Commit the user session, if needed. drupal_session_commit(); @@ -2563,7 +2563,7 @@ function drupal_page_footer() { function drupal_exit($destination = NULL) { if (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL) { if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update') { - module_invoke_all('exit', $destination); + module_invoke1_all('exit', $destination); } drupal_session_commit(); } @@ -5049,7 +5049,7 @@ function _drupal_bootstrap_full() { // ahead of when rendering starts. menu_set_custom_theme(); drupal_theme_initialize(); - module_invoke_all('init'); + module_signal_all('init'); } } @@ -5128,7 +5128,7 @@ function drupal_cron_run() { $return = FALSE; // Grab the defined cron queues. - $queues = module_invoke_all('cron_queue_info'); + $queues = module_signal_all('cron_queue_info'); drupal_alter('cron_queue_info', $queues); // Try to acquire cron lock. @@ -6165,7 +6165,7 @@ function element_info($type) { $cache = &$drupal_static_fast['cache']; if (!isset($cache)) { - $cache = module_invoke_all('element_info'); + $cache = module_signal_all('element_info'); foreach ($cache as $element_type => $info) { $cache[$element_type]['#type'] = $element_type; } @@ -7270,7 +7270,7 @@ function drupal_flush_all_caches() { // Don't clear cache_form - in-progress form submissions may break. // Ordered so clearing the page cache will always be the last action. $core = array('cache', 'path', 'filter', 'bootstrap', 'page'); - $cache_bins = array_merge(module_invoke_all('flush_caches'), $core); + $cache_bins = array_merge(module_signal_all('flush_caches'), $core); foreach ($cache_bins as $bin) { cache($bin)->flush(); } @@ -7443,7 +7443,7 @@ function archiver_get_info() { $cache = cache()->get('archiver_info'); if ($cache === FALSE) { // Rebuild the cache and save it. - $archiver_info = module_invoke_all('archiver_info'); + $archiver_info = module_signal_all('archiver_info'); drupal_alter('archiver_info', $archiver_info); uasort($archiver_info, 'drupal_sort_weight'); cache()->set('archiver_info', $archiver_info); @@ -7526,7 +7526,7 @@ function archiver_get_archiver($file) { function drupal_get_updaters() { $updaters = &drupal_static(__FUNCTION__); if (!isset($updaters)) { - $updaters = module_invoke_all('updater_info'); + $updaters = module_signal_all('updater_info'); drupal_alter('updater_info', $updaters); uasort($updaters, 'drupal_sort_weight'); } diff --git a/core/includes/file.inc b/core/includes/file.inc index 6e6611f..a107c23 100644 --- a/core/includes/file.inc +++ b/core/includes/file.inc @@ -128,7 +128,7 @@ function file_get_stream_wrappers($filter = STREAM_WRAPPERS_ALL) { $wrappers_storage = &drupal_static(__FUNCTION__); if (!isset($wrappers_storage)) { - $wrappers = module_invoke_all('stream_wrappers'); + $wrappers = module_signal_all('stream_wrappers'); foreach ($wrappers as $scheme => $info) { // Add defaults. $wrappers[$scheme] += array('type' => STREAM_WRAPPERS_NORMAL); @@ -577,19 +577,19 @@ function file_save(stdClass $file) { $file->original = entity_load_unchanged('file', $file->fid); } - module_invoke_all('file_presave', $file); + module_invoke1_all('file_presave', $file); module_invoke_all('entity_presave', $file, 'file'); if (empty($file->fid)) { drupal_write_record('file_managed', $file); // Inform modules about the newly added file. - module_invoke_all('file_insert', $file); + module_invoke1_all('file_insert', $file); module_invoke_all('entity_insert', $file, 'file'); } else { drupal_write_record('file_managed', $file, 'fid'); // Inform modules that the file has been updated. - module_invoke_all('file_update', $file); + module_invoke1_all('file_update', $file); module_invoke_all('entity_update', $file, 'file'); } @@ -1247,7 +1247,7 @@ function file_delete(stdClass $file, $force = FALSE) { } // Let other modules clean up any references to the deleted file. - module_invoke_all('file_delete', $file); + module_invoke1_all('file_delete', $file); module_invoke_all('entity_delete', $file, 'file'); // Make sure the file is deleted before removing its row from the @@ -1635,7 +1635,7 @@ function file_validate(stdClass &$file, $validators = array()) { } // Let other modules perform validation on the new file. - return array_merge($errors, module_invoke_all('file_validate', $file)); + return array_merge($errors, module_invoke1_all('file_validate', $file)); } /** diff --git a/core/includes/image.inc b/core/includes/image.inc index 8dc36b9..b1cb717 100644 --- a/core/includes/image.inc +++ b/core/includes/image.inc @@ -41,7 +41,7 @@ */ function image_get_available_toolkits() { // hook_image_toolkits returns an array of toolkit names. - $toolkits = module_invoke_all('image_toolkits'); + $toolkits = module_signal_all('image_toolkits'); $output = array(); foreach ($toolkits as $name => $info) { diff --git a/core/includes/install.inc b/core/includes/install.inc index 514d89c..2d2ac8b 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -793,7 +793,7 @@ function drupal_uninstall_modules($module_list = array(), $uninstall_dependents if (!empty($module_list)) { // Call hook_module_uninstall to let other modules act - module_invoke_all('modules_uninstalled', $module_list); + module_invoke1_all('modules_uninstalled', $module_list); } return TRUE; diff --git a/core/includes/language.inc b/core/includes/language.inc index 685a4d4..52684c1 100644 --- a/core/includes/language.inc +++ b/core/includes/language.inc @@ -21,7 +21,7 @@ function language_types_info() { $language_types = &drupal_static(__FUNCTION__); if (!isset($language_types)) { - $language_types = module_invoke_all('language_types_info'); + $language_types = module_signal_all('language_types_info'); // Let other modules alter the list of language types. drupal_alter('language_types_info', $language_types); } @@ -293,7 +293,7 @@ function language_negotiation_info() { if (!isset($language_providers)) { // Collect all the module-defined language negotiation providers. - $language_providers = module_invoke_all('language_negotiation_info'); + $language_providers = module_signal_all('language_negotiation_info'); // Add the default language provider. $language_providers[LANGUAGE_NEGOTIATION_DEFAULT] = array( diff --git a/core/includes/locale.inc b/core/includes/locale.inc index e9cd427..23cf5d7 100644 --- a/core/includes/locale.inc +++ b/core/includes/locale.inc @@ -527,17 +527,17 @@ function locale_language_save($language) { $language->enabled = TRUE; } // Let other modules modify $language before saved. - module_invoke_all('locale_language_presave', $language); + module_invoke1_all('locale_language_presave', $language); // Save the record and inform others about the change. if ($language->is_new) { drupal_write_record('languages', $language); - module_invoke_all('locale_language_insert', $language); + module_invoke1_all('locale_language_insert', $language); watchdog('locale', 'The %language (%langcode) language has been created.', array('%language' => $language->name, '%langcode' => $language->language)); } else { drupal_write_record('languages', $language, array('language')); - module_invoke_all('locale_language_update', $language); + module_invoke1_all('locale_language_update', $language); watchdog('locale', 'The %language (%langcode) language has been updated.', array('%language' => $language->name, '%langcode' => $language->language)); } diff --git a/core/includes/menu.inc b/core/includes/menu.inc index f23eb0d..d091d2f 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -1720,7 +1720,7 @@ function menu_get_custom_theme($initialize = FALSE) { // First allow modules to dynamically set a custom theme for the current // page. Since we can only have one, the last module to return a valid // theme takes precedence. - $custom_themes = array_filter(module_invoke_all('custom_theme'), 'drupal_theme_access'); + $custom_themes = array_filter(module_signal_all('custom_theme'), 'drupal_theme_access'); if (!empty($custom_themes)) { $custom_theme = array_pop($custom_themes); } @@ -2937,7 +2937,7 @@ function _menu_delete_item($item, $force = FALSE) { } // Notify modules we are deleting the item. - module_invoke_all('menu_link_delete', $item); + module_invoke1_all('menu_link_delete', $item); db_delete('menu_links')->condition('mlid', $item['mlid'])->execute(); diff --git a/core/includes/module.inc b/core/includes/module.inc index cca2ef9..b4d3ccf 100644 --- a/core/includes/module.inc +++ b/core/includes/module.inc @@ -426,7 +426,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) { drupal_get_schema(NULL, TRUE); // Allow modules to react prior to the installation of a module. - module_invoke_all('modules_preinstall', array($module)); + module_invoke1_all('modules_preinstall', array($module)); // Now install the module if necessary. if (drupal_get_installed_schema_version($module, TRUE) == SCHEMA_UNINSTALLED) { @@ -452,7 +452,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) { } // Allow modules to react prior to the enabling of a module. - module_invoke_all('modules_preenable', array($module)); + module_invoke1_all('modules_preenable', array($module)); // Enable the module. module_invoke($module, 'enable'); @@ -465,12 +465,12 @@ function module_enable($module_list, $enable_dependencies = TRUE) { // If any modules were newly installed, invoke hook_modules_installed(). if (!empty($modules_installed)) { - module_invoke_all('modules_installed', $modules_installed); + module_invoke1_all('modules_installed', $modules_installed); } // If any modules were newly enabled, invoke hook_modules_enabled(). if (!empty($modules_enabled)) { - module_invoke_all('modules_enabled', $modules_enabled); + module_invoke1_all('modules_enabled', $modules_enabled); } return TRUE; @@ -544,7 +544,7 @@ function module_disable($module_list, $disable_dependents = TRUE) { module_implements_reset(); // Invoke hook_modules_disabled before disabling modules, // so we can still call module hooks to get information. - module_invoke_all('modules_disabled', $invoke_modules); + module_invoke1_all('modules_disabled', $invoke_modules); // Update the registry to remove the newly-disabled module. registry_update(); _system_update_bootstrap_status(); @@ -830,6 +830,47 @@ function module_invoke_all($hook) { } /** + * Invoke a hook (without paremeters) in all enabled modules + * + * @param string $signal + * @return array return values + */ +function module_signal_all($signal) { + $return = array(); + foreach (module_implements($signal) as $module) { + $function = $module . '_' . $signal; + $result = $function(); + if (isset($result) && is_array($result)) { + $return = array_merge_recursive($return, $result); + } + elseif (isset($result)) { + $return[] = $result; + } + } + return $return; +} + +function module_invoke1_all($hook, $argument) { + $return = array(); + foreach (module_implements($hook) as $module) { + $function = $module . '_' . $hook; + $result = $function($argument); + if (isset($result) && is_array($result)) { + $return = array_merge_recursive($return, $result); + } + elseif (isset($result)) { + $return[] = $result; + } + } + return $return; +} + +/** + * Invoke a hook (without paremeters) in all enabled modules + * +} + +/** * @} End of "defgroup hooks". */ diff --git a/core/includes/path.inc b/core/includes/path.inc index 630b34c..4f79090 100644 --- a/core/includes/path.inc +++ b/core/includes/path.inc @@ -439,10 +439,10 @@ function path_save(&$path) { // Verify that a record was written. if ($status) { if ($status === SAVED_NEW) { - module_invoke_all('path_insert', $path); + module_invoke1_all('path_insert', $path); } else { - module_invoke_all('path_update', $path); + module_invoke1_all('path_update', $path); } drupal_clear_path_cache($path['source']); } @@ -464,7 +464,7 @@ function path_delete($criteria) { $query->condition($field, $value); } $query->execute(); - module_invoke_all('path_delete', $path); + module_invoke1_all('path_delete', $path); drupal_clear_path_cache($path['source']); } @@ -511,7 +511,7 @@ function path_is_admin($path) { function path_get_admin_paths() { $patterns = &drupal_static(__FUNCTION__); if (!isset($patterns)) { - $paths = module_invoke_all('admin_paths'); + $paths = module_signal_all('admin_paths'); drupal_alter('admin_paths', $paths); // Combine all admin paths into one array, and likewise for non-admin paths, // for easier handling. diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 68dd70b..970542e 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1418,7 +1418,7 @@ function theme_enable($theme_list) { drupal_theme_rebuild(); // Invoke hook_themes_enabled() after the themes have been enabled. - module_invoke_all('themes_enabled', $theme_list); + module_invoke1_all('themes_enabled', $theme_list); } /** @@ -1451,7 +1451,7 @@ function theme_disable($theme_list) { drupal_theme_rebuild(); // Invoke hook_themes_disabled after the themes have been disabled. - module_invoke_all('themes_disabled', $theme_list); + module_invoke1_all('themes_disabled', $theme_list); } /** diff --git a/core/includes/token.inc b/core/includes/token.inc index 7a5fea1..c83c0f1 100644 --- a/core/includes/token.inc +++ b/core/includes/token.inc @@ -250,7 +250,7 @@ function token_find_with_prefix(array $tokens, $prefix, $delimiter = ':') { function token_info() { $data = &drupal_static(__FUNCTION__); if (!isset($data)) { - $data = module_invoke_all('token_info'); + $data = module_signal_all('token_info'); drupal_alter('token_info', $data); } return $data; diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index 72e31c3..a21a9ae 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -567,7 +567,7 @@ function aggregator_save_feed($edit) { function aggregator_remove($feed) { _aggregator_get_variables(); // Call hook_aggregator_remove() on all modules. - module_invoke_all('aggregator_remove', $feed); + module_invoke1_all('aggregator_remove', $feed); // Reset feed. db_merge('aggregator_feed') ->key(array('fid' => $feed->fid)) diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index ae9278c..2bdb485 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1469,7 +1469,7 @@ function comment_save($comment) { field_attach_presave('comment', $comment); // Allow modules to alter the comment before saving. - module_invoke_all('comment_presave', $comment); + module_invoke1_all('comment_presave', $comment); module_invoke_all('entity_presave', $comment, 'comment'); if ($comment->cid) { @@ -1485,7 +1485,7 @@ function comment_save($comment) { field_attach_update('comment', $comment); // Allow modules to respond to the updating of a comment. - module_invoke_all('comment_update', $comment); + module_invoke1_all('comment_update', $comment); module_invoke_all('entity_update', $comment, 'comment'); } else { @@ -1567,11 +1567,11 @@ function comment_save($comment) { field_attach_insert('comment', $comment); // Tell the other modules a new comment has been submitted. - module_invoke_all('comment_insert', $comment); + module_invoke1_all('comment_insert', $comment); module_invoke_all('entity_insert', $comment, 'comment'); } if ($comment->status == COMMENT_PUBLISHED) { - module_invoke_all('comment_publish', $comment); + module_invoke1_all('comment_publish', $comment); } unset($comment->original); } @@ -1610,7 +1610,7 @@ function comment_delete_multiple($cids) { ->execute(); foreach ($comments as $comment) { field_attach_delete('comment', $comment); - module_invoke_all('comment_delete', $comment); + module_invoke1_all('comment_delete', $comment); module_invoke_all('entity_delete', $comment, 'comment'); // Delete the comment's replies. diff --git a/core/modules/dashboard/dashboard.module b/core/modules/dashboard/dashboard.module index 1216cc0..336525c 100644 --- a/core/modules/dashboard/dashboard.module +++ b/core/modules/dashboard/dashboard.module @@ -457,7 +457,7 @@ function dashboard_is_visible() { * Return an array of dashboard region descriptions, keyed by region name. */ function dashboard_region_descriptions() { - $regions = module_invoke_all('dashboard_regions'); + $regions = module_signal_all('dashboard_regions'); drupal_alter('dashboard_regions', $regions); return $regions; } diff --git a/core/modules/entity/entity.module b/core/modules/entity/entity.module index 02611e3..3de86c8 100644 --- a/core/modules/entity/entity.module +++ b/core/modules/entity/entity.module @@ -61,7 +61,7 @@ function entity_get_info($entity_type = NULL) { $entity_info = $cache->data; } else { - $entity_info = module_invoke_all('entity_info'); + $entity_info = module_signal_all('entity_info'); // Merge in default values. foreach ($entity_info as $name => $data) { $entity_info[$name] += array( diff --git a/core/modules/field/field.crud.inc b/core/modules/field/field.crud.inc index e34c0c5..9de39ef 100644 --- a/core/modules/field/field.crud.inc +++ b/core/modules/field/field.crud.inc @@ -188,7 +188,7 @@ function field_create_field($field) { field_cache_clear(TRUE); // Invoke external hooks after the cache is cleared for API consistency. - module_invoke_all('field_create_field', $field); + module_invoke1_all('field_create_field', $field); return $field; } @@ -362,7 +362,7 @@ function field_read_fields($params = array(), $include_additional = array()) { $field['translatable'] = $record['translatable']; $field['deleted'] = $record['deleted']; - module_invoke_all('field_read_field', $field); + module_invoke1_all('field_read_field', $field); // Populate storage information. module_load_install($field['module']); @@ -409,7 +409,7 @@ function field_delete_field($field_name) { // Clear the cache. field_cache_clear(TRUE); - module_invoke_all('field_delete_field', $field); + module_invoke1_all('field_delete_field', $field); } /** @@ -492,7 +492,7 @@ function field_create_instance($instance) { field_cache_clear(); // Invoke external hooks after the cache is cleared for API consistency. - module_invoke_all('field_create_instance', $instance); + module_invoke1_all('field_create_instance', $instance); return $instance; } @@ -713,7 +713,7 @@ function field_read_instances($params = array(), $include_additional = array()) $instance['bundle'] = $record['bundle']; $instance['deleted'] = $record['deleted']; - module_invoke_all('field_read_instance', $instance); + module_invoke1_all('field_read_instance', $instance); $instances[] = $instance; } } @@ -747,7 +747,7 @@ function field_delete_instance($instance, $field_cleanup = TRUE) { module_invoke($field['storage']['module'], 'field_storage_delete_instance', $instance); // Let modules react to the deletion of the instance. - module_invoke_all('field_delete_instance', $instance); + module_invoke1_all('field_delete_instance', $instance); // Delete the field itself if we just deleted its last instance. if ($field_cleanup && count($field['bundles']) == 0) { @@ -934,7 +934,7 @@ function field_purge_instance($instance) { field_info_cache_clear(); // Invoke external hooks after the cache is cleared for API consistency. - module_invoke_all('field_purge_instance', $instance); + module_invoke1_all('field_purge_instance', $instance); } /** @@ -963,7 +963,7 @@ function field_purge_field($field) { field_info_cache_clear(); // Invoke external hooks after the cache is cleared for API consistency. - module_invoke_all('field_purge_field', $field); + module_invoke1_all('field_purge_field', $field); } /** diff --git a/core/modules/field/field.info.inc b/core/modules/field/field.info.inc index 69fefca..f76e065 100644 --- a/core/modules/field/field.info.inc +++ b/core/modules/field/field.info.inc @@ -231,7 +231,7 @@ function _field_info_collate_fields() { } // Populate 'extra_fields'. - $extra = module_invoke_all('field_extra_fields'); + $extra = module_signal_all('field_extra_fields'); drupal_alter('field_extra_fields', $extra); // Merge in saved settings. foreach ($extra as $entity_type => $bundles) { diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 2ad725a..7871e90 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -249,10 +249,10 @@ function filter_format_save($format) { } if ($return == SAVED_NEW) { - module_invoke_all('filter_format_insert', $format); + module_invoke1_all('filter_format_insert', $format); } else { - module_invoke_all('filter_format_update', $format); + module_invoke1_all('filter_format_update', $format); // Explicitly indicate that the format was updated. We need to do this // since if the filters were updated but the format object itself was not, // the merge query above would not return an indication that anything had @@ -286,7 +286,7 @@ function filter_format_disable($format) { ->execute(); // Allow modules to react on text format deletion. - module_invoke_all('filter_format_disable', $format); + module_invoke1_all('filter_format_disable', $format); // Clear the filter cache whenever a text format is disabled. filter_formats_reset(); diff --git a/core/modules/image/image.module b/core/modules/image/image.module index 54d98eb..b7baee9 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -284,7 +284,7 @@ function image_file_download($uri) { // Check that the file exists and is an image. if ($info = image_get_info($uri)) { // Check the permissions of the original to grant access to this image. - $headers = module_invoke_all('file_download', $original_uri); + $headers = module_invoke1_all('file_download', $original_uri); if (!in_array(-1, $headers)) { return array( // Send headers describing the image's size, and MIME-type... @@ -606,7 +606,7 @@ function image_style_save($style) { } // Let other modules update as necessary on save. - module_invoke_all('image_style_save', $style); + module_invoke1_all('image_style_save', $style); // Clear all caches and flush. image_style_flush($style); @@ -634,7 +634,7 @@ function image_style_delete($style, $replacement_style_name = '') { // Let other modules update as necessary on save. $style['old_name'] = $style['name']; $style['name'] = $replacement_style_name; - module_invoke_all('image_style_delete', $style); + module_invoke1_all('image_style_delete', $style); return TRUE; } @@ -711,7 +711,7 @@ function image_style_deliver($style, $scheme) { file_download($scheme, file_uri_target($derivative_uri)); } else { - $headers = module_invoke_all('file_download', $image_uri); + $headers = module_invoke1_all('file_download', $image_uri); if (in_array(-1, $headers) || empty($headers)) { return drupal_access_denied(); } @@ -852,7 +852,7 @@ function image_style_flush($style) { } // Let other modules update as necessary on flush. - module_invoke_all('image_style_flush', $style); + module_invoke1_all('image_style_flush', $style); // Clear image style and effect caches. cache()->delete('image_styles'); diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 103c284..cce83be 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -795,7 +795,7 @@ function locale_language_delete($langcode) { if (isset($languages[$langcode])) { $language = $languages[$langcode]; - module_invoke_all('locale_language_delete', $language); + module_invoke1_all('locale_language_delete', $language); // Remove translations first. db_delete('locales_target') diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index cd42256..8b58463 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -268,11 +268,11 @@ function menu_save($menu) { switch ($status) { case SAVED_NEW: - module_invoke_all('menu_insert', $menu); + module_invoke1_all('menu_insert', $menu); break; case SAVED_UPDATED: - module_invoke_all('menu_update', $menu); + module_invoke1_all('menu_update', $menu); break; } } @@ -311,7 +311,7 @@ function menu_delete($menu) { ->execute(); menu_cache_clear_all(); - module_invoke_all('menu_delete', $menu); + module_invoke1_all('menu_delete', $menu); } /** diff --git a/core/modules/node/content_types.inc b/core/modules/node/content_types.inc index d58bc31..b4c1364 100644 --- a/core/modules/node/content_types.inc +++ b/core/modules/node/content_types.inc @@ -397,7 +397,7 @@ function node_node_type_update($info) { * then nothing happens. */ function node_type_reset($type) { - $info_array = module_invoke_all('node_info'); + $info_array = module_signal_all('node_info'); if (isset($info_array[$type->orig_type])) { $info_array[$type->orig_type]['type'] = $type->orig_type; $info = node_type_set_defaults($info_array[$type->orig_type]); diff --git a/core/modules/node/node.admin.inc b/core/modules/node/node.admin.inc index 8f46df4..19f7dd9 100644 --- a/core/modules/node/node.admin.inc +++ b/core/modules/node/node.admin.inc @@ -366,7 +366,7 @@ function node_admin_nodes() { '#access' => $admin_access, ); $options = array(); - foreach (module_invoke_all('node_operations') as $operation => $array) { + foreach (module_signal_all('node_operations') as $operation => $array) { $options[$operation] = $array['label']; } $form['options']['operation'] = array( @@ -539,7 +539,7 @@ function node_admin_nodes_validate($form, &$form_state) { * Execute the chosen 'Update option' on the selected nodes. */ function node_admin_nodes_submit($form, &$form_state) { - $operations = module_invoke_all('node_operations'); + $operations = module_signal_all('node_operations'); $operation = $operations[$form_state['values']['operation']]; // Filter out unchecked nodes $nodes = array_filter($form_state['values']['nodes']); diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 81ee841..4d676f9 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -517,7 +517,7 @@ function node_type_save($info) { if (!empty($type->old_type) && $type->old_type != $type->type) { field_attach_rename_bundle('node', $type->old_type, $type->type); } - module_invoke_all('node_type_update', $type); + module_invoke1_all('node_type_update', $type); $status = SAVED_UPDATED; } else { @@ -528,7 +528,7 @@ function node_type_save($info) { field_attach_create_bundle('node', $type->type); - module_invoke_all('node_type_insert', $type); + module_invoke1_all('node_type_insert', $type); $status = SAVED_NEW; } @@ -620,7 +620,7 @@ function node_type_delete($type) { ->condition('type', $type) ->execute(); field_attach_delete_bundle('node', $type); - module_invoke_all('node_type_delete', $info); + module_invoke1_all('node_type_delete', $info); // Clear the node type cache. node_type_cache_reset(); @@ -958,7 +958,7 @@ function node_object_prepare($node) { $node->revision = in_array('revision', $node_options); node_invoke($node, 'prepare'); - module_invoke_all('node_prepare', $node); + module_invoke1_all('node_prepare', $node); } /** @@ -1057,7 +1057,7 @@ function node_save($node) { $update_node = TRUE; // Let modules modify the node before it is saved to the database. - module_invoke_all('node_presave', $node); + module_invoke1_all('node_presave', $node); module_invoke_all('entity_presave', $node, 'node'); if ($node->is_new || !empty($node->revision)) { @@ -1199,7 +1199,7 @@ function node_delete_multiple($nids) { foreach ($nodes as $nid => $node) { // Call the node-specific callback (if any): node_invoke($node, 'delete'); - module_invoke_all('node_delete', $node); + module_invoke1_all('node_delete', $node); module_invoke_all('entity_delete', $node, 'node'); field_attach_delete('node', $node); @@ -1255,7 +1255,7 @@ function node_revision_delete($revision_id) { ->condition('nid', $revision->nid) ->condition('vid', $revision->vid) ->execute(); - module_invoke_all('node_revision_delete', $revision); + module_invoke1_all('node_revision_delete', $revision); field_attach_delete_revision('node', $revision); return TRUE; } @@ -1552,7 +1552,7 @@ function node_permission() { * A query object that has been extended with the Search DB Extender. */ function _node_rankings(SelectQueryExtender $query) { - if ($ranking = module_invoke_all('ranking')) { + if ($ranking = module_signal_all('ranking')) { $tables = &$query->getTables(); foreach ($ranking as $rank => $values) { if ($node_rank = variable_get('node_rank_' . $rank, 0)) { @@ -1619,7 +1619,7 @@ function node_search_admin() { // Note: reversed to reflect that higher number = higher ranking. $options = drupal_map_assoc(range(0, 10)); - foreach (module_invoke_all('ranking') as $var => $values) { + foreach (module_signal_all('ranking') as $var => $values) { $form['content_ranking']['factors']['node_rank_' . $var] = array( '#title' => $values['title'], '#type' => 'select', @@ -1671,7 +1671,7 @@ function node_search_execute($keys = NULL, $conditions = NULL) { // Fetch comments for snippet. $node->rendered .= ' ' . module_invoke('comment', 'node_update_index', $node); - $extra = module_invoke_all('node_search_result', $node); + $extra = module_invoke1_all('node_search_result', $node); $uri = entity_uri('node', $node); $results[] = array( @@ -2644,7 +2644,7 @@ function _node_index_node($node) { $text = '