mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°6314 N°1150 Fix cannot reopen or close a UR in the user portal
Since introduction of MultipleChoicesField and SelectObjectField value checks with b71cd218, when a portal user was trying to do an action on a resolved UR the agent_id field was rejected. The reason for the rejection is the corresponding SelectObjectField query is containing the portal user scopes (query generated in ObjectFormManager::Build), and of course the agent_id set isn't in this scope...
As a workaround we are disabling those checks for read only fields (values are set server side and possibly in a different context than the portal user)
This commit is contained in:
@@ -218,14 +218,16 @@ abstract class MultipleChoicesField extends Field
|
||||
$this->SetValid(true);
|
||||
$this->EmptyErrorMessages();
|
||||
|
||||
if (count($this->currentValue) > 0) {
|
||||
foreach ($this->currentValue as $sCode => $value) {
|
||||
if (utils::IsNullOrEmptyString($value)) {
|
||||
continue;
|
||||
}
|
||||
if (false === array_key_exists($value, $this->aChoices)) {
|
||||
$this->SetValid(false);
|
||||
$this->AddErrorMessage("Value ({$value}) is not part of the field possible values list");
|
||||
if ($this->GetReadOnly() === false) {
|
||||
if (count($this->currentValue) > 0) {
|
||||
foreach ($this->currentValue as $sCode => $value) {
|
||||
if (utils::IsNullOrEmptyString($value)) {
|
||||
continue;
|
||||
}
|
||||
if (false === array_key_exists($value, $this->aChoices)) {
|
||||
$this->SetValid(false);
|
||||
$this->AddErrorMessage("Value ({$value}) is not part of the field possible values list");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user