Portal: Debug mode now logs external keys OQL queries used in forms. Helpful to understand the final query (DM OQL intersect Scope OQL)

SVN:trunk[4743]
This commit is contained in:
Guillaume Lajarige
2017-05-19 08:51:59 +00:00
parent 522108dc69
commit 018d6a98e9
2 changed files with 11 additions and 0 deletions

View File

@@ -50,6 +50,10 @@ $oContex2 = new ContextTag('Portal:' . PORTAL_MODULE_ID);
// Checking if debug param is on
$bDebug = (isset($_REQUEST['debug']) && ($_REQUEST['debug'] === 'true') );
if($bDebug)
{
$oContexDebug = new ContextTag('debug');
}
// Initializing Silex framework
$oKPI = new ExecutionKPI();

View File

@@ -28,6 +28,7 @@ use \UserRights;
use \InlineImage;
use \DBObjectSet;
use \MetaModel;
use \ContextTag;
use \Combodo\iTop\Renderer\FieldRenderer;
use \Combodo\iTop\Renderer\RenderingOutput;
use \Combodo\iTop\Form\Field\SelectObjectField;
@@ -60,6 +61,12 @@ class BsSelectObjectFieldRenderer extends FieldRenderer
// Rendering field in edition mode
if (!$this->oField->GetReadOnly() && !$this->oField->GetHidden())
{
// Debug trace: This is very useful when this kind of field doesn't return the expected values.
if(ContextTag::Check('debug'))
{
IssueLog::Info('Form field #'.$this->oField->GetId().' OQL query: '.$this->oField->GetSearch()->ToOQL(true));
}
// Rendering field
// - Opening container
$oOutput->AddHtml('<div class="form-group form_group_small ' . $sFieldMandatoryClass . '">');