$response = $modx->runProcessor('resource/getlist');
var_dump($response->isError());public function isError() {
return empty($this->response) || empty($this->response['success']);
}
$response = $modx->runProcessor('resource/getlist');
var_dump(empty($response->response)); // false on 5.4 and 5.3
var_dump(empty($response->response['success'])); // false on 5.3 and true on 5.4 + Warning Illegal string offset 'success'
$response = $modx->runProcessor('resource/getlist');
if ($response instanceof modProcessorResponse) {
if ($response->isError()) {
echo 'Something went wrong: ' . $response->getMessage();
} else {
echo 'All good!';
}
} else {
echo 'This shouldn\'t happen';
}
[ed. note: markh last edited this post 13 years, 8 months ago.]
Is this causing any noticeable bugs as far as you can tell, other than the "false positive" on isError()?
$response = $this->runProcessor('web/thread/get', $data);
if ($response->isError()) {
return $response->getMessage();
}
$data = json_decode($response->response,true);
return (!isset($this->response)) || empty($this->response) || (!isset($this->response['success'])) || empty($this->response['success']);
http://tracker.modx.com/issues/9437Thank you. We'll get this sorted.
if (!isset($response->response)) {
$error = $response->getMessage();
return $error;
}
$responseArray = $response->getResponse();
return $responseArray;
$this->response['success'], and this always returns true.