Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1050586
D435.id1166.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
Thu, Jul 3, 12:33 AM
Size
976 B
Mime Type
text/x-diff
Expires
Fri, Jul 4, 12:33 AM (12 h, 55 m)
Engine
blob
Format
Raw Data
Handle
678811
Attached To
D435: INP-1831 - Allow specifying "HookToModule" in hook declarations
D435.id1166.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