Follow up for #1331486: Move module_invoke_*() and friends to an Extensions class

Problem/Motivation

https://api.drupal.org/api/drupal/core%21includes%21bootstrap.inc/functi...
is wrong, it says Use drupal_container()->get('module_handler')->moduleExists($hook).
Should be Drupal::moduleHandler()->moduleExists('language')

Proposed resolution

Update doc.

Remaining tasks

TBD

User interface changes

No.

API changes

No.

Comments

yesct’s picture

Status: Active » Needs review
StatusFileSize
new551 bytes

this might not be the right place... as the recommended thing to use does not match what is actually in that function.

tim.plunkett’s picture

Title: update depreciated doc for module_exists » Update deprecated doc for module_exists()

Status: Needs review » Needs work

The last submitted patch, bootstrap.module_exists_depreciated.2007684.1.patch, failed testing.

ddrozdik’s picture

Will be done today during Code Sprint UA.

ddrozdik’s picture

Assigned: Unassigned » ddrozdik
podarok’s picture

Issue tags: +CodeSprintUA

tagging

ddrozdik’s picture

Title: Update deprecated doc for module_exists() » Update deprecated doc for module_exists() and call method inside
Status: Needs work » Needs review
StatusFileSize
new685 bytes

Attached file with changed doc for function. Also I have changed call method inside this function.

ddrozdik’s picture

But I think the best way to delete this function from drupal 8 and use Drupal::moduleHandler()->moduleExists('module'); to check exist module or not.
If someone agree with me, I will prepare patch for this.

podarok’s picture

#7 looks good
if bot`ll happy - RTBC

tim.plunkett’s picture

Status: Needs review » Needs work
+++ b/core/includes/bootstrap.incundefined
@@ -2249,13 +2249,10 @@ function drupal_alter($type, &$data, &$context1 = NULL, &$context2 = NULL) {
- * @deprecated as of Drupal 8.0. Use
- *   drupal_container()->get('module_handler')->moduleExists($hook).

Don't we want to update this, not delete it?

+++ b/core/includes/bootstrap.incundefined
@@ -2249,13 +2249,10 @@ function drupal_alter($type, &$data, &$context1 = NULL, &$context2 = NULL) {
-  return drupal_container()->get('module_handler')->moduleExists($module);
+    return Drupal::moduleHandler()->moduleExists($module);

Too far indented.

ddrozdik’s picture

Status: Needs work » Needs review
StatusFileSize
new732 bytes

Attached corrected patch.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs s reroll

curl https://drupal.org/files/2007684-update-module_exists-doc-and_call-method.patch | git a
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   732  100   732    0     0    610      0  0:00:01  0:00:01 --:--:--   712
error: patch failed: core/includes/bootstrap.inc:2250
error: core/includes/bootstrap.inc: patch does not apply
ddrozdik’s picture

Status: Needs work » Fixed

This task already done in Issue #1957154: Replace calls to drupal_container()->get('module_handler') service with Drupal::moduleHandler() and committed to 8.x by webchick here - 30d3671 at 5 june.

ddrozdik’s picture

Status: Fixed » Closed (fixed)