Bladeren bron

N.755 Case log preset by object copier is not correcly displayed in the object creation form (if combined with the copy of the previous log AND if that log has at least one entry). Has never worked.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4672 a333f486-631f-4898-b8df-5754b55c2be0
romainq 8 jaren geleden
bovenliggende
commit
231732afdd
1 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 3 2
      core/ormcaselog.class.inc.php

+ 3 - 2
core/ormcaselog.class.inc.php

@@ -388,8 +388,9 @@ class ormCaseLog {
 		if (($bEditMode) && (count($aIndex) > 0) && $this->m_bModified)
 		{
 			// Don't display the first element, that is still considered as editable
-			$iPos = $aIndex[0]['separator_length'] + $aIndex[0]['text_length'];
-			array_shift($aIndex); 
+			$aLastEntry = end($aIndex);
+			$iPos = $aLastEntry['separator_length'] + $aLastEntry['text_length'];
+			array_pop($aIndex);
 		}
 		for($index=count($aIndex)-1 ; $index >= 0 ; $index--)
 		{