Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading files to the field results in undefined binding(s) error #12812

Closed
adrianplavka opened this issue Apr 17, 2022 · 2 comments · Fixed by #12821
Closed

Uploading files to the field results in undefined binding(s) error #12812

adrianplavka opened this issue Apr 17, 2022 · 2 comments · Fixed by #12821
Assignees
Labels

Comments

@adrianplavka
Copy link

adrianplavka commented Apr 17, 2022

Describe the Bug

When creating a new collection with the "Files" input, uploading new files would result in not showing a new item, and trying to create/update the collection item would result in an undefined binding(s) error.

Screenshot 2022-04-17 at 15 54 15

This bug happened to me after updating from version 9.8.0 to 9.9.0. My intention with the upgrade change was to eliminate the duplicate items shown when uploading files to the input. This change would completely disfunction the Upload file functionality in the files input.

Adding existing items from the file library to the file input seem to work just fine though.

To Reproduce

  1. Create a new Directus application with SQLite database.
  2. Create a new collection.
  3. Create a Files field under the new collection.
  4. Create a new collection item, while trying to upload a new file under this file input.
  5. This will not show any thumbnail/item under the input and unable to deselect it. Also, trying to create/update the collection item would result in the error above.

Errors Shown

Error: Undefined binding(s) detected when compiling UPDATE. Undefined column(s): [id] query: update `articles_files` set `articles_id` = ?, `directus_files_id` = ? where `id` in (?) at QueryCompiler_SQLite3.toSQL (/Users/adrianplavka/Development/goodvision/podhajom/backend/node_modules/knex/lib/query/querycompiler.js:110:13) at Builder.toSQL (/Users/adrianplavka/Development/goodvision/podhajom/backend/node_modules/knex/lib/query/querybuilder.js:83:44) at ensureConnectionCallback (/Users/adrianplavka/Development/goodvision/podhajom/backend/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:4:30) at Runner.ensureConnection (/Users/adrianplavka/Development/goodvision/podhajom/backend/node_modules/knex/lib/execution/runner.js:272:20) at async Runner.run (/Users/adrianplavka/Development/goodvision/podhajom/backend/node_modules/knex/lib/execution/runner.js:30:19) at async /Users/adrianplavka/Development/goodvision/podhajom/backend/node_modules/directus/dist/services/items.js:322:21

What version of Directus are you using?

9.9.0

What version of Node.js are you using?

16.13.1

What database are you using?

SQLite 5.0.2

What browser are you using?

Chrome

How are you deploying Directus?

local

@Nitwel
Copy link
Member

Nitwel commented Apr 18, 2022

Thank's for the issue and sorry for the inconvenience!
A quick workaround would be to upload the file first and then select it until the next release.

@adrianplavka
Copy link
Author

@Nitwel Thanks for the quick fix! I will eagerly await the next release.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants