Bläddra i källkod

Fixed bug with the new locking mecanism: lock not released when applying a stimulus

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3637 a333f486-631f-4898-b8df-5754b55c2be0
romainq 10 år sedan
förälder
incheckning
182c3e090a
1 ändrade filer med 11 tillägg och 0 borttagningar
  1. 11 0
      pages/UI.php

+ 11 - 0
pages/UI.php

@@ -1415,6 +1415,17 @@ EOF
 						$sMessage = Dict::Format('UI:Class_Object_Updated', MetaModel::GetName(get_class($oObj)), $oObj->GetName());
 						$sSeverity = 'ok';
 						utils::RemoveTransaction($sTransactionId);
+						$bLockEnabled = MetaModel::GetConfig()->Get('concurrent_lock_enabled');
+						if ($bLockEnabled)
+						{
+							// Release the concurrent lock, if any
+							$sOwnershipToken = utils::ReadPostedParam('ownership_token', null, false, 'raw_data');
+							if ($sOwnershipToken !== null)
+							{
+								// We're done, let's release the lock
+								iTopOwnershipLock::ReleaseLock(get_class($oObj), $oObj->GetKey(), $sOwnershipToken);
+							}
+						}
 					}
 				}
 				else