From 046f3d7b1d241455a53e5d49aba324f0b4ee97da Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 1 Dec 2011 22:45:25 +0100 Subject: [PATCH] Fixes a possible bug in AbstractDatabaseObjectAction::update() This bug currently occurs if you try to edit the profile inline in the profile itself (Error: "Undefined index: data"). The reason for this bug is that the after saving the input data, the "real" user data isn't updated, only their options which is handled by the UserAction separately (UserAction, line 140), so 'data' doesn't always need to exist. --- .../lib/data/AbstractDatabaseObjectAction.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php b/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php index 5f66ed8412..11c551cbb6 100644 --- a/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php +++ b/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php @@ -213,7 +213,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction { throw new ValidateActionException('Insufficient permissions'); } - // read data + // read objects if (!count($this->objects)) { $this->readObjects(); } @@ -240,7 +240,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction { throw new ValidateActionException('Insufficient permissions'); } - // read data + // read objects if (!count($this->objects)) { $this->readObjects(); } @@ -290,8 +290,10 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction { $this->readObjects(); } - foreach ($this->objects as $object) { - $object->update($this->parameters['data']); + if (isset($this->parameters['data'])) { + foreach ($this->objects as $object) { + $object->update($this->parameters['data']); + } } } -- 2.20.1