Bug Report: Attachment Download Permission Issue
-
Hello,
I enjoy the plugin a lot, very useful! However encountered a bug with attachments.
Here are the details:
Plugin: WP Project Manager by weDevs
Version: 2.6.15
WordPress Version: 6.7
PHP Version: 8.3Description:
A comment with an attachment (PDF or ZIP file) – clicking on the attachment link results in a permission error. The link generated for the attachment points to the WP REST API, which leads to a “You have no permission” error message.Steps to Reproduce:
- Create a new comment in a project with an attachment (PDF or ZIP file).
- After submitting the comment, click on the attached file link.
- Observe that the link redirects to a URL structured like:javascript
https://bla.blah/index.php/wp-json/pm/v2/projects/13/files/163/users/3/download
- The result is a page displaying:javascript
{"code":"errors","message":["You have no permission."],"data":null}
- Editing the comment and while in edit mode clicking the attachment icon works correctly, providing a direct link to the file like
https://blah.blah/wp-content/uploads/2024/11/something.pdf
Expected Behavior:
The attachment link should directly point to the uploaded file’s location (e.g.,?https://blah.blah/wp-content/uploads/...
) instead of generating a link that leads to a permission error.Actual Behavior:
The generated link leads to a REST API endpoint, causing a permission error when users try to download the file.Additional Notes:
- This issue appears to be a bug within the attachment handling of comments.
- The direct link to the file works correctly when accessed through the edit comment functionality.
Thank you for your attention to this matter. I look forward to your response regarding a potential fix.
- You must be logged in to reply to this topic.