CakePHP 3.5.2 Released! This is a maintenance release for 3.5 fixing several community reported issues
Read more here…
1 Like
Cakephp 3 has bug with Rest API!
Methods as get, post, delete work ok and receive data in $this->request->data!
But method put and patch don’t work, because request receive empty data!
All data receive in in params as varible “?” ($this->request->params[’?’)]
And I must to write
public function edit($id) {
$data = !empty( $this->request->getData() ) ? $this->request->getData() : $this->request->params['?'];
$payment = $this->Payments->get($id);
if ($this->request->is(['patch', 'post', 'put'])) {
$payment = $this->Payments->patchEntity($payment, $data);
if ($this->Payments->save($payment)) {
$message = 'Saved';
} else {
$message = 'Error';
}
}
$this->set([
'message' => $message,
'_serialize' => ['message']
]);
}
Do anyone how fix this bug?
Sometime I think why I begun to use Cakephp because it has very many bugs!
P.S.
Putin - Huylo!