From fc3b723d374a8488407a4340b36ff37bd575b60f Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 3 Nov 2016 18:20:11 -0700 Subject: [PATCH] Don't register flow-thank when Flow is not installed This causes issues with uninstalling Flow. Bug: T148611 Change-Id: I2a282b06848e0e2074bb69d12b7aed143204fd2e --- Thanks.hooks.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Thanks.hooks.php b/Thanks.hooks.php index b6a519fd..d6a5011b 100644 --- a/Thanks.hooks.php +++ b/Thanks.hooks.php @@ -187,16 +187,18 @@ class ThanksHooks { ], ]; - $notifications['flow-thank'] = [ - 'category' => 'edit-thank', - 'group' => 'positive', - 'section' => 'message', - 'presentation-model' => 'EchoFlowThanksPresentationModel', - 'bundle' => [ - 'web' => true, - 'expandable' => true, - ], - ]; + if ( class_exists( Flow\FlowPresentationModel::class ) ) { + $notifications['flow-thank'] = [ + 'category' => 'edit-thank', + 'group' => 'positive', + 'section' => 'message', + 'presentation-model' => 'EchoFlowThanksPresentationModel', + 'bundle' => [ + 'web' => true, + 'expandable' => true, + ], + ]; + } $icons['thanks'] = [ 'path' => 'Thanks/ThankYou.png',