fixed: create&edit tag no select mode error

This commit is contained in:
xiaomlove
2023-01-07 21:27:53 +08:00
parent 2cef77a7f2
commit 3612edbb5b
3 changed files with 19 additions and 0 deletions

View File

@@ -14,4 +14,12 @@ class CreateTag extends CreateRecord
{
return $this->getResource()::getUrl('index');
}
protected function mutateFormDataBeforeCreate(array $data): array
{
if ($data['mode'] === null) {
$data['mode'] = 0;
}
return $data;
}
}

View File

@@ -22,4 +22,12 @@ class EditTag extends EditRecord
return $this->getResource()::getUrl('index');
}
protected function mutateFormDataBeforeSave(array $data): array
{
if ($data['mode'] === null) {
$data['mode'] = 0;
}
return $data;
}
}

View File

@@ -471,6 +471,9 @@ class UserRepository extends BaseRepository
user_can('user-change-class', true);
$operator = $this->getUser($operator);
$targetUser = $this->getUser($targetUser);
if ($operator && $operator->class <= $targetUser->class) {
throw new InsufficientPermissionException();
}
if ($targetUser->class == $newClass) {
return true;
}