From b16db278f43d4280acb5fb8d218e8a28e0a0aa36 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 3 Jul 2013 15:26:08 +0200 Subject: [PATCH] Fixed support for quotable objects without a parent --- .../quote/MessageQuoteManager.class.php | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php b/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php index 812be6fdf8..7b914c1001 100644 --- a/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php +++ b/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php @@ -120,23 +120,22 @@ class MessageQuoteManager extends SingletonFactory { $this->quoteData[$quoteID] = $message; // save parent object id - if ($parentObjectID) { - if (!isset($this->quoteData['parents'])) { - $this->quoteData['parents'] = array(); - } - - if (!isset($this->quoteData['parents'][$objectType])) { - $this->quoteData['parents'][$objectType] = array(); - } - - if (!isset($this->quoteData['parents'][$objectType][$parentObjectID])) { - $this->quoteData['parents'][$objectType][$parentObjectID] = array(); - } - - $this->quoteData['parents'][$objectType][$parentObjectID][] = $objectID; - $this->quoteData[$quoteID.'_pID'] = $parentObjectID; + + if (!isset($this->quoteData['parents'])) { + $this->quoteData['parents'] = array(); + } + + if (!isset($this->quoteData['parents'][$objectType])) { + $this->quoteData['parents'][$objectType] = array(); } + if (!isset($this->quoteData['parents'][$objectType][$parentObjectID])) { + $this->quoteData['parents'][$objectType][$parentObjectID] = array(); + } + + $this->quoteData['parents'][$objectType][$parentObjectID][] = $objectID; + $this->quoteData[$quoteID.'_pID'] = $parentObjectID; + if (!empty($fullQuote)) { $this->quotes[$objectType][$objectID][$quoteID] = 1; $this->quoteData[$quoteID.'_fq'] = $fullQuote; -- 2.20.1