API attachment update can result in a Undefined array key "name" error #5073

Closed
opened 2026-02-05 09:38:18 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @ssddanbrown on GitHub (Dec 8, 2024).

Describe the Bug

Performing an API attachment update following the API docs can result in a Undefined array key "name" error.
This is because the name is not required for validation, but assumed to be set in the called service:

b7476a9e7f/app/Uploads/AttachmentService.php (L119)

Steps to Reproduce

  1. Perform API attachment update call without a name parameter.
  2. See 500 error

Expected Behaviour

API call succeeds and no error thrown.

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

v24.10.3

Originally created by @ssddanbrown on GitHub (Dec 8, 2024). ### Describe the Bug Performing an API attachment update following the API docs can result in a `Undefined array key "name"` error. This is because the `name` is not required for validation, but assumed to be set in the called service: https://github.com/BookStackApp/BookStack/blob/b7476a9e7fc27c27342a0a155ab256a93f19981e/app/Uploads/AttachmentService.php#L119 ### Steps to Reproduce 1. Perform API attachment update call without a `name` parameter. 2. See 500 error ### Expected Behaviour API call succeeds and no error thrown. ### Screenshots or Additional Context _No response_ ### Browser Details _No response_ ### Exact BookStack Version v24.10.3
OVERLORD added the 🐛 Bug label 2026-02-05 09:38:18 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5073