From: Tim Düsterhus Date: Wed, 9 Jul 2014 19:44:46 +0000 (+0200) Subject: Get rid of objectTypeID as parameter in edit history X-Git-Tag: 2.1.0_Alpha_1~590^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=812915cc2c8dd03d752540c81f14d56666e9c513;p=GitHub%2FWoltLab%2FWCF.git Get rid of objectTypeID as parameter in edit history --- diff --git a/com.woltlab.wcf/templates/editHistory.tpl b/com.woltlab.wcf/templates/editHistory.tpl index 797ce4132b..cdd73d9607 100644 --- a/com.woltlab.wcf/templates/editHistory.tpl +++ b/com.woltlab.wcf/templates/editHistory.tpl @@ -114,6 +114,8 @@
{@SID_INPUT_TAG} + +
diff --git a/wcfsetup/install/files/lib/page/EditHistoryPage.class.php b/wcfsetup/install/files/lib/page/EditHistoryPage.class.php index 2094ebcda7..8dbd378b30 100644 --- a/wcfsetup/install/files/lib/page/EditHistoryPage.class.php +++ b/wcfsetup/install/files/lib/page/EditHistoryPage.class.php @@ -55,12 +55,6 @@ class EditHistoryPage extends AbstractPage { */ public $diff = null; - /** - * object type id of the requested object - * @var integer - */ - public $objectTypeID = 0; - /** * object type of the requested object * @var \wcf\data\object\type\ObjectType @@ -105,17 +99,16 @@ class EditHistoryPage extends AbstractPage { } $this->objectID = $this->old->objectID; - $this->objectTypeID = $this->old->objectTypeID; + $this->objectType = ObjectTypeCache::getInstance()->getObjectType($this->old->objectTypeID); } - else if (isset($_REQUEST['objectID']) && isset($_REQUEST['objectTypeID'])) { + else if (isset($_REQUEST['objectID']) && isset($_REQUEST['objectType'])) { $this->objectID = intval($_REQUEST['objectID']); - $this->objectTypeID = intval($_REQUEST['objectTypeID']); + $this->objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.edit.historySavingObject', $_REQUEST['objectType']); } else { throw new IllegalLinkException(); } - $this->objectType = ObjectTypeCache::getInstance()->getObjectType($this->objectTypeID); if (!$this->objectType) throw new IllegalLinkException(); $processor = $this->objectType->getProcessor(); $this->object = $processor->getObjectByID($this->objectID); @@ -137,7 +130,7 @@ class EditHistoryPage extends AbstractPage { $this->objectList = new EditHistoryEntryList(); $this->objectList->sqlOrderBy = "time DESC"; - $this->objectList->getConditionBuilder()->add('objectTypeID = ?', array($this->objectTypeID)); + $this->objectList->getConditionBuilder()->add('objectTypeID = ?', array($this->objectType->objectTypeID)); $this->objectList->getConditionBuilder()->add('objectID = ?', array($this->objectID)); $this->objectList->readObjects(); @@ -162,7 +155,9 @@ class EditHistoryPage extends AbstractPage { 'new' => $this->new, 'object' => $this->object, 'diff' => $this->diff, - 'objects' => $this->objectList + 'objects' => $this->objectList, + 'objectID' => $this->objectID, + 'objectType' => $this->objectType )); } }