Skip to content

Commit

Permalink
0033081: Pre8: Wiki Permission settings "ilRadioOption::__construct()…
Browse files Browse the repository at this point in the history
…: Argument #2 ($a_value) must be of type string…"
  • Loading branch information
smeyer-ilias committed Jun 27, 2022
1 parent ff91e82 commit 77032fa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
14 changes: 7 additions & 7 deletions Services/AccessControl/classes/class.ilObjRoleGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,18 @@ protected function initFormRoleProperties(int $a_mode) : ilPropertyFormGUI

if ($this->obj_ref_id == ROLE_FOLDER_ID) {
$reg = new ilCheckboxInputGUI($this->lng->txt('allow_register'), 'reg');
$reg->setValue((string) 1);
$reg->setValue("1");
#$reg->setInfo($this->lng->txt('rbac_new_acc_reg_info'));
$form->addItem($reg);

$la = new ilCheckboxInputGUI($this->lng->txt('allow_assign_users'), 'la');
$la->setValue((string) 1);
$la->setValue("1");
#$la->setInfo($this->lng->txt('rbac_local_admin_info'));
$form->addItem($la);
}

$pro = new ilCheckboxInputGUI($this->lng->txt('role_protect_permissions'), 'pro');
$pro->setValue((string) 1);
$pro->setValue("1");
#$pro->setInfo($this->lng->txt('role_protext_permission_info'));
$form->addItem($pro);
return $form;
Expand All @@ -301,13 +301,13 @@ protected function loadRoleProperties(ilObjRole $role, ilPropertyFormGUI $form)
{
//Don't set if fields are disabled to prevent html manipulation.
if (!$form->getItemByPostVar('title')->getDisabled()) {
$role->setTitle($form->getInput('title'));
$role->setTitle((string) $form->getInput('title'));
}
if (!$form->getItemByPostVar('desc')->getDisabled()) {
$role->setDescription($form->getInput('desc'));
$role->setDescription((string) $form->getInput('desc'));
}
$role->setAllowRegister($form->getInput('reg'));
$role->toggleAssignUsersStatus($form->getInput('la'));
$role->setAllowRegister((bool) $form->getInput('reg'));
$role->toggleAssignUsersStatus((bool) $form->getInput('la'));
}

/**
Expand Down
2 changes: 2 additions & 0 deletions Services/AccessControl/classes/class.ilRbacReview.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ public function getRoleListByObject(int $a_ref_id, bool $a_templates = false) :
$row["desc"] = $row["description"];
$row["user_id"] = (int) $row["owner"];
$row['obj_id'] = (int) $row['obj_id'];
$row['rol_id'] = (int) $row['rol_id'];
$row['parent'] = (int) $row['parent'];
$role_list[] = $row;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function initPermissionForm() : ilPropertyFormGUI
$cb = new ilCheckboxGroupInputGUI($this->lng->txt($p), $p);
reset($roles);
foreach ($roles as $k => $r) {
$option = new ilCheckboxOption(ilObjRole::_getTranslation($r["title"]), $k);
$option = new ilCheckboxOption(ilObjRole::_getTranslation($r["title"]), (string) $k);
$cb->addOption($option);
}
if (isset($perm_roles[$this->base_permissions_by_op[$p]])) {
Expand Down

0 comments on commit 77032fa

Please sign in to comment.