V8-archive: Cannot delete items with custom primary key field name

Created on 17 Jun 2019  Â·  5Comments  Â·  Source: directus/v8-archive

Bug Report

Seems to be a similar issue as
https://github.com/directus/api/issues/705
present in version 7.5.0.

I have a managed collection "pages" using custom primary key INT. The field is named "page_id" instead of "id". Deleting items from that collection fails.

Steps to Reproduce

  1. Go to a collection ("pages" in my case)
  2. Select one item
  3. Click Delete
  4. See error

Expected Behavior

The item should be removed from the db and from the interface.

Actual Behavior

An error is displayed and no item is removed.
"Trouble processing request. Try again after refreshing the page."

Same behavior when using JS SDK, error:
"Error deleting a record in pages with id 8":
"id" should be "page_id"...

Technical Details

  • Device: vServer
  • OS: CentOS 7
  • Web Server: Apache
  • PHP Version: 7.3
  • Database: MariaDB
  • Install Method: cloned master branch
bug

Most helpful comment

@phoenixtechnam Agree with you. I am getting the same error. Able to add the primary key with any name but not able to delete it. Trying to resolve that. :)

All 5 comments

@phoenixtechnam — can you confirm that you have page_id set as the primary_key interface?

@bjgajjar — can we confirm that any field name cane be used for the primary key?

@benhaynes : yes it shows as primary key interface in APP and it's also the primary key in SQL

when changing the primary key from "page_id" back to "id" things work as expected !

@phoenixtechnam Agree with you. I am getting the same error. Able to add the primary key with any name but not able to delete it. Trying to resolve that. :)

Fixed in #1042

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cdwmhcc picture cdwmhcc  Â·  3Comments

jwkellyiii picture jwkellyiii  Â·  3Comments

cdwmhcc picture cdwmhcc  Â·  3Comments

cdwmhcc picture cdwmhcc  Â·  3Comments

vuhrmeister picture vuhrmeister  Â·  3Comments