From: Matthias Schmidt Date: Sun, 1 Sep 2019 12:37:02 +0000 (+0200) Subject: Print split node exception messages in update log X-Git-Tag: 5.2.0_Beta_2~78 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2db7cb905c176baacb6e447219aca7b5f6de5bd9;p=GitHub%2FWoltLab%2FWCF.git Print split node exception messages in update log See #3043 --- diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 548214ad0b..ab76af9cbe 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -154,7 +154,12 @@ class PackageInstallationDispatcher { } if ($step->splitNode()) { - $this->logInstallationStep($data, 'split node'); + $log = 'split node'; + if ($step->getException() !== null && $step->getException()->getMessage()) { + $log .= ': ' . $step->getException()->getMessage(); + } + + $this->logInstallationStep($data, $log); $this->nodeBuilder->cloneNode($node, $data['sequenceNo']); break; } @@ -737,7 +742,7 @@ class PackageInstallationDispatcher { $document = $plugin->{$this->action}(); } catch (SplitNodeException $e) { - $step->setSplitNode(); + $step->setSplitNode($e); } if ($document !== null && ($document instanceof FormDocument)) { diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationStep.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationStep.class.php index 8404bf1318..6449ec5cf2 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationStep.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationStep.class.php @@ -17,6 +17,12 @@ class PackageInstallationStep { */ protected $document = null; + /** + * exception causing node splitting + * @var null|SplitNodeException + */ + protected $exception; + /** * next installation node * @var string @@ -56,6 +62,16 @@ class PackageInstallationStep { $this->document = $document; } + /** + * Returns the exception causing node splitting or `null` if the node has not been split + * or if it was not split by an exception. + * + * @return null|SplitNodeException + */ + public function getException() { + return $this->exception; + } + /** * Returns HTML-representation of form document object. * @@ -76,9 +92,12 @@ class PackageInstallationStep { /** * Enforces node splitting. + * + * @param null|SplitNodeException $splitNodeException */ - public function setSplitNode() { + public function setSplitNode(SplitNodeException $splitNodeException = null) { $this->splitNode = true; + $this->exception = $splitNodeException; } /**