N°1192 Fix crash with default parameters of the rule

This commit is contained in:
Molkobain
2019-11-25 15:30:51 +01:00
parent 0ee77d8c88
commit 85932eab98
2 changed files with 24 additions and 12 deletions

View File

@@ -22,6 +22,7 @@ namespace Combodo\iTop\Portal\Helper;
use Combodo\iTop\DesignElement;
use Combodo\iTop\Portal\Brick\BrickCollection;
use Combodo\iTop\Portal\Brick\BrowseBrick;
use Combodo\iTop\Portal\Brick\ManageBrick;
use DBObject;
use DBObjectSet;
@@ -454,10 +455,10 @@ class NavigationRuleHelper
*/
protected function LoadGoToManageBrickRuleFromXML(DesignElement $oRuleNode)
{
$sRuleId = $oRuleNode->getAttribute('id');
// Default values
$aRule = $this->GetDefaultGoToBrickRuleDefinition();
$aRule['properties']['route']['id'] = 'p_manage_brick_display_as';
$aRule['properties']['route']['params']['sDisplayMode'] = ManageBrick::DEFAULT_DISPLAY_MODE;
// Rule parameters to automatically map to the route parameters
$aParamsMapping = array(
@@ -489,10 +490,10 @@ class NavigationRuleHelper
*/
protected function LoadGoToBrowseBrickRuleFromXML(DesignElement $oRuleNode)
{
$sRuleId = $oRuleNode->getAttribute('id');
// Default values
$aRule = $this->GetDefaultGoToBrickRuleDefinition();
$aRule['properties']['route']['id'] = 'p_browse_brick_mode';
$aRule['properties']['route']['params']['sBrowseMode'] = BrowseBrick::DEFAULT_BROWSE_MODE;
// Rule parameters to automatically map to the route parameters
$aParamsMapping = array(