View more context

 

Dave Toews

Can anyone recommend me an up-to-date (SS4) module for a field that manages has_one records? Preferably something where I can edit inline w/o jumping to another edit screen. Looking at a few modules but they all have sparse docs and/or look out of date.

https://github.com/satrun77/silverstripe-hasoneselector https://github.com/silvershop/silverstripe-hasonefield https://github.com/stevie-mayhew/hasoneedit

Show 6 attachment(s)
GitHub  
satrun77/silverstripe-hasoneselector

HasOneSelector is a module that provides CMS field to manage data object defined in a has_one relation. - satrun77/silverstripe-hasoneselector

GitHub  
silvershop/silverstripe-hasonefield

Edit a has_one relationship using the gridfield editor, triggered by clicking a button. - silvershop/silverstripe-hasonefield

GitHub  
stevie-mayhew/hasoneedit

Allows editing the fields of a has_one object directly in the CMS - stevie-mayhew/hasoneedit

GitHub  
silvershop/silverstripe-hasonefield

Edit a has_one relationship using the gridfield editor, triggered by clicking a button. - silvershop/silverstripe-hasonefield

GitHub  
stevie-mayhew/hasoneedit

Allows editing the fields of a has_one object directly in the CMS - stevie-mayhew/hasoneedit

GitHub  
stevie-mayhew/hasoneedit

Allows editing the fields of a has_one object directly in the CMS - stevie-mayhew/hasoneedit

Hide attachment content
Dave Toews

Or maybe I don't need a module, but just a handy pattern for pointing a GridField at a has_one relationship?

null

https://github.com/silvershop/silverstripe-hasonefield is really good, definitely not out of date

null

I haven't found the docs particularly lacking, it's a pretty simple module though it depends how flexible you want it to be

null

If you just want to manage a DataObject and not tweak the JS, it's pretty low-effort to get going

Dave Toews

Good to know. The SS3 screenshot and tags had me wondering how current it is. Thanks.

null

I use it quite a bit, if you get stuck ask away 😄

👍 (1) (1)
clodeindustrie

Hi there, anyone knows if there is a way to do INSERT ON DUPLICATE KEY UPDATE baked in SS? or do I need to do it with SQLUpdate and SQLInsert?

MichalKleiner

hybridsessions module uses raw sql to run that command, e.g.

  1. DB::query($str = sprintf(
  2. 'INSERT INTO "HybridSessionDataObject" ("SessionID", "Expiry", "Data")
  3. VALUES (\'%1$s\', %2$u, \'%3$s\')
  4. ON DUPLICATE KEY UPDATE "Expiry" = %2$u, "Data" = \'%3$s\'',
  5. Convert::raw2sql($session_id),
  6. $expiry,
  7. Convert::raw2sql($session_data)
  8. ));