Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F847864
D435.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Apr 19, 7:12 PM
Size
976 B
Mime Type
text/x-diff
Expires
Sun, Apr 20, 7:12 PM (28 m, 48 s)
Engine
blob
Format
Raw Data
Handle
602650
Attached To
D435: INP-1831 - Allow specifying "HookToModule" in hook declarations
D435.diff
View Options
Index: branches/5.2.x/core/kernel/utility/unit_config_reader.php
===================================================================
--- branches/5.2.x/core/kernel/utility/unit_config_reader.php
+++ branches/5.2.x/core/kernel/utility/unit_config_reader.php
@@ -479,6 +479,11 @@
$hooks = $config['Hooks'];
foreach ($hooks as $hook) {
+ // Don't attempt to register a hook to a module isn't installed.
+ if ( isset($hook['HookToModule']) && !isset($this->Application->ModuleInfo[$hook['HookToModule']]) ) {
+ continue;
+ }
+
if ( isset($config['ParentPrefix']) && ($hook['HookToPrefix'] == $config['ParentPrefix']) ) {
trigger_error('Depricated Hook Usage [prefix: <strong>' . $config['Prefix'] . '</strong>; do_prefix: <strong>' . $hook['DoPrefix'] . '</strong>] use <strong>#PARENT#</strong> as <strong>HookToPrefix</strong> value, where HookToPrefix is same as ParentPrefix', defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_NOTICE);
}
Event Timeline
Log In to Comment