Skip to content

Commit 12a66de

Browse files
cedric-annebtry
authored andcommitted
Fix all dropdowns
1 parent 3f36ae8 commit 12a66de

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

inc/field/actorfield.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function getRenderedHtml($domain, $canEdit = true): string {
128128
'display_emptychoice' => false,
129129
'values' => array_keys($value),
130130
'valuesnames' => array_values($value),
131-
'_idor_token' => Session::getNewIDORToken(User::getType()),
131+
'_idor_token' => Session::getNewIDORToken(User::getType(), ['entity_restrict' => -1]),
132132
];
133133
$html .= \PluginFormcreatorCommon::jsAjaxDropdown(
134134
$fieldName . '[]',

inc/field/dropdownfield.class.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,15 @@ public function getRenderedHtml($domain, $canEdit = true): string {
383383
$dparams = [];
384384
$dparams = $this->buildParams($rand);
385385
$dparams['display'] = false;
386-
$dparams['_idor_token'] = Session::getNewIDORToken($itemtype);
386+
387+
$idor_params = [];
388+
foreach (['condition', 'displaywith', 'entity_restrict', 'right'] as $sensitive_param) {
389+
if (array_key_exists($sensitive_param, $dparams)) {
390+
$idor_params[$sensitive_param] = $dparams[$sensitive_param];
391+
}
392+
}
393+
$dparams['_idor_token'] = Session::getNewIDORToken($itemtype, $idor_params);
394+
387395
$html .= $itemtype::dropdown($dparams);
388396
$html .= PHP_EOL;
389397
$html .= Html::scriptBlock("$(function() {

0 commit comments

Comments
 (0)