Closed lilHermit closed 8 years ago
On further investigation it is a double save that causes the Exception too.
$menuItemType = TypeRegistry::get('MenuItems'); $menuItem = $menuItemType->find()->firstOrFail(); $menuItem->content = "changed content"; $menuItemType->save($menuItem); $menuItemType->save($menuItem);
The issue does seem to be caused by meta values like id
and _version
in the body of the PUT request
Closing as a pull request is open now.
If I pull a record from ES and edit it all is fine, however if I create a new entity save it, modify it and resave I get "failed to parse". From my debugging I believe https://github.com/cakephp/elastic-search/blob/master/src/Type.php#L473 should read "unset($data['id']);"
working example (fetch and save)
Failing example (new, save and resave)