Fixes fields update

This commit is contained in:
weryques 2018-03-06 11:01:35 -03:00
parent 713e1997f4
commit 0792e6ecef
2 changed files with 6 additions and 10 deletions

View File

@ -393,7 +393,7 @@ class TAINACAN_REST_Fields_Controller extends TAINACAN_REST_Controller {
$field_id = $request['field_id'];
foreach ($body['values'] as $att => $value){
foreach ($body as $att => $value){
$attributes[$att] = $value;
}
@ -445,7 +445,7 @@ class TAINACAN_REST_Fields_Controller extends TAINACAN_REST_Controller {
$field_id = $request['field_id'];
foreach ($body['values'] as $att => $value){
foreach ($body as $att => $value){
$attributes[$att] = $value;
}

View File

@ -280,10 +280,8 @@ class TAINACAN_REST_Metadata_Controller extends TAINACAN_UnitApiTestCase {
#### UPDATE FIELD IN COLLECTION ####
$values = json_encode([
'values' => [
'name' => 'Dia/Mês/Ano',
'description' => 'Continua descrevendo o dado do campo.'
]
'name' => 'Dia/Mês/Ano',
'description' => 'Continua descrevendo o dado do campo.'
]);
$request = new \WP_REST_Request(
@ -387,10 +385,8 @@ class TAINACAN_REST_Metadata_Controller extends TAINACAN_UnitApiTestCase {
);
$new_attributes = json_encode([
'values' => [
'name' => 'No name',
'description' => 'NOP!'
]
'name' => 'No name',
'description' => 'NOP!'
]);
$request = new \WP_REST_Request(