mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
Fixed regression in the tool to test queries: losing the query when there is a syntax error
SVN:1.2[1788]
This commit is contained in:
@@ -122,10 +122,19 @@ try
|
||||
|
||||
$oFilter = null;
|
||||
$aArgs = array();
|
||||
$sSyntaxError = null;
|
||||
|
||||
if (!empty($sExpression))
|
||||
{
|
||||
$oFilter = DBObjectSearch::FromOQL($sExpression);
|
||||
try
|
||||
{
|
||||
$oFilter = DBObjectSearch::FromOQL($sExpression);
|
||||
}
|
||||
catch(OqlException $e)
|
||||
{
|
||||
$sSyntaxError = $e->getHtmlDesc();
|
||||
}
|
||||
|
||||
if ($oFilter)
|
||||
{
|
||||
$aArgs = array();
|
||||
@@ -143,6 +152,10 @@ try
|
||||
}
|
||||
$oFilter->SetInternalParams($aArgs);
|
||||
}
|
||||
elseif ($sSyntaxError)
|
||||
{
|
||||
// Query arguments taken from the page args
|
||||
}
|
||||
}
|
||||
|
||||
$oP->add("<form method=\"get\">\n");
|
||||
@@ -177,10 +190,10 @@ try
|
||||
$oP->p(Dict::S('UI:RunQuery:SerializedFilter').$oFilter->serialize());
|
||||
$oP->EndCollapsibleSection();
|
||||
}
|
||||
}
|
||||
catch(CoreException $e)
|
||||
{
|
||||
$oP->p('<b>'.Dict::Format('UI:RunQuery:Error', $e->getHtmlDesc()).'</b>');
|
||||
elseif ($sSyntaxError)
|
||||
{
|
||||
$oP->p('<b>'.Dict::Format('UI:RunQuery:Error', $e->getHtmlDesc()).'</b>');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user