From 812915cc2c8dd03d752540c81f14d56666e9c513 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 9 Jul 2014 21:44:46 +0200 Subject: [PATCH] Get rid of objectTypeID as parameter in edit history --- com.woltlab.wcf/templates/editHistory.tpl | 2 ++ .../files/lib/page/EditHistoryPage.class.php | 19 +++++++------------ 2 files changed, 9 insertions(+), 12 deletions(-) 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 )); } } -- 2.20.1