Open longhotsummer opened 3 years ago
I have a hint, please open LiiWebEntityResource.php
and set a breakpoint at line 265:
array_reduce($field_names, function (EntityInterface $destination, $field_name) use ($resource_type, $parsed_entity) {
$this->updateEntityField($resource_type, $parsed_entity, $destination, $field_name);
>>> HERE >>> return $destination;
}, $entity);
And see why validation fails.
Thanks. I have reproduced it already. The issue related to the static::validate function which is based on core/jsonapi module. Now I am working on fixing the validation issue.
Does this issue actual? I have sent a request to http://site_name/jsonapi/node/legislation/field_images endpoint for image uploading. Image uploads correctly(s3://legislation/images/test1.png path in Drupal database). For the second step, I have sent the request to "a legislation node URL" endpoint, and the file has been attached to the node correctly.
Hi Hayk, I'm still seeing this issue in production. Was there a patch created to fix it which we haven't applied?
There wasn't a patch. I've cloned the project from the repo(master branch). I will try to reproduce it on my local again. I have tried with existing files and with new ones. All works correctly. Let me check again.
@Hayk-web any progress? You mentioned above that you were able to reproduce this? Have you been able to try @cristiroma 's suggestion about the breakpoint?
Thanks.
I haven't been able to reproduce the issue yet. Will try one more time.
Info: I am planning to have a look at this task today or tomorrow. I'll come back to you with the results. Thanks.
We associated images (much like PDFs) with a node by uploading the image and then updating the node with a list of all the associated files (both images and PDFs).
We always get an error when updating the node to attach an image to it. We can successfully upload the file and get a node id for the file, but linking it to the node fails.
The error is:
The file is successfully uploaded and exists as a temporary file on the server and in S3:
Note that this occurs whether or not a temporary file with this name already exists on the server.
Steps to reproduce: