#silverstripe IRC Log

IRC log for 4 January 2017

All timestamps are in UTC.

1: [00:22:13] * filisko quit (Ping timeout: 248 seconds)
2: [00:24:05] * janneklouman-- quit (Read error: Connection reset by peer)
3: [00:33:26] * samsam has joined #silverstripe
4: [00:38:06] * muskie9 has joined #silverstripe
5: [00:49:05] * muskie9_ has joined #silverstripe
6: [00:50:32] * muskie9 quit (Ping timeout: 246 seconds)
7: [01:09:06] * DanaeNZ has joined #silverstripe
8: [01:29:00] * shellbackpacifi1 has joined #silverstripe
9: [01:30:08] <shellbackpacifi1> hey all..dependency injection. Trying to get some type-hinting along with dependency injection. Is this possible with what Silverstripe has to offer?
10: [01:30:29] * kerozene quit (Ping timeout: 258 seconds)
11: [01:32:20] <shellbackpacifi1> or is it possible to inject objects into method params. that would do the trick also :)
12: [01:34:00] * steff has joined #silverstripe
13: [01:34:00] <ss-helper> steff: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
14: [01:34:17] * janneklouman-- has joined #silverstripe
15: [01:36:16] <steff> Hi, I'm just learning the ropes of Silverstripe...trying ModelAdmin at the moment and got stuck. I created DataObject 'User' (fields: name, email). Then I created a DataObject 'Client' that extends 'User' which at the moment only has the field 'SortOrder'.
16: [01:36:24] <steff> Now I've also added the GridFieldSortableRows (gridfieldextensions) to the gridfield config. All is working fine UNTIL I change the gridfield order and SS tries to update it.
17: [01:37:06] * kerozene has joined #silverstripe
18: [01:37:20] <steff> It throws me an SQL error failing to update the LastEdited field. This field only exist in the User table but not in the 'Client' table.
19: [01:38:13] <steff> Can I tell SS to use the LastEdited field from the parent (User)? Or don't use it at all?
20: [01:38:15] <Firesphere> Could you share your getCMSFields() method that's on Client?
21: [01:38:19] <Firesphere> sspaste.com
22: [01:38:28] <Firesphere> SilverStripe should handle that for you
23: [01:38:41] <Firesphere> Why are you using User btw? Why not use the Member class?
24: [01:38:50] * janneklouman-- quit (Ping timeout: 246 seconds)
25: [01:39:25] <steff> was just an example
26: [01:39:32] <Firesphere> Ok :)
27: [01:39:42] <steff> has actually nothing to do with Member...
28: [01:39:57] <Firesphere> But if it's the inherited class, it should work fine, as it's a joined query
29: [01:40:29] <steff> That's what I would expect...
30: [01:41:11] <steff> Maybe I made another mistake?
31: [01:41:31] <Firesphere> Most probably. It's usually something stupid in hindsight :P
32: [01:41:36] <Firesphere> Like a typo
33: [01:43:05] <steff> It's only when updating the SortOrder by drag & drop though... adding or deleting 'Clients' works fine
34: [01:44:43] * samsam quit (Quit: samsam)
35: [01:44:58] * samsam has joined #silverstripe
36: [01:48:26] * samsam quit (Client Quit)
37: [01:48:42] * samsam has joined #silverstripe
38: [01:49:45] * samsam has left #silverstripe
39: [01:49:46] <DanaeNZ> steff: in your model admin, is your managed_models User or Client?
40: [01:50:52] * janneklouman-- has joined #silverstripe
41: [01:55:17] * janneklouman-- quit (Ping timeout: 246 seconds)
42: [02:37:57] * steff quit (Quit: Page closed)
43: [03:10:03] * samsamek has joined #silverstripe
44: [03:18:54] <samsamek> Anyone know how to hook an entwine action to the ‘save’ button in gridfield edit view?
45: [03:19:22] <samsamek> $('button[type="submit"]').entwine({
46: [03:19:22] <samsamek> onclick: someFunction
47: [03:19:23] <samsamek> });
48: [03:19:33] <samsamek> that doesn’t seem to do the trick
49: [03:52:08] * janneklouman-- has joined #silverstripe
50: [03:56:38] * janneklouman-- quit (Ping timeout: 248 seconds)
51: [04:05:21] * samsamek has left #silverstripe
52: [04:10:27] * shellbackpacifi1 has left #silverstripe
53: [04:15:08] <ss-helper> SilverStripe / Entwine hooking action to save-button - http://stackoverflow.com/questions/41456016/silverstripe-entwine-hooking-action-to-save-button
54: [04:15:59] * DanaeNZ quit (Remote host closed the connection)
55: [04:53:53] * janneklouman-- has joined #silverstripe
56: [04:58:54] * janneklouman-- quit (Ping timeout: 272 seconds)
57: [05:12:25] * isaac_ quit (Ping timeout: 260 seconds)
58: [05:45:56] * muskie9_ quit (Quit: Textual IRC Client: www.textualapp.com)
59: [06:35:24] * janneklouman-- has joined #silverstripe
60: [06:40:10] * janneklouman-- quit (Ping timeout: 245 seconds)
61: [06:48:17] * wmk has joined #silverstripe
62: [07:09:10] * wmk quit (Ping timeout: 248 seconds)
63: [07:36:38] * janneklouman-- has joined #silverstripe
64: [07:41:09] * janneklouman-- quit (Ping timeout: 248 seconds)
65: [07:43:19] * Eliseth has joined #silverstripe
66: [08:07:55] * wmk has joined #silverstripe
67: [08:57:01] * kinglozzer has joined #silverstripe
68: [09:05:54] * janneklouman-- has joined #silverstripe
69: [09:13:19] <Eliseth> Morning! I'm using silverstripe translatable. How do I keep many_many and many_many_extrafields relations when creating a translated page?
70: [09:23:38] * agent44 has joined #silverstripe
71: [09:23:43] * agent44 quit (Client Quit)
72: [09:24:59] * agent44 has joined #silverstripe
73: [09:54:05] * DarjusIT has joined #silverstripe
74: [09:54:18] <DarjusIT> Hi all
75: [09:55:29] <DarjusIT> if I want to add uploadfield to frontend and it to have style and functionality like in CRM what css, js files I must to add to view?
76: [10:11:06] * micmania1 has joined #silverstripe
77: [10:43:19] * agent44 quit (Quit: zzz)
78: [10:43:39] * agent44 has joined #silverstripe
79: [10:55:43] <DarjusIT> any alive? :D or still celebrating? :D
80: [11:05:44] <Firesphere> I'm alive
81: [11:05:51] <Firesphere> busy talking on the slack channel :P
82: [11:06:08] <Firesphere> But as to your question....
83: [11:06:18] <Firesphere> fastest answer would be: "look at uploadfield class" :P
84: [11:13:40] <DarjusIT> Firesphere, yes but where is lots of js all needed? :)
85: [11:14:22] <Firesphere> I wouldn't know. Rough guess ;)
86: [11:14:41] <DarjusIT> Firesphere, thx :)
87: [11:14:51] <Firesphere> Yeah, not really helpful huh? :D
88: [11:15:03] <Firesphere> Sorry, it's midnight, I'm tired and such too
89: [11:15:07] <DarjusIT> I will sort it out :D
90: [11:15:24] <DarjusIT> in lithuania is 1:15PM :D
91: [11:22:37] * wmk quit (Ping timeout: 246 seconds)
92: [11:57:10] * r5v3rb has joined #silverstripe
93: [11:57:17] <r5v3rb> morning
94: [11:57:29] <r5v3rb> hows the ported PHP going kinglozzer ;)
95: [11:57:47] <kinglozzer> Morning r5v3rb
96: [11:57:55] <kinglozzer> Pretty good, except I have no sites that work on PHP 7 :D
97: [11:58:08] <kinglozzer> Just development versions of SS4 :P
98: [11:58:41] <kinglozzer> I've added wmk's PHP 7 patch to a site just to try it out, works well, shaved around 40% off response times
99: [11:59:50] <r5v3rb> not bad at all
100: [12:00:00] <r5v3rb> i might need to look at that ;)
101: [12:02:09] <r5v3rb> why are addresses and storing them such a pain in the ass for custom forms - I have two sets of pages where a ‘stored’ session address can be utilised so I want to call a function to return the data as a json string then parse through each field and update its value accordingly - grrr but the jquery .get isn’t calling the SS function but does for every other function where used!
102: [12:23:12] <r5v3rb> last bit and its a foooker
103: [12:23:38] <r5v3rb> I hate you address combinations and postage calculations!
104: [12:25:09] <r5v3rb> alternatively should I pick up a yotaphone2 for just £80
105: [12:25:57] <r5v3rb> courtesy of eink screen battery life is awesome!
106: [12:30:17] <ss-helper> SilverStripe: how do I make a field conditionally required (or the form unsubmittable)? - http://stackoverflow.com/questions/23578705/silverstripe-how-do-i-make-a-field-conditionally-required-or-the-form-unsubmit
107: [12:31:00] * NETim has joined #silverstripe
108: [12:32:05] <NETim> Morning. Trying to extend the gridfield add new button with a class dropdown. How can I get the parent oject ID (not SiteTree) in getHTMLFragments?
109: [12:33:21] <kinglozzer> NETim: https://github.com/silverstripe-australia/silverstripe-gridfieldextensions/blob/master/docs/en/index.md#multi-class-adding ?
110: [12:34:27] <NETim> I'm thinking I should have asked sooner now...
111: [12:36:17] <kinglozzer> :D
112: [12:36:35] <NETim> kinglozzer, don't suppose you know offhand how to set the classes it shows to autopopulate classes that extend a given class?
113: [12:36:54] <kinglozzer> Yep, one sec
114: [12:37:39] <NETim> Would it be as straight forward as casting them to an array and looping through them
115: [12:37:40] <NETim> ?
116: [12:37:54] <NETim> or is there some SilverStripe magic?
117: [12:38:38] <kinglozzer> https://gist.github.com/kinglozzer/17a4bd45a4975fdcfdff4517352cef43
118: [12:39:10] <NETim> ah, array_values($classes) almost what I was thinking.
119: [12:42:58] <NETim> Thanks.
120: [12:49:30] * filisko has joined #silverstripe
121: [13:00:20] * DanaeNZ has joined #silverstripe
122: [13:02:03] * Sentro has joined #silverstripe
123: [13:02:39] * wmk has joined #silverstripe
124: [13:05:55] * micmania1 quit (Quit: micmania1)
125: [13:10:48] <r5v3rb> i feel like a ‘tool’
126: [13:10:52] * Sentro quit (Quit: Sentro)
127: [13:10:53] <r5v3rb> arggggghhhhhhhhh
128: [13:11:14] <r5v3rb> do not return data to ajax always echo results!!!!! dang nabbit!
129: [13:20:47] * samsam has joined #silverstripe
130: [13:22:08] * UndefinedOffset has joined #silverstripe
131: [13:35:28] * Eliseth quit (Read error: Connection reset by peer)
132: [14:06:17] * samsam quit (Quit: samsam)
133: [14:39:35] <r5v3rb> any1 here?
134: [14:48:58] <kinglozzer> Sorta
135: [15:10:45] * UndefinedOffset1 has joined #silverstripe
136: [15:10:49] * UndefinedOffset quit (Disconnected by services)
137: [15:10:57] * UndefinedOffset1 is now known as UndefinedOffset
138: [15:23:50] * filisko quit (Read error: Connection reset by peer)
139: [15:26:24] * filisko has joined #silverstripe
140: [15:27:09] * muskie9 has joined #silverstripe
141: [15:34:20] * DanaeNZ quit (Ping timeout: 245 seconds)
142: [15:36:12] * shellbackpacific has joined #silverstripe
143: [15:56:19] * samsam has joined #silverstripe
144: [15:56:57] * samsam has left #silverstripe
145: [15:57:34] * samsamek has joined #silverstripe
146: [16:01:11] <samsamek> Anyone know how to call a controller method from a template WHICH is inside <% include %> WHICH is inside a loop? :/
147: [16:02:22] <kinglozzer> samsamek: $Up.$Up
148: [16:02:24] <kinglozzer> Or $Top
149: [16:02:37] <samsamek> kinglozzer: was just about to say $Top doesn’t work
150: [16:03:00] <kinglozzer> Oh, sorry, missed the include part
151: [16:03:00] <samsamek> I did some tests, it seems that inside a loop indeed $Top.Method works, but when used inside in INCLUDED template which is inside a loop… it doesn't
152: [16:03:03] <samsamek> hehe
153: [16:03:11] <kinglozzer> You'll need to pass it in manually
154: [16:03:23] <samsamek> damn it
155: [16:03:25] <kinglozzer> Like <% include MyTempate Page=$Top, AnotherArgument=$Foo %>
156: [16:03:32] <kinglozzer> Then inside the include use $Page.Something
157: [16:03:32] <samsamek> oh that’s possible?
158: [16:03:40] <samsamek> trying.
159: [16:06:30] <samsamek> kinglozzer: yup, that worked :) cheers
160: [16:06:50] <samsamek> by the way, I actually read your entwine article, helped me out a lot
161: [16:07:17] <kinglozzer> Cool :)
162: [16:11:34] * DarjusIT quit (Ping timeout: 248 seconds)
163: [16:54:46] * wmk quit (Ping timeout: 248 seconds)
164: [17:02:15] * janneklouman-- quit (Ping timeout: 245 seconds)
165: [17:05:04] * janneklouman-- has joined #silverstripe
166: [17:09:42] * janneklouman-- quit (Ping timeout: 248 seconds)
167: [17:12:08] * NETim_ has joined #silverstripe
168: [17:14:20] * NETim quit (Ping timeout: 245 seconds)
169: [17:30:45] <muskie9> anyone ever do $myImage->Fill($x, $y); in php rather than $MyImage.Fill(250, 250) in the template? I'm updating the config to force resampling in case the dimensions match, but still nothing in php
170: [17:31:32] * kinglozzer quit ()
171: [17:38:30] * NETim_ quit (Ping timeout: 245 seconds)
172: [17:40:40] * DarjusIT has joined #silverstripe
173: [17:59:52] * agent44 quit (Quit: zzz)
174: [18:40:22] * filisko quit (Ping timeout: 248 seconds)
175: [18:47:37] <samsamek> Is there a way to access the current controller class in a template?
176: [18:47:53] <samsamek> Like $This
177: [18:55:54] * wmk has joined #silverstripe
178: [18:55:57] * filisko has joined #silverstripe
179: [19:07:24] <muskie9> samsamek you could write a method that returns it... something like public function getCurrentController(){ return Controller::curr(); }
180: [19:07:49] <muskie9> not sure if that will be a string or if there would be additional parsing in that method to determine the class of the controller
181: [19:23:31] * muskie9 quit (Ping timeout: 256 seconds)
182: [19:26:13] * muskie9 has joined #silverstripe
183: [19:26:56] * muskie9 quit (Client Quit)
184: [19:31:47] * DanaeNZ has joined #silverstripe
185: [19:31:48] <r5v3rb> samsamek: I use: function ClassName() { return __CLASS__; } then I just use $ClassName in the template where I need to know what the controller class is. Might not be what you wanted but it might be… who knows
186: [19:36:15] * ss-log____ has joined #silverstripe
187: [19:36:20] * DanaeNZ quit (Ping timeout: 248 seconds)
188: [19:37:25] * wmk quit (Ping timeout: 248 seconds)
189: [19:54:55] * janneklouman-- has joined #silverstripe
190: [19:59:20] * janneklouman-- quit (Ping timeout: 245 seconds)
191: [20:06:07] * r5v3rb quit (Quit: r5v3rb)
192: [20:15:24] <ss-helper> Silverstripe: Template behavior of "Up" - http://stackoverflow.com/questions/41472337/silverstripe-template-behavior-of-up
193: [20:29:08] * micmania1 has joined #silverstripe
194: [20:41:37] * gelignite has joined #silverstripe
195: [20:43:51] <DarjusIT> is it posible on change file input get file by js and give it data to ajax function without using html form tag?
196: [20:49:45] * DanaeNZ has joined #silverstripe
197: [21:30:43] * Audlex has joined #silverstripe
198: [21:57:25] * UndefinedOffset quit (Quit: Leaving.)
199: [22:06:59] * janneklouman-- has joined #silverstripe
200: [22:10:35] * shellbackpacific quit (Ping timeout: 272 seconds)
201: [22:11:39] * janneklouman-- quit (Ping timeout: 248 seconds)
202: [22:27:33] * Audlex quit (Ping timeout: 248 seconds)
203: [22:40:46] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
204: [22:57:56] * micmania1 quit (Quit: micmania1)
205: [23:00:01] * ss-helper quit (Remote host closed the connection)
206: [23:00:17] * ss-helper has joined #silverstripe
207: [23:11:48] * Azure quit (Ping timeout: 248 seconds)
208: [23:12:20] * micmania1 has joined #silverstripe
209: [23:25:22] * Azure has joined #silverstripe
210: [23:46:51] * samsamek quit (Quit: samsamek)
211: [23:49:02] * janneklouman-- has joined #silverstripe
212: [23:57:46] * janneklouman-- quit (Read error: Connection reset by peer)

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