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:
Romain Quetiez
2012-01-19 10:13:36 +00:00
parent 0d6cd529a1
commit fe58f6bd19

View File

@@ -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)
{