From 362f7b19d22608a4657ed5feef0865e10d4daa0f Mon Sep 17 00:00:00 2001 From: Exodus4D Date: Sat, 16 Apr 2016 23:22:21 +0200 Subject: [PATCH] closed #81 fixed "signature type" overwriting by "signature reader" update --- app/main/controller/api/signature.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/main/controller/api/signature.php b/app/main/controller/api/signature.php index 623e095b..471695b1 100644 --- a/app/main/controller/api/signature.php +++ b/app/main/controller/api/signature.php @@ -135,8 +135,13 @@ class Signature extends \Controller\AccessController{ // description should not be updated unset( $data['description'] ); + // prevent some data from overwrite manually changes // wormhole typeID can not figured out/saved by the sig reader dialog - if($data['groupId'] == 5){ + // -> type could not be identified -> do not overwrite them (e.g. sig update) + if( + $data['groupId'] == 5 || + $data['typeId'] == 0 + ){ unset( $data['typeId'] ); } @@ -155,6 +160,9 @@ class Signature extends \Controller\AccessController{ // get a fresh signature object with the new data. This is a bad work around! // but i could not figure out what the problem was when using the signature model, saved above :( // -> some caching problems + /** + * @var $newSignature Model\SystemSignatureModel + */ $newSignature = Model\BasicModel::getNew('SystemSignatureModel'); $newSignature->getById( $signature->id, 0);