mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
Fixed bug: could not empty a field
SVN:code[156]
This commit is contained in:
@@ -410,6 +410,10 @@ switch($operation)
|
|||||||
{
|
{
|
||||||
// Non-visible, or read-only attribute, do nothing
|
// Non-visible, or read-only attribute, do nothing
|
||||||
}
|
}
|
||||||
|
else if ($sAttCode == 'finalclass')
|
||||||
|
{
|
||||||
|
// This very specific field is read-only
|
||||||
|
}
|
||||||
else if ($oAttDef->IsLinkSet())
|
else if ($oAttDef->IsLinkSet())
|
||||||
{
|
{
|
||||||
// Link set, the data is a set of link objects, encoded in JSON
|
// Link set, the data is a set of link objects, encoded in JSON
|
||||||
@@ -424,9 +428,9 @@ switch($operation)
|
|||||||
}
|
}
|
||||||
else if (!$oAttDef->IsExternalField())
|
else if (!$oAttDef->IsExternalField())
|
||||||
{
|
{
|
||||||
$aAttributes[$sAttCode] = trim(utils::ReadPostedParam("attr_$sAttCode", ''));
|
$aAttributes[$sAttCode] = trim(utils::ReadPostedParam("attr_$sAttCode", null));
|
||||||
$previousValue = $oObj->Get($sAttCode);
|
$previousValue = $oObj->Get($sAttCode);
|
||||||
if (!empty($aAttributes[$sAttCode]) && ($previousValue != $aAttributes[$sAttCode]))
|
if (!is_null($aAttributes[$sAttCode]) && ($previousValue != $aAttributes[$sAttCode]))
|
||||||
{
|
{
|
||||||
$oObj->Set($sAttCode, $aAttributes[$sAttCode]);
|
$oObj->Set($sAttCode, $aAttributes[$sAttCode]);
|
||||||
$bObjectModified = true;
|
$bObjectModified = true;
|
||||||
|
|||||||
@@ -712,11 +712,15 @@ switch($operation)
|
|||||||
{
|
{
|
||||||
// Non-visible, or read-only attribute, do nothing
|
// Non-visible, or read-only attribute, do nothing
|
||||||
}
|
}
|
||||||
|
else if ($sAttCode == 'finalclass')
|
||||||
|
{
|
||||||
|
// This very specific field is read-only
|
||||||
|
}
|
||||||
else if (!$oAttDef->IsExternalField())
|
else if (!$oAttDef->IsExternalField())
|
||||||
{
|
{
|
||||||
$aAttributes[$sAttCode] = trim(utils::ReadPostedParam("attr_$sAttCode", ''));
|
$aAttributes[$sAttCode] = trim(utils::ReadPostedParam("attr_$sAttCode", null));
|
||||||
$previousValue = $oObj->Get($sAttCode);
|
$previousValue = $oObj->Get($sAttCode);
|
||||||
if (!empty($aAttributes[$sAttCode]) && ($previousValue != $aAttributes[$sAttCode]))
|
if (!is_null($aAttributes[$sAttCode]) && ($previousValue != $aAttributes[$sAttCode]))
|
||||||
{
|
{
|
||||||
$oObj->Set($sAttCode, $aAttributes[$sAttCode]);
|
$oObj->Set($sAttCode, $aAttributes[$sAttCode]);
|
||||||
$bObjectModified = true;
|
$bObjectModified = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user