Skip to content

Commit

Permalink
Fix all dropdowns
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne authored and btry committed Mar 13, 2024
1 parent 3f36ae8 commit 12a66de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inc/field/actorfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function getRenderedHtml($domain, $canEdit = true): string {
'display_emptychoice' => false,
'values' => array_keys($value),
'valuesnames' => array_values($value),
'_idor_token' => Session::getNewIDORToken(User::getType()),
'_idor_token' => Session::getNewIDORToken(User::getType(), ['entity_restrict' => -1]),
];
$html .= \PluginFormcreatorCommon::jsAjaxDropdown(
$fieldName . '[]',
Expand Down
10 changes: 9 additions & 1 deletion inc/field/dropdownfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,15 @@ public function getRenderedHtml($domain, $canEdit = true): string {
$dparams = [];
$dparams = $this->buildParams($rand);
$dparams['display'] = false;
$dparams['_idor_token'] = Session::getNewIDORToken($itemtype);

$idor_params = [];
foreach (['condition', 'displaywith', 'entity_restrict', 'right'] as $sensitive_param) {
if (array_key_exists($sensitive_param, $dparams)) {
$idor_params[$sensitive_param] = $dparams[$sensitive_param];
}
}
$dparams['_idor_token'] = Session::getNewIDORToken($itemtype, $idor_params);

$html .= $itemtype::dropdown($dparams);
$html .= PHP_EOL;
$html .= Html::scriptBlock("$(function() {
Expand Down

0 comments on commit 12a66de

Please sign in to comment.