From e831d66b76a1c0bbb548c2e9046512d36f73a9ad Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Fri, 15 Apr 2022 17:30:05 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B05090=20Setup=20:=20improve=20missing=20d?= =?UTF-8?q?ependencies=20message=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The setup now relies on the new method MissingDependencyException::getHtmlDesc to get the message to display MissingDependencyException is also now a CoreException child. Note that previous behavior (MissingDependencyException instantiator setting message) is kept, as some consumer still do $e->getMessage() (like unattended install) --- setup/modulediscovery.class.inc.php | 39 ++++++++++++++++++++++++++++- setup/wizardsteps.class.inc.php | 4 +-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/setup/modulediscovery.class.inc.php b/setup/modulediscovery.class.inc.php index a77db0ecd..aaffe7c49 100644 --- a/setup/modulediscovery.class.inc.php +++ b/setup/modulediscovery.class.inc.php @@ -19,9 +19,46 @@ * */ -class MissingDependencyException extends Exception +class MissingDependencyException extends CoreException { + /** + * @see \ModuleDiscovery::OrderModulesByDependencies property init + * @var array module id as key + * another array as value, containing : 'module' with module info, 'dependencies' with missing dependencies + */ public $aModulesInfo; + + /** + * @return string HTML to print to the user the modules impacted + * @since 2.7.7 3.0.2 3.1.0 PR #280 + */ + public function getHtmlDesc($sHighlightHtmlBegin = null, $sHighlightHtmlEnd = null) + { + $sErrorMessage = <<The following modules have unmet dependencies:

+