"Field 'object_id' doesn't have a default value" error when adding new authority record with relationship

Skip to first unread message

Kevin Bowrin

Aug 26, 2021, 11:18:30 AM8/26/21
to AtoM Users

Hello all,

Has anyone else run into a 500 error when creating a new authority record with relationships? We are getting the error "Field 'object_id' doesn't have a default value" in the logs.

This error doesn't happen if you add the relationships after the authority record is saved.


Here's a gif of the bug in action. I'm creating a new authority record, and adding a relationship. The terminal window is tailing the php-fpm error log. 

Kevin Bowrin
Carleton University Library

Kevin Bowrin

Aug 26, 2021, 11:21:26 AM8/26/21
to AtoM Users
We're running version 2.6.4 - 184, PHP 7.2.34, MySQL 8.0.26.

Dan Gillean

Aug 26, 2021, 11:55:51 AM8/26/21
to ICA-AtoM Users
Hi Kevin, 

I think this is just a limitation on how the functionality is currently implemented. AtoM is not creating the new authority first while holding the relationship data in memory and then trying to use the new object ID of the authority to create the relationship. Instead, I think it's trying to create the relationship either first, or at the same time - hence the error, since the object ID of the new authority doesn't yet exist. 

There's a note in the documentation about this in the following section:
You cannot create a new authority record from this dialog by entering a new name. If the second authority record does not exist yet, follow the steps above to create a new authority record and then follow these steps from the new record to create the relationship.

This could likely be improved in the future, but for now I would suggest that you first save the new authority record, and then try to create the relationship. 


Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
he / him

You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/4fb78a29-569c-4ee0-af4d-eed2febf0b12n%40googlegroups.com.

Kevin Bowrin

Aug 26, 2021, 12:03:10 PM8/26/21
to AtoM Users
Got it, thanks Dan.
Reply all
Reply to author
0 new messages