#silverstripe IRC Log

IRC log for 18 December 2016

All timestamps are in UTC.

1: [00:09:09] * pweh quit (Ping timeout: 248 seconds)
2: [00:47:05] * samsam has left #silverstripe
3: [00:47:57] * janneklouman-- has joined #silverstripe
4: [00:53:39] * janneklouman-- quit (Ping timeout: 258 seconds)
5: [01:16:29] * gelignite quit (Read error: Connection reset by peer)
6: [01:17:20] * gelignite has joined #silverstripe
7: [01:25:24] * gelignite quit (Ping timeout: 268 seconds)
8: [01:25:25] * pweh has joined #silverstripe
9: [01:26:35] * gelignite has joined #silverstripe
10: [02:05:25] * pweh quit (Ping timeout: 248 seconds)
11: [02:27:31] * kerozene quit (Ping timeout: 256 seconds)
12: [02:36:09] * kerozene has joined #silverstripe
13: [03:25:45] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
14: [03:27:06] * janneklouman-- has joined #silverstripe
15: [03:31:43] * janneklouman-- quit (Ping timeout: 245 seconds)
16: [04:32:07] * pweh has joined #silverstripe
17: [04:48:13] * Audlex quit (Ping timeout: 260 seconds)
18: [04:50:06] * micmania1 has joined #silverstripe
19: [06:33:54] * micmania1 quit (Quit: micmania1)
20: [06:57:26] * Audlex has joined #silverstripe
21: [07:03:30] * Audlex quit ()
22: [07:38:45] * pweh quit (Ping timeout: 248 seconds)
23: [07:40:59] * pweh has joined #silverstripe
24: [09:22:18] * pweh quit (Read error: Connection reset by peer)
25: [09:51:10] * jack has joined #silverstripe
26: [09:51:35] <jack> hi I have a question ss write() function duplicating data two times
27: [09:52:31] <jack> here is the code http://www.sspaste.com/paste/show/58565c52e8dc4
28: [10:15:36] * jack quit (Ping timeout: 260 seconds)
29: [10:32:39] * janneklouman-- has joined #silverstripe
30: [10:37:08] * janneklouman-- quit (Ping timeout: 245 seconds)
31: [10:39:25] * trash__ has joined #silverstripe
32: [10:39:39] <trash__> hi all
33: [10:49:28] * janneklouman-- has joined #silverstripe
34: [10:54:00] * janneklouman-- quit (Ping timeout: 246 seconds)
35: [10:59:38] * janneklouman-- has joined #silverstripe
36: [11:04:11] * janneklouman-- quit (Ping timeout: 250 seconds)
37: [11:14:18] * janneklouman-- has joined #silverstripe
38: [11:16:51] * trash__ quit (Ping timeout: 260 seconds)
39: [11:17:02] * trash__ has joined #silverstripe
40: [11:19:02] * janneklouman-- quit (Ping timeout: 256 seconds)
41: [11:48:04] * Kapdap quit (Ping timeout: 244 seconds)
42: [11:48:12] * Kapdap has joined #silverstripe
43: [12:21:37] * trash___ has joined #silverstripe
44: [12:21:37] <ss-helper> trash___: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
45: [12:22:11] * trash__ quit (Ping timeout: 260 seconds)
46: [12:22:45] * trash___ is now known as trash__
47: [12:36:40] * jack has joined #silverstripe
48: [12:37:10] <jack> Hi, I am having issue in saving record with write() function its saving one record two times
49: [12:37:41] <jack> here is the code http://www.sspaste.com/paste/show/5856830aa4586
50: [12:38:27] <jack> It would be very helpful if you can check what is the reason thanks
51: [13:31:30] <trash__> I do not see any problem here
52: [13:31:50] <trash__> do you know how many times this method EcardSubmit() is called
53: [13:32:02] <trash__> it will be easy to debug it
54: [13:32:28] <trash__> just create onBeforeWrite method and output the stacktrace there
55: [13:34:08] <trash__> jack: ^
56: [13:52:36] <jack> how can I do so?
57: [14:29:01] <trash__> jack: use something like this
58: [14:29:05] <trash__> public function onBeforeWrite() { parent::onBeforeWrite(); // TODO: Change the autogenerated stub echo (new Exception())->getTraceAsString() . "<br><br><br>"; }
59: [14:29:23] <trash__> sorry without the comment
60: [14:29:24] <trash__> public function onBeforeWrite() { parent::onBeforeWrite(); echo (new Exception())->getTraceAsString() . "<br><br><br>"; }
61: [14:29:37] <jack> ok thanks sir
62: [14:30:25] <trash__> if you see 2 stack traces then you can find out who is calling the second write method
63: [14:31:10] <trash__> if it's only one stack trace you will need to put the echo in the DataObject::write() method or in the query execution method
64: [14:31:11] <jack> it showed me two times same bunch of strings
65: [14:31:20] <trash__> yeah
66: [14:31:32] <trash__> could you past them somewhere (not here)
67: [14:31:40] <trash__> use again sspaste
68: [14:31:40] <jack> sure
69: [14:32:07] <jack> I get this http://www.sspaste.com/paste/show/58569dde29929
70: [14:35:38] <trash__> as I can see you are calling this method 2 times in your view
71: [14:35:40] <trash__> EcardSubmission.ss
72: [15:14:00] * gelignite has joined #silverstripe
73: [18:43:29] * Nightjar has joined #silverstripe
74: [18:52:42] * Stomach has joined #silverstripe
75: [18:55:55] <jack> could you point plz here is the code http://www.sspaste.com/paste/show/5856dba04c04f
76: [18:56:15] <Nightjar> .
77: [19:00:23] <Nightjar> You appear to not really be using the framework
78: [19:00:29] <Nightjar> This is causing your issue.
79: [19:01:14] <jack> no I am using ss cms with framework
80: [19:01:45] <Nightjar> Yes, but the code you have written seems to explicitly avoid it. What are you trying to achieve with EcardSubmit?
81: [19:02:53] <Nightjar> hmm, ok so not avoiding the framework, but it just seems like a poor design. If this is a submission, why not use a form?
82: [19:04:02] <Nightjar> You're calling a method twice from within the template (EcardSubmit) which uses the session to get values and send an email. The session values are not cleared, and so the it sends twice.
83: [19:04:44] <Nightjar> You're using the template to call action logic, which seems ... illogical (to me at least).
84: [19:05:03] <Nightjar> every time someone refreshes the page it will send two more emails.
85: [19:06:02] <jack> no I'm clearing the session as well
86: [19:06:06] <Nightjar> I'm not sure what it is that you're trying to achieve, but I'd strongly suggest a refactor.
87: [19:06:30] <jack> where is the issue could you plz point in template
88: [19:06:40] <Nightjar> You're clearing "Message", but you check "MyArrayOfValues" to send the email.
89: [19:07:50] <jack> means I need to check that so that the data can't be saved if this session is expired
90: [19:08:45] <Nightjar> The call to send the second email immediately follows the first, ClearSession is not called in between.
91: [19:09:43] <Nightjar> A form has a security token that times out by default.
92: [19:10:39] <Nightjar> I think you need to look at https://docs.silverstripe.org/en/3/developer_guides/controllers/
93: [19:10:48] <Nightjar> and https://docs.silverstripe.org/en/3/developer_guides/forms/
94: [19:11:04] <Nightjar> To better implement your solution.
95: [19:13:34] <jack> sure thanks
96: [19:14:32] <Nightjar> I think there needs to be a better separation of concerns, calling implementation logic from within the template (as opposed to just display data) is not often going to end well :)
97: [19:14:50] <Nightjar> Good luck!
98: [19:15:03] * Nightjar quit (Quit: Leaving)
99: [19:34:43] * Stomach quit (Quit: zzz)
100: [19:45:26] * Stomach has joined #silverstripe
101: [19:57:54] * Nightjar has joined #silverstripe
102: [20:11:09] * Dig has joined #silverstripe
103: [20:12:01] * micmania1 has joined #silverstripe
104: [20:26:05] * micmania1 quit (Quit: micmania1)
105: [20:31:09] * micmania1 has joined #silverstripe
106: [20:41:26] * lerni has joined #silverstripe
107: [20:43:39] <Nightjar> o/ lerni
108: [20:44:26] * jack quit (Ping timeout: 260 seconds)
109: [20:44:58] <lerni> ciao, ciao Nightjar - are you in NZ?
110: [20:45:46] <Nightjar> I am
111: [20:46:04] <Nightjar> Are you in Switzerland?
112: [20:46:54] <lerni> ya
113: [20:47:06] <Nightjar> How is the shop coming on?
114: [20:48:07] <lerni> thought would be earlier in NZ http://everytimezone.com/
115: [20:48:36] <lerni> I'm not the shop guy - thats roman aka bummzack
116: [20:49:07] <Nightjar> Ah, I forget who is involved :> Most people at the (London) conference seemed to be :P
117: [20:49:52] <lerni> but I *think* its cool and getting stronger
118: [20:49:53] <Nightjar> Did you go to Ljubljana?
119: [20:50:08] <lerni> yes
120: [20:50:37] <Nightjar> Seemed like it was a great time. I was very disappointed I wasn't able to make it!
121: [20:50:37] <lerni> best stripeCon ever :)
122: [20:50:59] <Nightjar> :D
123: [20:51:07] <Nightjar> I'm glad for those that went!
124: [20:51:25] <Nightjar> More and more, turning into a real good conference now :)
125: [20:52:21] * micmania1 quit (Quit: micmania1)
126: [20:53:42] * micmania1 has joined #silverstripe
127: [21:11:19] * micmania1 quit (Quit: micmania1)
128: [21:16:24] * micmania1 has joined #silverstripe
129: [21:26:00] * DanaeNZ has joined #silverstripe
130: [21:43:25] * Stomach quit (Quit: zzz)
131: [21:46:53] * Stomach has joined #silverstripe
132: [22:01:54] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
133: [22:36:35] * spronk has joined #silverstripe
134: [22:37:46] * Stomach quit (Quit: zzz)
135: [23:00:01] * ss-helper quit (Remote host closed the connection)
136: [23:00:16] * ss-helper has joined #silverstripe
137: [23:01:02] * Stomach has joined #silverstripe
138: [23:23:29] * Stomach quit (Quit: zzz)
139: [23:37:06] * trash__ quit (Ping timeout: 260 seconds)
140: [23:43:31] * micmania1 quit (Quit: micmania1)
141: [23:52:50] * Stomach has joined #silverstripe

These logs were automatically created by ss-log on irc.freenode.net.