N°5943 - Fix undefined array key "Remote" in AjaxRenderController.php with DokuWiki extension

This commit is contained in:
Molkobain
2023-02-02 16:59:54 +01:00
parent 7cc1e33950
commit 1768274aaf
2 changed files with 26 additions and 2 deletions

View File

@@ -570,6 +570,12 @@ class LogChannels
public const CORE = 'core';
/**
* @var string Everything related to the datatable component
* @since 3.1.0
*/
public const DATATABLE = 'Datatable';
public const DEADLOCK = 'DeadLock';
public const INLINE_IMAGE = 'InlineImage';
@@ -577,11 +583,15 @@ class LogChannels
public const PORTAL = 'portal';
/**
* @var string
* @since 3.1.0 specific channel for event service
* @var string Everything related to the event service
* @since 3.1.0
*/
public const EVENT_SERVICE = 'EventService';
/**
* @var string Everything related to the datamodel CRUD
* @since 3.1.0
*/
public const DM_CRUD = 'DMCRUD';
}

View File

@@ -29,9 +29,11 @@ use ExecutionKPI;
use Expression;
use FieldExpression;
use FunctionExpression;
use IssueLog;
use iTopExtension;
use iTopExtensionsMap;
use JsonPage;
use LogChannels;
use MetaModel;
use ormSet;
use RunTimeEnvironment;
@@ -78,6 +80,18 @@ class AjaxRenderController
$aObj[$sAlias."/_key_"] = $aObject[$sAlias]->GetKey();
$aObj[$sAlias."/_key_/raw"] = $aObject[$sAlias]->GetKey();
$aObj[$sAlias."/hyperlink"] = $aObject[$sAlias]->GetHyperlink();
// N°5943 Protection against $aColumnsLoad having less class aliases than $aClassAliases, this is in case the method's consumer isn't passing data correctly
if (false === array_key_exists($sAlias, $aColumnsLoad)) {
IssueLog::Debug("Datatable: Attribute omitted as it was in \$aClassAliases but not among the loaded attributes (\$aColumnsLoad)", LogChannels::DATATABLE, [
'sClass' => $sClass,
'sAlias' => $sAlias,
'aClassAliases' => $aClassAliases,
'aColumnsLoad' => $aColumnsLoad,
]);
continue;
}
foreach ($aColumnsLoad[$sAlias] as $sAttCode) {
$aObj[$sAlias."/".$sAttCode] = $aObject[$sAlias]->GetAsHTML($sAttCode);
$bExcludeRawValue = false;