View more context



and yes I'm aware of isChanged and getChangedFields but I need some additional information


and also I need to update that instance in order to check if it's changed

  1. if (isset($searchParams['DraftOnly'])) {
  2. // get draft only records
  3. $stage = Versioned::get_by_stage(Items::class, Versioned::DRAFT)->column('ID');
  4. $live = Versioned::get_by_stage(Items::class, Versioned::LIVE)->column('ID');
  6. $ids = array_diff($stage, $live);
  7. if (empty($ids)) {
  8. $query->filter('ID', 0);
  9. } else {
  10. $query->filter('ID', $ids);
  11. }
  12. }

Guys I am having a final issue with my search problem. These DataObject (Items) has over 200,000 results and I am trying to fetch just the draft versions but this is proving to timeout. Is there a better solution to getting just the Draft items?

Conan in #cms4 2019-11-29 11:19:24 (edited) (deleted)

You could also first just query the $liveIds and then exclude the IDs.

  1. $stage = Versioned::get_by_stage(Items::class, Versioned::DRAFT)->exlude('ID', $liveIds); // <- check that $liveIds is not empty, SS4 does not filter on empty sets.

my desperate reach for input: can anyone help me with this question?

Show 1 attachment(s)
Stack Overflow  
Silverstripe - FormSchema with submissions and validation

I'm trying to make use of the new FormSchema class in Silverstripe 4 but I'm having a tough time with the workflow for submitting the form. I've been able to return the schema and state, but when

Hide attachment content

maybe it’s a bug, Chris… I never used this feature, so can’t reliably help

Aaron Cooper

Someone remind me. Coffee machine is broken and my google fu is failing me first thing monday:

Aaron Cooper

There was a module that packaged up assets and db (I think) from one environment for importing into another. What was it's name?