Bläddra i källkod

Internal: Removed PHP notices in ajax call from autocomplete fields in the console

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4864 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 7 år sedan
förälder
incheckning
b62422d601
2 ändrade filer med 3 tillägg och 3 borttagningar
  1. 2 2
      application/wizardhelper.class.inc.php
  2. 1 1
      pages/ajax.render.php

+ 2 - 2
application/wizardhelper.class.inc.php

@@ -278,12 +278,12 @@ class WizardHelper
 
     public function GetInitialState()
     {
-        return $this->m_aData['m_sInitialState'];
+        return isset($this->m_aData['m_sInitialState']) ? $this->m_aData['m_sInitialState'] : null;
     }
 
     public function GetStimulus()
     {
-        return $this->m_aData['m_sStimulus'];
+        return isset($this->m_aData['m_sStimulus']) ? $this->m_aData['m_sStimulus'] : null;
     }
 	
 	public function GetIdForField($sFieldName)

+ 1 - 1
pages/ajax.render.php

@@ -578,7 +578,7 @@ try
 			$oObj->Set($sAttCode, $defaultValue);
 		}
 		$sFormPrefix = $oWizardHelper->GetFormPrefix();
-		$aExpectedAttributes = $oObj->GetTransitionAttributes($oWizardHelper->GetStimulus(), $oWizardHelper->GetInitialState());
+		$aExpectedAttributes = ($oWizardHelper->GetStimulus() === null) ? array() : $oObj->GetTransitionAttributes($oWizardHelper->GetStimulus(), $oWizardHelper->GetInitialState());
 		foreach($oWizardHelper->GetFieldsForAllowedValues() as $sAttCode)
 		{
 			$sId = $oWizardHelper->GetIdForField($sAttCode);