Can't save to the draft table #7

Closed
MarcusDalgren opened this Issue Feb 27, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@MarcusDalgren

I'm using DataObject as pages together with frontend editing so members of my site can add new dataobject as pages. When I save these objects no matter what I do it always only writes to the Object_Live table and not to the original Object table. This causes issues when trying to view the records in Modeladmin since Modeladmin won't show a record that isn't present in the original table.

I've tried calling writeToStage("Stage") explicitly but that still saves to the live table and not to the orignal table.

@arambalakjian

This comment has been minimized.

Show comment Hide comment
@arambalakjian

arambalakjian Feb 28, 2012

Owner

Hi Marcus,

I think when first writing to the db you need to use the $forceInsert flag like so:

$Post->writeToStage('Stage', true);

At least that is how I do it with Posts on SSbits (although they are SiteTree, it should be the same with any versioned item).

Let me know if that works.

Aram

Owner

arambalakjian commented Feb 28, 2012

Hi Marcus,

I think when first writing to the db you need to use the $forceInsert flag like so:

$Post->writeToStage('Stage', true);

At least that is how I do it with Posts on SSbits (although they are SiteTree, it should be the same with any versioned item).

Let me know if that works.

Aram

@MarcusDalgren

This comment has been minimized.

Show comment Hide comment
@MarcusDalgren

MarcusDalgren Feb 28, 2012

Alright cool I'll set it up again and give it a go.
BTW I extracted all the URL/Link functionality into a decorator. It might not be the greatest fit for your module but it feels like that kind of functionality (making a DataObject linkable) should be attachable to any DataObject you want.

Alright cool I'll set it up again and give it a go.
BTW I extracted all the URL/Link functionality into a decorator. It might not be the greatest fit for your module but it feels like that kind of functionality (making a DataObject linkable) should be attachable to any DataObject you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment