Skip to content

Fix wrong check of checkRequirement method #16722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions core/model/modx/rest/modrestcontroller.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,9 @@ public function post() {
}

if (!empty($this->postRequiredRelatedObjects)) {
if (!$this->checkRequiredRelatedObjects($this->postRequiredRelatedObjects)) {
return $this->failure();
$result = $this->checkRequiredFields($this->postRequiredFields);
if ($result !== true) {
return $this->failure($result);
}
}

Expand Down Expand Up @@ -650,8 +651,9 @@ public function put() {
}

if (!empty($this->putRequiredRelatedObjects)) {
if (!$this->checkRequiredRelatedObjects($this->putRequiredRelatedObjects)) {
return $this->failure();
$result = $this->checkRequiredFields($this->putRequiredFields);
if ($result !== true) {
return $this->failure($result);
}
}

Expand Down Expand Up @@ -710,8 +712,9 @@ public function delete() {
}

if (!empty($this->deleteRequiredFields)) {
if (!$this->checkRequiredFields($this->deleteRequiredFields)) {
return $this->failure();
$result = $this->checkRequiredFields($this->deleteRequiredFields);
if ($result !== true) {
return $this->failure($result);
}
}

Expand Down
Loading