I am trying to import nodes from a different domain's REST export view. I am able to get all serialized nodes from the view through Guzzle but once I try to create a node from the hal+json response I get this error:
Type http://drupaltest.dev/rest/type/node/article does not correspond to an entity on this site
This is the code I'm using to create the node:
$data = $request->getBody(); $output = \Drupal::service('serializer')->decode($data, true); $entity = \Drupal::service('serializer')->denormalize($output, Node::class, 'hal_json');
Any ideas how to create the node? Using only json instead hal+json works but does not give me the entity relationships.
Alright, so it seems I needed to replace all references to the source site with the receiving website. But the denormalization step does not create entities referenced by the selected node (I'm most interested references to images). Any suggestions?