Without the param $primary_keys, drupal_write_record() tries to run an INSERT query, which violates integrity constraints when editting an existing pubtype.

Comments

baisong’s picture

Here's a patch that fixes it for me locally, should work.

drupalycious’s picture

Status: Active » Needs review

testing the patch

drupalycious’s picture

I think your patch needs to be renamed because the test bot seems to be ignoring it.
See #1162082: Add a warning if a diff/patch file is selected and issue status is not testable
The name of the patch file should avoid ending with a number. #512962-244: Optimize menu_router_build() / _menu_router_save()

I am uploading your file with a different name to see if it makes any difference.

Status: Needs review » Needs work