Record must exist before relations can be set.

Excuse my grammatical errors ... I do not speak English.
Any attempt to save changes in items generates the following error and not saved:
"Record must exist before relations can be set".
Please, I do not correct this mistake and I appreciate that help me.


What version of Omeka are you running? Are you using any plugins? If so, does the error still appear if you disable those plugins?

I'm having this problem as well. All of the Collections, Items, and Tags show up on the website, but when you go in to edit via the admin interface, you get the "Record must exist before relations can be set" message. I am running .10 and I have disabled the plugins and then re-initialized them.

You can try upgrading your installation to the 1.0 beta that was just released (back up your data first though), then let us know if you still get this error.

I have just begun working with a newly installed copy of the 1.0 beta and am having the same problem.

(Also, I haven't installed any plug-ins.)

Where do you get this error? When adding items?

Enable debugging by setting debug.exceptions = true in your application/config/config.ini file. Let me know if that gives you a more detailed error message, and post the results here. Thanks.

Where would I look for an error message? (I enabled debugging, reproduced the error, and checked application/logs/error.logs.empty but saw nothing there, but I'm not sure that's where I should be looking for an error message.)
Thanks for your help!

I get this error when editing already added items -- like I'll create an item by entering and saving the Dublin Core information and that will work fine, but when I try to then add and save tags, files, or any of the other options, I get the "Record must exist before relations can be set" line at the top of the page.
It appears that despite this message, the added information still gets saved and appears on my site -- except for tags, which will not save.

That's certainly odd. If you have all the correct system requirements and you still get this error, I'm not sure what's going on. It seems like a database issue, but we've been unable to reproduce this on our testing environments.

From what I can tell, the bug on your installation occurs when Omeka tries to insert some data about the item to another table, but it hasn't yet inserted the item itself. Does it work if you add an item wthout tags or files, by itself?

Yes -- I have been writing in the metadate for the item and then saving it, which works fine. It is when I go to edit the item after the initial saving (to add tags, files, or change the metadata) that I get the message.

Thanks for all your help with this!

We just released 1.0 of Omeka, so perhaps you could test to see if you still have this bug in the new version? My guess is that it still exists, but it'd be good to check anyway.

Unfortunately, the bug still exists; I can't edit items once they're added (HTML styling like italics isn't showing up on the item ages either, but that may just be a CSS problem). Upgrading did fix a pagination problem I was having, though!