silverstripe-gridfield-betterbuttons icon indicating copy to clipboard operation
silverstripe-gridfield-betterbuttons copied to clipboard

Versioned DataObject save buttons write to wrong tables when reading mode set to ‘live’

Open irkeepin opened this issue 10 years ago • 2 comments

Expected behavior is:

  • “Save Draft” writes to Stage table
  • “Publish” publishes from Stage table to Live table

This behavior is observed when the global variable “reading mode” is set to “Stage.”

But when reading mode is set to Live, the following unexpected behavior occurs:

  • “Save Draft” writes directly to Live table, without changing Stage
  • “Publish” writes directly to Live table, but then publishes Stage onto Live, immediately reversing the change

Other, less predictable unexpected behavior has been observed in “Live” mode, but the above is the most consistent.

Compounding the problem is that it is far from obvious how this “reading mode” switches between Stage and Live, or how to tell which one we are in. This may be a secondary issue residing in the SilverStripe core.

It may be helpful to know that these issues were encountered after implementing Versioned on a pre-existing project (where the original data models were generated without Versioned being turned on). BetterButtons was part of this project from the beginning, however.

irkeepin avatar Feb 13 '15 19:02 irkeepin

I think this was resolved here: https://github.com/unclecheese/silverstripe-gridfield-betterbuttons/commit/b78f3c7449651ba2acefe4000f161e17384fcad3

unclecheese avatar Feb 13 '15 22:02 unclecheese

Thanks for the tip. That certainly looks like the part of the code at issue, but when I implemented that patch, I didn't see any change in behavior.

irkeepin avatar Feb 17 '15 12:02 irkeepin