Skip to content

Fix: make /attachments/{attachmentId} endpoint work by adding AttachmentId to EditableAttachment and renaming attachmentIdValue to attachmentId in GetAttachmentForEditing#39966

Closed
Codencode wants to merge 3 commits into
PrestaShop:9.0.xfrom
Codencode:fix/attachment-endpoint-editable-attachment
Closed

Fix: make /attachments/{attachmentId} endpoint work by adding AttachmentId to EditableAttachment and renaming attachmentIdValue to attachmentId in GetAttachmentForEditing#39966
Codencode wants to merge 3 commits into
PrestaShop:9.0.xfrom
Codencode:fix/attachment-endpoint-editable-attachment

Conversation

@Codencode
Copy link
Copy Markdown
Contributor

@Codencode Codencode commented Nov 10, 2025

Add AttachmentId to EditableAttachment and rename attachmentIdValue to attachmentId in GetAttachmentForEditing (fix /attachments/{attachmentId} endpoint)

Questions Answers
Branch? 9.0.x
Description? This PR fixes and extends the handling of attachment entities to support the new /attachments/{attachmentId} API endpoint, currently being developed in PrestaShop/ps_apiresources#105.

🐛 Fixes
- Fixed the /attachments/{attachmentId} endpoint by adding the AttachmentId parameter to EditableAttachment and renaming attachmentIdValueattachmentId in GetAttachmentForEditing.
- Ensures correct mapping and retrieval of attachment data for API serialization/deserialization.

🧱 Refactors
- EditAttachmentCommand: constructor now accepts int $attachmentId instead of an AttachmentId value object, ensuring compatibility with API Platform.
- AddAttachmentCommand and EditAttachmentCommand: added setters setPathName(), setFileSize(), setMimeType(), setOriginalName() to improve flexibility when building commands from uploaded file metadata.
Type? refacto
Category? BO
BC breaks? no
Deprecations? no
How to test?
UI Tests
Fixed issue or discussion?
Related PRs PrestaShop/ps_apiresources#105
Sponsor company Codencode snc

@Codencode Codencode requested a review from a team as a code owner November 10, 2025 15:40
@Codencode Codencode added Refactoring Type: Refactoring 9.0.x Branch labels Nov 10, 2025
@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard Nov 10, 2025
@ps-jarvis
Copy link
Copy Markdown

Hi, thanks for this contribution!

I found some issues with the Pull Request description:

Would you mind having a look at it? This will help us understand how interesting your contribution is, thank you very much!

(Note: this is an automated message, but answering it will reach a real human)

…o attachmentId in GetAttachmentForEditing (fix /attachments/{attachmentId} endpoint)
@Codencode Codencode force-pushed the fix/attachment-endpoint-editable-attachment branch from 0e6971d to 1f270fd Compare November 10, 2025 16:02
@Codencode
Copy link
Copy Markdown
Contributor Author

@tleon @nicosomb @boherm
guys, can any of you give me your opinion on these changes?
Am I on the right track to make the attachments endpoint work (PrestaShop/ps_apiresources#105) or
is there an alternative/better way?

Thanks a lot 🙏

@Codencode Codencode force-pushed the fix/attachment-endpoint-editable-attachment branch from 64bb3fc to 1b73c0e Compare November 11, 2025 12:21
…Name(), setFileSize(). setMimeType(), setOriginalName() methods
@Codencode Codencode force-pushed the fix/attachment-endpoint-editable-attachment branch from 1b73c0e to 4caf945 Compare November 11, 2025 14:12
@Codencode Codencode marked this pull request as ready for review November 12, 2025 07:25
@Progi1984 Progi1984 added the Waiting for author Status: action required, waiting for author feedback label Mar 25, 2026
@ps-jarvis ps-jarvis moved this from Ready for review to Waiting for author in PR Dashboard Mar 25, 2026
@Progi1984
Copy link
Copy Markdown
Member

Hello @Codencode ,

Thank you for your contribution to PrestaShop!

We would like to inform you that PrestaShop 9.1 has been officially released. You can find the full announcement at the following link:
👉 https://build.prestashop-project.org/news/2026/prestashop-9-1-0-available/

Following this release, 9.0.x is no longer the active development branch. To ensure your changes can be reviewed and merged, please rebase this pull request onto the 9.1.x branch.

⚠️ Important: the 9.0.x branch will be permanently deleted on April 6, 2026. Please make sure to rebase before that date.

If you have any questions or need assistance with the rebase process, do not hesitate to ask.

Thank you for your understanding and continued support!

@Progi1984 Progi1984 deleted the branch PrestaShop:9.0.x April 7, 2026 08:15
@Progi1984 Progi1984 closed this Apr 7, 2026
@github-project-automation github-project-automation Bot moved this from Waiting for author to Closed in PR Dashboard Apr 7, 2026
@ps-jarvis ps-jarvis moved this from Closed to Waiting for author in PR Dashboard Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

9.0.x Branch Refactoring Type: Refactoring Waiting for author Status: action required, waiting for author feedback

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants