Check what syntaxhighlighter_requirements() does at site-install time, and evaluate if the line require_once 'syntaxhighlighter.module'; can be removed.

The hook_requirements() documentation says that when $phase == 'install' stuff may need to be imported but our implementation does nothing during this phase.

Comments

ao2 created an issue. See original summary.

ao2’s picture

Status: Active » Needs review
StatusFileSize
new471 bytes

Attaching a patch that can be tested by bringing it in at install time using the "extra, patches" mechanism in composer.json, like this:

diff --git a/composer.json b/composer.json
index 6f824dd..889d9af 100644
--- a/composer.json
+++ b/composer.json
@@ -73,6 +98,9 @@
         "patches": {
             "drupal/core": {
                 "drupal-do_not_disable_MultiViews_htaccess": "https://www.drupal.org/files/issues/drupal-do_not_disable_MultiViews_htaccess-2619250-24.patch"
+            },
+            "drupal/syntaxhighlighter": {
+                "syntaxhighlighter_do_not_require_module_in_hook_requirements": "https://www.drupal.org/files/issues/syntaxhighlighter_do_not_require_module_in_hook_requirements-2881173-2.patch"
             }
         }
     }

ao2’s picture

Issue summary: View changes

Fixed wording in the issue description

ao2’s picture

From my tests I verified that during the "runtime" phase it's not necessary to require the .module file because the module has already been installed.

It would be necessary if we wanted to check the requirements also during the "install" phase, which I think we should do BTW, to be able to use _syntaxhighlighter_get_lib_location(), but not if we switch to use the libraries module unconditionally.

So I am setting #2881252: Make the libraries module a hard dependency as the parent issue.

  • ao2 committed c3f4be1 on 8.x-1.x
    Issue #2881173: enable verifying requirements also at install time
    
    Note...
ao2’s picture

Status: Needs review » Fixed

Closing as fixed, now the requirements are checked also at install time.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.