From 21197a36da3408da72ec6b2bc8ed487a63c4befc Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Tue, 26 Apr 2022 16:12:26 +0800 Subject: [PATCH] * Fix bug #22016. --- module/api/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/api/model.php b/module/api/model.php index 1105376c21..82fbcf8142 100644 --- a/module/api/model.php +++ b/module/api/model.php @@ -160,16 +160,16 @@ class apiModel extends model */ public function updateStruct($id) { + $old = $this->dao->findByID($id)->from(TABLE_APISTRUCT)->fetch(); + $now = helper::now(); $data = fixer::input('post') ->skipSpecial('attribute') - ->add('lib', $struct->lib) + ->add('lib', $old->lib) ->add('editedBy', $this->app->user->account) ->add('editedDate', $now) ->get(); - $old = $this->dao->findByID($id)->from(TABLE_APISTRUCT)->fetch(); - unset($data->addedBy); unset($data->addedDate);