Log message #4200419

# At Username Text
# Aug 29th 2019, 13:45 neon1024 ...but I’d have to update foreignkeys or duplicate associations
# Aug 29th 2019, 13:45 neon1024 I’m just thinking about hooking beforeSave to duplicate the record, then allow the save. Then swapping the duplicate to live and setting the saved to pending
# Aug 29th 2019, 13:44 admad the one submitting later wouldn't have seen the edit done earlier if it's still pending approval
# Aug 29th 2019, 13:43 admad things get even wackier when multiple people submit an edit
# Aug 29th 2019, 13:40 neon1024 Very true!
# Aug 29th 2019, 13:40 admad on the bright side at least you dont have to implement this where records are translated :P
# Aug 29th 2019, 13:40 steinkel lol, about the confusion, I remember working on a similar case in cake2 using https://github.com/lorenzo/cakephp-logstash
# Aug 29th 2019, 13:40 admad don't remember for sure, check it
# Aug 29th 2019, 13:39 neon1024 Oh really? Okay, thanks :slightly_smiling_face:
# Aug 29th 2019, 13:39 admad right, i think associations are always marked dirty
# Aug 29th 2019, 13:39 neon1024 Like adding a new Tag to a Post
# Aug 29th 2019, 13:39 neon1024 That’s a lot of `if()` statements
# Aug 29th 2019, 13:39 neon1024 Yeah, but across say 3 associations as well?
# Aug 29th 2019, 13:38 admad well if a record is dirty some field has changed
# Aug 29th 2019, 13:38 neon1024 ..but I’d have to detect changes in the entity and it’s associations
# Aug 29th 2019, 13:37 neon1024 Perhaps duplicatable would be better as I could set the status
# Aug 29th 2019, 13:36 neon1024 The specification says that any change generates a new version, which is pending and then gets signed off
# Aug 29th 2019, 13:36 admad i can confirm duplicatable can handle associations :slightly_smiling_face:
# Aug 29th 2019, 13:36 neon1024 Just increment the version and duplicate the whole thing
# Aug 29th 2019, 13:36 neon1024 I thought it would be easier with Duplicatable
# Aug 29th 2019, 13:35 admad they are both José, but the author of that version plugin is savant not lorenzo
# Aug 29th 2019, 13:35 neon1024 Did I? Oh geez, so I did. Apologies José I meant Jose
# Aug 29th 2019, 13:34 admad you got the wrong Jose :slightly_smiling_face:
# Aug 29th 2019, 13:34 neon1024 Any advantages to storing the versions in other tables? Why wouldn’t you just version in the same table?
# Aug 29th 2019, 13:34 lorenzo I'm not @savant
# Aug 29th 2019, 13:33 neon1024 Anyone know if @lorenzo https://github.com/josegonzalez/cakephp-version plugins supports associations? Or if I’d need to hook the event and persist the associations manually
# Aug 29th 2019, 13:29 slackebot2 !awesome
# Aug 29th 2019, 13:29 slackebot2 Command sent from Slack by neon1024:
# Aug 29th 2019, 13:29 neon1024 I need to add versioning to a stack in my application. Does anyone have a plugin for this? To detect changes across all associations and then duplicate with incremented version
# Aug 29th 2019, 13:15 alexdd55976 Authentification with LDAP credentials through the Authentification Component did not work as expected... but a neat workaround helped me getting the result into Authentication Component for further validation :partyparrot:
# Aug 29th 2019, 13:00 dereuromark jep jep, prg etc
# Aug 29th 2019, 12:59 ricksaccous if it doesn't happen successfully they are on the same page but cake magic will allow the errors to show up
# Aug 29th 2019, 12:59 ricksaccous basically i only redirect if the save happens successfully
# Aug 29th 2019, 11:58 dereuromark The redirect is bad if you work with forms, as you lose the inputted data on form validation. Otherwise also redirecting would not be a too big issue if you want to go that way.
# Aug 29th 2019, 11:43 davorminchorov ok an else statement without the redirect fixed the issue I had, thanks for the help!
# Aug 29th 2019, 11:39 davorminchorov Ok so that's the difference compared to how I used to do it in the past projects with Laravel for example, where each action is a different controller method. So should i use an else statement in my case without redirecting?
# Aug 29th 2019, 11:38 alexdd55976 actually its what is generated through bake on forms
# Aug 29th 2019, 11:37 alexdd55976 this is pretty much standard
# Aug 29th 2019, 11:36 davorminchorov Maybe it is because the same action is being used for GET and POST / PUT / DELETE actions
# Aug 29th 2019, 11:34 alexdd55976 this seems kind of pointless to me
# Aug 29th 2019, 11:33 davorminchorov that's why I try to redirect the user to the same page