Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Failing test when upload a file with form-data not properly merge fields arrays names #92

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

diego-sorribas
Copy link

When I send a PUT method with an array and under that same name I upload an image(file) is not merged with the array that I have normal data and same name.

Thanks!

@weierophinney
Copy link
Member

In reviewing the MultipartContentParser functionality, it appears that files are not in the body params data container; instead, when a file is encountered, it is added to the request file container (see line 265 of that class, which reads $this->request->setFiles($files)).

As such, the test needs a change in assumptions: it needs to check and see if the file exists under the equivalent hierarchy within the request's files container.

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas-api-tools/api-tools-content-negotiation; a new issue has been opened at laminas-api-tools/api-tools-content-negotiation#1.

@weierophinney
Copy link
Member

This repository has been moved to laminas-api-tools/api-tools-content-negotiation. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:

  • Squash all commits in your branch (git rebase -i origin/{branch})
  • Make a note of all changed files (`git diff --name-only origin/{branch}...HEAD
  • Run the laminas/laminas-migration tool on the code.
  • Clone laminas-api-tools/api-tools-content-negotiation to another directory.
  • Copy the files from the second bullet point to the clone of laminas-api-tools/api-tools-content-negotiation.
  • In your clone of laminas-api-tools/api-tools-content-negotiation, commit the files, push to your fork, and open the new PR.
    We will be providing tooling via laminas/laminas-migration soon to help automate the process.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants