Open
Description
Preconditions (*)
- Magento 2.3.3
Steps to reproduce (*)
- Login into the admin panel
- Go to Stores - Settings - Configuration.
- Open tab Catalog - Catalog. Fieldset "Product Image Placeholders".
- Select the placeholder image for field "Base"
- Click to button "Save"
You can try another setting with type "file"
Expected result (*)
Error message: Invalid parameter given. A valid $fileId[tmp_name] is expected.
Actual result (*)
- File uploaded and the configuration saved without errors
Issue reason
The reason for this issue is additional validation - function validateFileId
In this function we have check is uploaded file located in "correnct" tmp dicartory.
sys_get_temp_dir() get folder /tmp
$_FILES["file"]["tmp_name"] located in folder /chroot/home/tmp/xxxxxxx
Nexcess support said: "This actually makes sense, because /tmp is a symbolic link to /chroot/home/tmp on our servers."
Possible fixes
- [Correct way] Configure upload_tmp_dir to an allowed folder:
- "var/tmp" (or another based on sys_get_temp_dir() value)
- "<magento_root>/pub/media"
- "<magento_root>/var"
- "<magento_root>/var/tmp"
- "<magento_root>/pub/media/upload"
But it can be not so easy (impossible). For example, we have issue on Nexcess server. Server support responce:
sys_get_temp_dir: /tmp
$_FILES["file"]["tmp_name"]: /chroot/home/tmp/phpPEOxFn
This actually makes sense, because /tmp is a symbolic link to /chroot/home/tmp on our servers.
Metadata
Metadata
Assignees
Labels
Gate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedMay be fixed according to the position in the backlog.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branchAffects non-critical data or functionality and does not force users to employ a workaround.Issue related to Developer Experience and needs help with Triage to Confirm or Reject it