diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 8797e74..9e1f190 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1577,7 +1577,7 @@ function install_import_translations(&$install_state) { // Set up a batch to import translations for the newly added language. _install_prepare_import($langcode); - module_load_include('fetch.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.fetch.inc'); if ($batch = locale_translation_batch_fetch_build(array(), array($langcode))) { return $batch; } @@ -1616,7 +1616,7 @@ function _install_prepare_import($langcode) { 'status' => 1, ); \Drupal::service('locale.project')->set($data['name'], $data); - module_load_include('compare.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.compare.inc'); locale_translation_check_projects_local(array('drupal'), array($install_state['parameters']['langcode'])); } } @@ -1635,8 +1635,8 @@ function _install_prepare_import($langcode) { * The batch definition, if there are language files to import. */ function install_import_translations_remaining(&$install_state) { - module_load_include('fetch.inc', 'locale'); - module_load_include('compare.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.fetch.inc'); + include_once(drupal_get_path('module', 'locale') . '/locale.compare.inc'); // Build a fresh list of installed projects. When more projects than core are // installed, their translations will be downloaded (if required) and imported diff --git a/core/includes/module.inc b/core/includes/module.inc index 023c102..af3f794 100644 --- a/core/includes/module.inc +++ b/core/includes/module.inc @@ -101,7 +101,12 @@ function module_load_install($module) { // Make sure the installation API is available include_once __DIR__ . '/install.inc'; - return module_load_include('install', $module); + $path = drupal_get_path('module', $module) . "/$module.install"; + if (file_exists($path)) { + include_once($path); + return TRUE; + } + return FALSE; } /** @@ -128,9 +133,11 @@ function module_load_install($module) { * (optional) The base file name (without the $type extension). If omitted, * $module is used; i.e., resulting in "$module.$type" by default. * - * @return + * @return bool * The name of the included file, if successful; FALSE otherwise. * + * @deprecated + * * @todo The module_handler service has a loadInclude() method which performs * this same task but only for enabled modules. Figure out a way to move this * functionality entirely into the module_handler while keeping the ability to diff --git a/core/lib/Drupal/Core/Form/FormState.php b/core/lib/Drupal/Core/Form/FormState.php index 5bed64a..e87d659 100644 --- a/core/lib/Drupal/Core/Form/FormState.php +++ b/core/lib/Drupal/Core/Form/FormState.php @@ -56,12 +56,10 @@ class FormState implements FormStateInterface, \ArrayAccess { * of a function to call instead. * - args: A list of arguments to pass to the form constructor. * - files: An optional array defining include files that need to be loaded - * for building the form. Each array entry may be the path to a file or - * another array containing values for the parameters 'type', 'module' and - * 'name' as needed by module_load_include(). The files listed here are - * automatically loaded by form_get_cache(). By default the current menu - * router item's 'file' definition is added, if any. Use - * self::loadInclude() to add include files from a form constructor. + * for building the form. Each array entry may be the path to a file. The + * files listed here are automatically loaded by form_get_cache(). By + * default the current menu router item's 'file' definition is added, if + * any. Use self::loadInclude() to add include files from a form constructor. * - form_id: Identification of the primary form being constructed and * processed. * - base_form_id: Identification for a base form, as declared in the form diff --git a/core/lib/Drupal/Core/Updater/Module.php b/core/lib/Drupal/Core/Updater/Module.php index acc3028..955280f 100644 --- a/core/lib/Drupal/Core/Updater/Module.php +++ b/core/lib/Drupal/Core/Updater/Module.php @@ -79,7 +79,7 @@ public function getSchemaUpdates() { if (!self::canUpdate($this->name)) { return array(); } - module_load_include('install', $this->name); + module_load_install($this->name); if (!$updates = drupal_get_schema_versions($this->name)) { return array(); diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index dddad7c..9ee1e55 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -626,7 +626,7 @@ function content_translation_form_field_ui_field_instance_edit_form_alter(array } if ($instance->isTranslatable()) { - module_load_include('inc', 'content_translation', 'content_translation.admin'); + include_once(drupal_get_path('module', 'content_translation') . '/content_translation.admin.inc'); $element = content_translation_field_sync_widget($instance); if ($element) { $form['instance']['third_party_settings']['content_translation']['translation_sync'] = $element; @@ -757,7 +757,7 @@ function content_translation_language_configuration_element_submit(array $form, * Implements hook_form_FORM_ID_alter() for language_content_settings_form(). */ function content_translation_form_language_content_settings_form_alter(array &$form, FormStateInterface $form_state) { - module_load_include('inc', 'content_translation', 'content_translation.admin'); + include_once(drupal_get_path('module', 'content_translation') . '/content_translation.admin.inc'); _content_translation_form_language_content_settings_form_alter($form, $form_state); } @@ -765,6 +765,6 @@ function content_translation_form_language_content_settings_form_alter(array &$f * Implements hook_preprocess_HOOK() for theme_language_content_settings_table(). */ function content_translation_preprocess_language_content_settings_table(&$variables) { - module_load_include('inc', 'content_translation', 'content_translation.admin'); + include_once(drupal_get_path('module', 'content_translation') . '/content_translation.admin.inc'); _content_translation_preprocess_language_content_settings_table($variables); } diff --git a/core/modules/locale/locale.batch.inc b/core/modules/locale/locale.batch.inc index b174074..198e1b5 100644 --- a/core/modules/locale/locale.batch.inc +++ b/core/modules/locale/locale.batch.inc @@ -174,7 +174,7 @@ function locale_translation_batch_fetch_import($project, $langcode, $options, &$ if (isset($source->type)) { if ($source->type == LOCALE_TRANSLATION_REMOTE || $source->type == LOCALE_TRANSLATION_LOCAL) { $file = $source->files[LOCALE_TRANSLATION_LOCAL]; - module_load_include('bulk.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/bulk.inc'); $options += array( 'message' => t('Importing translation for %project.', array('%project' => $source->project)), ); @@ -207,7 +207,7 @@ function locale_translation_batch_fetch_import($project, $langcode, $options, &$ * Batch results. */ function locale_translation_batch_fetch_finished($success, $results) { - module_load_include('bulk.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/bulk.inc'); if ($success) { \Drupal::state()->set('locale.translation_last_checked', REQUEST_TIME); } diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index c9bf165..b32a2ce 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -81,7 +81,7 @@ function locale_translate_batch_import_files($options, $force = FALSE) { * An array of interface translation files keyed by their URI. */ function locale_translate_get_interface_translation_files($projects = array(), $langcodes = array()) { - module_load_include('compare.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.compare.inc'); $files = array(); $projects = $projects ? $projects : array_keys(locale_translation_get_projects()); $langcodes = $langcodes ? $langcodes : array_keys(locale_translatable_language_list()); diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc index 26f3c9b..d3b2ef9 100644 --- a/core/modules/locale/locale.compare.inc +++ b/core/modules/locale/locale.compare.inc @@ -114,7 +114,7 @@ function locale_translation_build_projects() { function locale_translation_project_list() { $projects = &drupal_static(__FUNCTION__, array()); if (empty($projects)) { - module_load_include('compare.inc', 'update'); + include_once(drupal_get_path('module', 'update') . '/update.compare.inc'); $config = \Drupal::config('locale.settings'); $projects = array(); diff --git a/core/modules/locale/locale.fetch.inc b/core/modules/locale/locale.fetch.inc index 9568691..418d70f 100644 --- a/core/modules/locale/locale.fetch.inc +++ b/core/modules/locale/locale.fetch.inc @@ -27,7 +27,7 @@ * Batch definition array. */ function locale_translation_batch_update_build($projects = array(), $langcodes = array(), $options = array()) { - module_load_include('compare.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.compare.inc'); $projects = $projects ? $projects : array_keys(locale_translation_get_projects()); $langcodes = $langcodes ? $langcodes : array_keys(locale_translatable_language_list()); $status_options = $options; diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 3122f59..ff6a4fd 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -252,7 +252,7 @@ function locale_configurable_language_delete(ConfigurableLanguage $language) { \Drupal::service('locale.storage')->deleteTranslations(array('language' => $language->id())); // Remove interface translation files. - module_load_include('inc', 'locale', 'locale.bulk'); + include_once(drupal_get_path('module', 'locale') . '/locale.bulk.inc'); locale_translate_delete_translation_files(array(), array($language->id())); // Remove translated configuration objects. @@ -384,7 +384,7 @@ function locale_cron() { // Update tasks are added to the queue here but processed by Drupal's cron // using the cron worker defined in locale_queue_info(). if ($frequency = \Drupal::config('locale.settings')->get('translation.update_interval_days') && locale_translatable_language_list()) { - module_load_include('translation.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.translation.inc'); locale_cron_fill_queue(); } } @@ -422,7 +422,7 @@ function locale_queue_info() { * @see locale_queue_info() */ function locale_translation_worker($data) { - module_load_include('batch.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/batch.inc'); list($function, $args) = $data; // We execute batch operation functions here to check, download and import the @@ -476,14 +476,14 @@ function locale_system_update(array $components) { // because it would break out of the installer flow. We have // built-in support for translation imports in the installer. if (!drupal_installation_attempted() && locale_translatable_language_list() && \Drupal::config('locale.settings')->get('translation.import_enabled')) { - module_load_include('compare.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.compare.inc'); // Update the list of translatable projects and start the import batch. // Only when new projects are added the update batch will be triggered. Not // each enabled module will introduce a new project. E.g. sub modules. $projects = array_keys(locale_translation_build_projects()); if ($list = array_intersect($list, $projects)) { - module_load_include('fetch.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.fetch.inc'); // Get translation status of the projects, download and update // translations. $options = _locale_translation_default_update_options(); @@ -512,7 +512,7 @@ function locale_system_remove($components) { $components += array('module' => array(), 'theme' => array()); $list = array_merge($components['module'], $components['theme']); if ($language_list = locale_translatable_language_list()) { - module_load_include('compare.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.compare.inc'); \Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc'); // Delete configuration translations. \Drupal\locale\Locale::config()->deleteComponentTranslations($components, array_keys($language_list)); @@ -726,7 +726,7 @@ function locale_form_language_admin_add_form_alter_submit($form, FormStateInterf } // Download and import translations for the newly added language. - module_load_include('fetch.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.fetch.inc'); $options = _locale_translation_default_update_options(); $batch = locale_translation_batch_update_build(array(), array($langcode), $options); batch_set($batch); @@ -907,7 +907,7 @@ function locale_translation_file_history_delete($projects = array(), $langcodes function locale_translation_get_status($projects = NULL, $langcodes = NULL) { $result = array(); $status = \Drupal::state()->get('locale.translation_status'); - module_load_include('translation.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.translation.inc'); $projects = $projects ? $projects : array_keys(locale_translation_get_projects()); $langcodes = $langcodes ? $langcodes : array_keys(locale_translatable_language_list()); @@ -947,7 +947,7 @@ function locale_translation_status_save($project, $langcode, $type, $data) { // improve performance for large sites. // Load the translation status or build it if not already available. - module_load_include('translation.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.translation.inc'); $status = locale_translation_get_status(); if (empty($status)) { $projects = locale_translation_get_projects(array($project)); diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index dc6043b..5c4e5b4 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -20,7 +20,7 @@ * @see locale_menu() */ function locale_translation_manual_status() { - module_load_include('compare.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.compare.inc'); // Check the translation status of all translatable projects in all languages. // First we clear the cached list of projects. Although not strictly diff --git a/core/modules/locale/locale.translation.inc b/core/modules/locale/locale.translation.inc index 2208b1d..9ccc07b 100644 --- a/core/modules/locale/locale.translation.inc +++ b/core/modules/locale/locale.translation.inc @@ -61,7 +61,7 @@ function locale_translation_get_projects($project_names = array()) { // http://drupal.org/node/1777106 is a follow-up issue to make the check for // possible out-of-date project information more robust. if ($row_count == 0 && \Drupal::moduleHandler()->moduleExists('update')) { - module_load_include('compare.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.compare.inc'); // At least the core project should be in the database, so we build the // data if none are found. locale_translation_build_projects(); @@ -351,7 +351,7 @@ function locale_cron_fill_queue() { // For each project+language combination a number of tasks are added to // the queue. if ($updates) { - module_load_include('fetch.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.fetch.inc'); $options = _locale_translation_default_update_options(); $queue = \Drupal::queue('locale_translation', TRUE); diff --git a/core/modules/locale/src/Tests/LocaleUpdateTest.php b/core/modules/locale/src/Tests/LocaleUpdateTest.php index f564652..27ccad8 100644 --- a/core/modules/locale/src/Tests/LocaleUpdateTest.php +++ b/core/modules/locale/src/Tests/LocaleUpdateTest.php @@ -29,8 +29,8 @@ class LocaleUpdateTest extends LocaleUpdateBase { */ protected function setUp() { parent::setUp(); - module_load_include('compare.inc', 'locale'); - module_load_include('fetch.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.compare.inc'); + include_once(drupal_get_path('module', 'locale') . '/locale.fetch.inc'); $admin_user = $this->drupalCreateUser(array('administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'translate interface')); $this->drupalLogin($admin_user); // We use German as test language. This language must match the translation @@ -43,7 +43,7 @@ protected function setUp() { * Checks if a list of translatable projects gets build. */ public function testUpdateProjects() { - module_load_include('compare.inc', 'locale'); + include_once(drupal_get_path('module', 'locale') . '/locale.compare.inc'); // Make the test modules look like a normal custom module. i.e. make the // modules not hidden. locale_test_system_info_alter() modifies the project diff --git a/core/modules/node/node.module b/core/modules/node/node.module index d96052d..02e3bb2 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -767,13 +767,13 @@ function node_user_cancel($edit, $account, $method) { $nids = \Drupal::entityQuery('node') ->condition('uid', $account->id()) ->execute(); - module_load_include('inc', 'node', 'node.admin'); + include_once(drupal_get_path('module', 'node') . '/node.admin.inc'); node_mass_update($nids, array('status' => 0), NULL, TRUE); break; case 'user_cancel_reassign': // Anonymize all of the nodes for this old account. - module_load_include('inc', 'node', 'node.admin'); + include_once(drupal_get_path('module', 'node') . '/node.admin.inc'); $vids = \Drupal::entityManager()->getStorage('node')->userRevisionIds($account); node_mass_update($vids, array( 'uid' => 0, diff --git a/core/modules/taxonomy/src/Controller/TaxonomyController.php b/core/modules/taxonomy/src/Controller/TaxonomyController.php index 0ddbce4..81bdb65 100644 --- a/core/modules/taxonomy/src/Controller/TaxonomyController.php +++ b/core/modules/taxonomy/src/Controller/TaxonomyController.php @@ -35,7 +35,7 @@ public function addForm(VocabularyInterface $taxonomy_vocabulary) { * @todo Remove taxonomy_term_page(). */ public function termPage(TermInterface $taxonomy_term) { - module_load_include('pages.inc', 'taxonomy'); + include_once(drupal_get_path('module', 'taxonomy') . '/user.pages.inc'); return taxonomy_term_page($taxonomy_term); } @@ -70,7 +70,7 @@ public function termTitle(TermInterface $taxonomy_term) { * @todo Remove taxonomy_term_feed(). */ public function termFeed(TermInterface $taxonomy_term) { - module_load_include('pages.inc', 'taxonomy'); + include_once(drupal_get_path('module', 'taxonomy') . '/taxonomy.pages.inc'); return taxonomy_term_feed($taxonomy_term); } diff --git a/core/modules/tracker/src/Controller/TrackerPage.php b/core/modules/tracker/src/Controller/TrackerPage.php index a9d667a..4a299a2 100644 --- a/core/modules/tracker/src/Controller/TrackerPage.php +++ b/core/modules/tracker/src/Controller/TrackerPage.php @@ -18,7 +18,7 @@ class TrackerPage extends ControllerBase { * Content callback for the tracker.page route. */ public function getContent() { - module_load_include('inc', 'tracker', 'tracker.pages'); + include_once(drupal_get_path('module', 'tracker') . '/tracker.pages.inc'); return tracker_page(); } } diff --git a/core/modules/tracker/src/Controller/TrackerUserRecent.php b/core/modules/tracker/src/Controller/TrackerUserRecent.php index 4b644ae..939a7dc 100644 --- a/core/modules/tracker/src/Controller/TrackerUserRecent.php +++ b/core/modules/tracker/src/Controller/TrackerUserRecent.php @@ -19,7 +19,7 @@ class TrackerUserRecent extends ControllerBase { * Content callback for the tracker.users_recent_content route. */ public function getContent(UserInterface $user) { - module_load_include('inc', 'tracker', 'tracker.pages'); + include_once(drupal_get_path('module', 'tracker') . '/tracker.pages.inc'); return tracker_page($user); } } diff --git a/core/modules/tracker/src/Controller/TrackerUserTab.php b/core/modules/tracker/src/Controller/TrackerUserTab.php index 49a7574..e0cfcbc 100644 --- a/core/modules/tracker/src/Controller/TrackerUserTab.php +++ b/core/modules/tracker/src/Controller/TrackerUserTab.php @@ -20,7 +20,7 @@ class TrackerUserTab extends ControllerBase { * Content callback for the tracker.user_tab route. */ public function getContent(UserInterface $user) { - module_load_include('inc', 'tracker', 'tracker.pages'); + include_once(drupal_get_path('module', 'tracker') . '/tracker.pages.inc'); return tracker_page($user); } diff --git a/core/modules/update/src/Tests/UpdateContribTest.php b/core/modules/update/src/Tests/UpdateContribTest.php index 0e547ef..e906868 100644 --- a/core/modules/update/src/Tests/UpdateContribTest.php +++ b/core/modules/update/src/Tests/UpdateContribTest.php @@ -263,7 +263,7 @@ function testUpdateShowDisabledThemes() { * Tests updates with a hidden base theme. */ function testUpdateHiddenBaseTheme() { - module_load_include('compare.inc', 'update'); + include_once(drupal_get_path('module', 'update') . '/update.compare.inc'); // Enable the subtheme. theme_enable(array('update_test_subtheme')); diff --git a/core/modules/update/update.install b/core/modules/update/update.install index 7997ec8..00e3e5a 100644 --- a/core/modules/update/update.install +++ b/core/modules/update/update.install @@ -29,7 +29,7 @@ function update_requirements($phase) { $requirements = array(); if ($phase == 'runtime') { if ($available = update_get_available(FALSE)) { - module_load_include('inc', 'update', 'update.compare'); + include_once(drupal_get_path('module', 'update') . '/update.compare.inc'); $data = update_calculate_project_data($available); // First, populate the requirements for core: $requirements['update_core'] = _update_requirement_check($data['drupal'], 'core'); diff --git a/core/modules/update/update.module b/core/modules/update/update.module index 6529a48..bee3014 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -222,7 +222,7 @@ function update_cron() { if ((REQUEST_TIME - $last_email_notice) > $interval) { // If configured time between notifications elapsed, send email about // updates possibly available. - module_load_include('inc', 'update', 'update.fetch'); + include_once(drupal_get_path('module', 'update') . '/update.fetch.inc'); _update_cron_notify(); } @@ -305,7 +305,7 @@ function _update_no_data() { * @see update_get_projects() */ function update_get_available($refresh = FALSE) { - module_load_include('inc', 'update', 'update.compare'); + include_once(drupal_get_path('module', 'update') . '/update.compare.inc'); $needs_refresh = FALSE; // Grab whatever data we currently have. @@ -364,7 +364,7 @@ function update_get_available($refresh = FALSE) { * @see _update_create_fetch_task() */ function update_create_fetch_task($project) { - module_load_include('inc', 'update', 'update.fetch'); + include_once(drupal_get_path('module', 'update') . '/update.fetch.inc'); _update_create_fetch_task($project); } @@ -374,7 +374,7 @@ function update_create_fetch_task($project) { * @see _update_refresh() */ function update_refresh() { - module_load_include('inc', 'update', 'update.fetch'); + include_once(drupal_get_path('module', 'update') . '/update.fetch.inc'); _update_refresh(); } @@ -384,7 +384,7 @@ function update_refresh() { * @see _update_fetch_data() */ function update_fetch_data() { - module_load_include('inc', 'update', 'update.fetch'); + include_once(drupal_get_path('module', 'update') . '/update.fetch.inc'); _update_fetch_data(); } diff --git a/core/modules/user/src/Controller/UserController.php b/core/modules/user/src/Controller/UserController.php index 7ce404d..43a81fe 100644 --- a/core/modules/user/src/Controller/UserController.php +++ b/core/modules/user/src/Controller/UserController.php @@ -179,7 +179,7 @@ public function logout() { * @todo Remove user_cancel_confirm(). */ public function confirmCancel(UserInterface $user, $timestamp = 0, $hashed_pass = '') { - module_load_include('pages.inc', 'user'); + include_once(drupal_get_path('module', 'user') . '/user.pages.inc'); return user_cancel_confirm($user, $timestamp, $hashed_pass); } diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php index 34e9f7f..32a85f0 100644 --- a/core/modules/user/user.api.php +++ b/core/modules/user/user.api.php @@ -42,7 +42,7 @@ function hook_user_cancel($edit, $account, $method) { switch ($method) { case 'user_cancel_block_unpublish': // Unpublish nodes (current revisions). - module_load_include('inc', 'node', 'node.admin'); + include_once(drupal_get_path('module', 'node') . '/node.admin.inc'); $nodes = \Drupal::entityQuery('node') ->condition('uid', $user->id()) ->execute(); @@ -51,7 +51,7 @@ function hook_user_cancel($edit, $account, $method) { case 'user_cancel_reassign': // Anonymize nodes (current revisions). - module_load_include('inc', 'node', 'node.admin'); + include_once(drupal_get_path('module', 'node') . '/node.admin.inc'); $nodes = \Drupal::entityQuery('node') ->condition('uid', $user->id()) ->execute(); diff --git a/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php b/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php index bb63902..2e0e67d 100644 --- a/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php +++ b/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php @@ -621,7 +621,7 @@ protected function rowStyleOptions() { * available). */ protected function buildFilters(&$form, FormStateInterface $form_state) { - module_load_include('inc', 'views_ui', 'admin'); + include_once(drupal_get_path('module', 'views_ui') . '/admin.inc'); $bundles = entity_get_bundles($this->entityTypeId); // If the current base table support bundles and has more than one (like user). @@ -923,7 +923,7 @@ protected function defaultDisplayFiltersUser(array $form, FormStateInterface $fo // Figure out the table where $bundle_key lives. It may not be the same as // the base table for the view; the taxonomy vocabulary machine_name, for // example, is stored in taxonomy_vocabulary, not taxonomy_term_data. - module_load_include('inc', 'views_ui', 'admin'); + include_once(drupal_get_path('module', 'views_ui') . '/admin.inc'); $fields = Views::viewsDataHelper()->fetchFields($this->base_table, 'filter'); if (isset($fields[$this->base_table . '.' . $bundle_key])) { $table = $this->base_table; diff --git a/core/scripts/generate-d6-content.sh b/core/scripts/generate-d6-content.sh index fc4c68f..e4cd5d9 100644 --- a/core/scripts/generate-d6-content.sh +++ b/core/scripts/generate-d6-content.sh @@ -96,7 +96,7 @@ $node_id = 0; $revision_id = 0; -module_load_include('inc', 'node', 'node.pages'); +include_once(drupal_get_path('module', 'node') . '/node.pages.inc'); for ($i = 0; $i < 24; $i++) { $uid = intval($i / 8) + 3; $user = user_load($uid); diff --git a/core/scripts/generate-d7-content.sh b/core/scripts/generate-d7-content.sh index 9925fe1..f27e181 100644 --- a/core/scripts/generate-d7-content.sh +++ b/core/scripts/generate-d7-content.sh @@ -158,7 +158,7 @@ } $node_id = 0; $revision_id = 0; -module_load_include('inc', 'node', 'node.pages'); +include_once(drupal_get_path('module', 'node') . '/node.pages.inc'); for ($i = 0; $i < 36; $i++) { $uid = intval($i / 8) + 3; $user = user_load($uid);