#silverstripe IRC Log

IRC log for 13 December 2016

All timestamps are in UTC.

1: [00:05:56] * trash__ quit (Ping timeout: 260 seconds)
2: [00:06:34] * DanaeNZ has joined #silverstripe
3: [00:28:00] * micmania1 quit (Quit: micmania1)
4: [00:28:32] * pippy has joined #silverstripe
5: [00:28:50] * muskie9 has joined #silverstripe
6: [00:36:21] * janneklouman-- has joined #silverstripe
7: [00:40:51] * janneklouman-- quit (Ping timeout: 258 seconds)
8: [00:54:51] <muskie9> anyone ever try ->fieldByName() on a LiteralField? doesn't seem to give me my field when I Debug
9: [01:06:09] <Nightjar> muskie9, LiteralField doesn't have a name, iirc.
10: [01:06:19] <Nightjar> gotta set one explicitly
11: [01:06:28] <Nightjar> (iirc)
12: [01:07:31] <muskie9> shouldn't the constructor go up the chain? all extends FormField
13: [01:09:25] <Nightjar> uhh
14: [01:09:57] <muskie9> FormField -> DatalessField -> LiteralField
15: [01:10:29] <Nightjar> yeah, so idnrc.
16: [01:10:35] <Nightjar> i did not recall correctly :P
17: [01:11:00] <Nightjar> oh yeah, it's compoundfield I was thinking of :>
18: [01:11:13] <Nightjar> err
19: [01:11:13] * micmania1 has joined #silverstripe
20: [01:11:15] <muskie9> I didn't know until I looked ;P first time I've tried getting a Lit field
21: [01:11:15] <Nightjar> CompositeField
22: [01:11:25] <muskie9> yup
23: [01:11:41] <Nightjar> does fieldByName use dataFieldByName?
24: [01:11:52] <Nightjar> I don't think it does, but something might be going wrong
25: [01:12:19] <muskie9> fieldByName doesn't... I tried dataFieldByName first then remembered there was fieldByName
26: [01:12:42] <Nightjar> yeah, they're dataless of course :P
27: [01:13:06] <muskie9> monday hit hard today lol
28: [01:13:49] <Nightjar> Tuesday always harder :<
29: [01:40:07] * samsam quit (Quit: samsam)
30: [01:47:17] * micmania1 quit (Quit: micmania1)
31: [01:59:28] <Audlex> I have a page with the title 'U3' but when performing a search it does not show up in the results. Any ideas why?
32: [02:00:06] <Audlex> Works fine otherwise.
33: [02:02:07] * samsam has joined #silverstripe
34: [02:03:20] * micmania1 has joined #silverstripe
35: [02:07:07] * samsam quit (Quit: samsam)
36: [02:07:36] <Nightjar> Audlex, how are you searching?
37: [02:11:55] <Nightjar> mysql fulltext is remarkably rubbish.
38: [02:12:04] <Nightjar> also, you probably need min 3 chars if that's the case.
39: [02:12:35] <Nightjar> Being that your search is only 2, and adding more will mean it won't match, that's just... yeh.
40: [02:12:36] <Nightjar> iirc
41: [02:13:49] <Audlex> yeah fulltext from memory. 2 chars is ok when searching anything else.
42: [02:14:15] <Nightjar> "fulltext" doesn't describe anything, except search indexes.
43: [02:14:22] <Nightjar> is it the default mysql setup?
44: [02:14:31] <Nightjar> or have you added any search modules?
45: [02:14:31] <Audlex> yes
46: [02:14:37] <Audlex> no, default
47: [02:14:53] <Audlex> would you recommend a search module or another approach?
48: [02:16:07] <Nightjar> solr all the things.
49: [02:16:21] <Nightjar> and hope to hell it 'just works'
50: [02:18:06] <Nightjar> http://addons.silverstripe.org/add-ons/silverstripe/fulltextsearch
51: [02:22:46] <Audlex> I overrode the results function, seemed to work.
52: [02:23:01] <Audlex> probably not the best option, i know.
53: [02:25:27] <Nightjar> eh. If it works...
54: [02:34:44] <Audlex> my thought exactly
55: [02:34:50] <Audlex> once again, your help is always appreciated.
56: [02:36:28] <Nightjar> :)
57: [02:36:35] <Nightjar> o.0
58: [02:36:41] <Nightjar> magic underline!
59: [02:39:58] <Audlex> sleeping smiley face?
60: [02:40:07] <Nightjar> heh, must be.
61: [02:40:12] <Nightjar> Where are you based Audlex ?
62: [02:51:23] <Firesphere> Solr :|
63: [02:51:33] <Firesphere> What are you doing Nightjar
64: [02:52:02] <Nightjar> fixing it
65: [02:52:25] <Firesphere> What, solr?
66: [02:52:47] <Nightjar> nah, just things.
67: [02:52:55] <Nightjar> solr>mysql
68: [02:54:09] <Firesphere> Ehhhh, what?
69: [02:54:16] <Firesphere> You can't compare Solr to SQL
70: [02:54:27] <Firesphere> Those two are two completely different things
71: [02:54:33] <Nightjar> Sure can when we're talking specifically in the context of fulltextsearch
72: [02:54:47] <Firesphere> Ow, in that case, don't care, google it.
73: [02:55:13] <Firesphere> I just went out for lunch, so I got me Fallout 4
74: [02:55:20] <Nightjar> nom nom
75: [02:57:24] * shlinx has joined #silverstripe
76: [03:01:51] <shlinx> Hi, I'm trying some page functional test following the document here: https://docs.silverstripe.org/en/3/developer_guides/testing/how_tos/write_a_functionaltest/. Just simple get home page test. But I get a 404 Status Code, which makes sense because home page hasn't setup in test database. The question is, where can I setup a page for functional testing?
77: [03:03:45] <Nightjar> Write a fixture file :)
78: [03:04:01] <Nightjar> Should also be in the docs, somewhere.
79: [03:04:19] <Nightjar> If not, check out some examples from the cms module's tests
80: [03:04:33] * slievr1 has joined #silverstripe
81: [03:05:27] <shlinx> I wrote one but probably the format is not correct, let me check cms tests
82: [03:05:32] <shlinx> Thanks
83: [03:05:41] * slievr quit (Ping timeout: 248 seconds)
84: [03:07:11] * janneklouman-- has joined #silverstripe
85: [03:11:43] * janneklouman-- quit (Ping timeout: 245 seconds)
86: [03:23:24] * micmania1 quit (Quit: micmania1)
87: [03:23:25] * janneklouman-- has joined #silverstripe
88: [03:27:46] * janneklouman-- quit (Ping timeout: 250 seconds)
89: [03:32:22] * Stomach quit (Quit: zzz)
90: [03:35:21] <shlinx> Oops, need this config: protected static $use_draft_site = true;
91: [03:35:38] <Nightjar> ah, haha. What a trap!
92: [03:36:51] <Audlex> Nightjar: Christchurch
93: [03:36:57] <Audlex> yourself?
94: [03:37:36] <Nightjar> WLG. There's a meet up tonight.
95: [03:37:46] <Nightjar> Apparently you have to RSVP though
96: [03:37:56] <xyphoid> chch fistbump
97: [03:37:58] <Audlex> I have been to a few down here. Not in a while though.
98: [03:50:27] * pweh has joined #silverstripe
99: [03:54:21] * adrexia quit (Quit: My Mac has gone to sleep. ZZZzzz…)
100: [03:57:15] * micmania1 has joined #silverstripe
101: [04:03:16] * muskie9 quit (Ping timeout: 258 seconds)
102: [04:06:21] * muskie9 has joined #silverstripe
103: [04:08:22] <Firesphere> Nightjar, if you tell Vinh you want pizza too, he'll probably get you a veggie pizza
104: [04:08:32] <Firesphere> all for yourself
105: [04:15:53] * muskie9 quit (Quit: Textual IRC Client: www.textualapp.com)
106: [04:16:43] <Firesphere> If you're interested on working for SilverStripe, we are looking for people:
107: [04:16:45] <Firesphere> https://silverstripe.workable.com/jobs/393389
108: [04:21:27] * DanaeNZ quit (Quit: TIME TO FEED)
109: [04:45:04] * micmania1 quit (Quit: micmania1)
110: [05:15:17] * pweh quit (Ping timeout: 240 seconds)
111: [06:02:55] * pweh has joined #silverstripe
112: [06:30:14] * janneklouman-- has joined #silverstripe
113: [06:34:58] * janneklouman-- quit (Ping timeout: 250 seconds)
114: [06:40:50] * muskie9 has joined #silverstripe
115: [06:44:11] * janneklouman-- has joined #silverstripe
116: [06:48:40] * janneklouman-- quit (Ping timeout: 250 seconds)
117: [07:00:30] * muskie9 quit (Read error: Connection reset by peer)
118: [07:04:06] * muskie9 has joined #silverstripe
119: [07:09:12] * janneklouman-- has joined #silverstripe
120: [07:10:01] * pippy quit (Ping timeout: 260 seconds)
121: [07:13:41] * janneklouman-- quit (Ping timeout: 248 seconds)
122: [07:14:00] * wmk has joined #silverstripe
123: [07:17:02] * wmk quit (Client Quit)
124: [07:18:09] * Shrike_Finland has joined #silverstripe
125: [07:34:12] * wmk has joined #silverstripe
126: [07:53:45] * Shrike_Finland quit (Quit: Leaving.)
127: [07:57:02] * darianno has joined #silverstripe
128: [08:05:57] * pweh quit (Ping timeout: 248 seconds)
129: [08:23:12] * muskie9 quit (Read error: Connection reset by peer)
130: [08:29:20] * pweh has joined #silverstripe
131: [08:59:08] * Shrike_Finland has joined #silverstripe
132: [09:03:51] * kinglozzer has joined #silverstripe
133: [09:11:33] * janneklouman-- has joined #silverstripe
134: [09:16:27] * janneklouman-- quit (Ping timeout: 258 seconds)
135: [09:27:24] * janneklouman-- has joined #silverstripe
136: [09:38:25] * agent44 has joined #silverstripe
137: [09:54:13] * pweh quit (Ping timeout: 248 seconds)
138: [09:56:21] * janneklouman-- quit (Ping timeout: 248 seconds)
139: [09:59:17] * janneklouman-- has joined #silverstripe
140: [10:02:23] * pweh has joined #silverstripe
141: [10:11:24] * pweh quit (Read error: Connection reset by peer)
142: [10:46:56] * samsam has joined #silverstripe
143: [11:11:54] * Audlex- has joined #silverstripe
144: [11:13:57] * Audlex quit (Ping timeout: 260 seconds)
145: [11:31:08] * zippy has joined #silverstripe
146: [11:31:09] <zippy> Hi
147: [11:41:15] * Shrike_Finland quit (Quit: Leaving.)
148: [12:12:35] * Shrike_Finland has joined #silverstripe
149: [12:19:47] * zippy quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
150: [12:22:44] * SH__ has joined #silverstripe
151: [12:30:24] * Shrike_Finland1 has joined #silverstripe
152: [12:30:24] * Shrike_Finland quit (Read error: Connection reset by peer)
153: [12:41:50] * giovdk has joined #silverstripe
154: [12:43:42] <giovdk> Hello, if I have a page with an has_one relation, does the CMS support the editing of the relation from within the page? I want some extra bit of information to be saved separately / independently (i.e. the LastEdited value of the page shouldn't change)
155: [12:44:24] <Snowman23> From memory it does, if you just use getCMSFields or updateCMSFields to shim it in there
156: [12:44:41] <Snowman23> But I'm not sure if it'll trigger a write() to the original DO at the same time (honestly it's been a while, I can't remember)
157: [12:46:13] <SH__> Hey guys I am trying to use silverstripe-australia/datachange-tracker to track when some fields are changed on a page. I just cant seem to figure out if this functionality (to check if specific fields are changed) is build in? It seems like the "Before" field on DataChangeRecord should be used, but it is just always null
158: [12:48:48] <giovdk> hi Snowman23, thanks. I also found this one: https://github.com/burnbright/silverstripe-hasonefield but I'd like something simpler
159: [13:24:56] * UndefinedOffset has joined #silverstripe
160: [13:35:56] * DimiStripe quit (Quit: DimiStripe)
161: [13:38:59] * DimiStripe has joined #silverstripe
162: [14:13:36] * Shrike_Finland1 quit (Quit: Leaving.)
163: [14:19:48] * agent44 quit (Ping timeout: 252 seconds)
164: [14:20:37] * agent44 has joined #silverstripe
165: [14:37:12] * DarjusIT has joined #silverstripe
166: [14:37:58] * DarjusIT quit (Client Quit)
167: [14:38:29] * DarjusIT has joined #silverstripe
168: [14:39:24] <DarjusIT> Hi all in ss 2.4 how to set up required="required", all have look in docs but no setAttribute function :/
169: [14:39:25] <DarjusIT> ?
170: [15:01:10] <wmk> well, 2.4 is html4 only ;)
171: [15:01:15] <wmk> kidding ;)
172: [15:01:21] * SH__ quit (Ping timeout: 260 seconds)
173: [15:03:56] <wmk> DarjusIT, i guess you have to implement this functionality in 2.4.
174: [15:24:46] * muskie9 has joined #silverstripe
175: [15:56:23] * samsam quit (Quit: samsam)
176: [15:59:01] * wmk quit (Ping timeout: 268 seconds)
177: [16:12:47] * samsam has joined #silverstripe
178: [16:41:50] * wmk has joined #silverstripe
179: [16:48:44] <samsam> $image->resizeRatio(x,x) still working in 3.5 ? :/
180: [16:49:54] * agent44 quit (Ping timeout: 256 seconds)
181: [16:50:42] * agent44 has joined #silverstripe
182: [16:51:45] * giovdk quit (Quit: Page closed)
183: [16:53:11] * muskie9 quit (Ping timeout: 250 seconds)
184: [16:53:26] <kinglozzer> samsam: Do you mean ->SetRatioSize()?
185: [16:53:32] <samsam> Yup, just found it lolz
186: [17:14:03] * kinglozzer quit ()
187: [17:15:39] * Shrike_Finland has joined #silverstripe
188: [17:20:03] * Shrike_Finland quit (Ping timeout: 245 seconds)
189: [17:30:21] * janneklouman-- quit (Ping timeout: 246 seconds)
190: [17:57:26] * agent44 quit (Quit: zzz)
191: [18:18:20] * gelignite has joined #silverstripe
192: [18:35:00] * darianno quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
193: [18:35:15] * samsam quit (Quit: samsam)
194: [18:39:52] * slievr has joined #silverstripe
195: [18:41:04] * slievr1 quit (Ping timeout: 265 seconds)
196: [18:49:18] * Stomach has joined #silverstripe
197: [18:56:40] <Nightjar> DarjusIT, why 2.4!? :o
198: [18:57:02] <DarjusIT> old client website
199: [18:57:37] <Nightjar> ha, well... I think there _might_ be a setAttribute function. Otherwise you're pretty much out of luck.
200: [18:58:13] <DarjusIT> out of luck made js validation
201: [18:58:20] <DarjusIT> :)
202: [18:58:20] <Nightjar> Unless you manually build your form in the template ( <% control Form %><form ...><% control Fields %> ...
203: [18:58:44] <Nightjar> but, that kinda defeats the point ;P
204: [18:58:54] <DarjusIT> yep
205: [18:59:07] <Nightjar> Unfortunately 2.4 did not use templates to render fields out :(
206: [18:59:54] <Nightjar> Well, in parts. But not enough control to add random attributes iirc
207: [19:16:52] * samsam has joined #silverstripe
208: [19:17:01] * lerni has joined #silverstripe
209: [20:09:01] * DarjusIT quit (Read error: Connection reset by peer)
210: [20:09:51] * janneklouman-- has joined #silverstripe
211: [20:21:45] * DanaeNZ has joined #silverstripe
212: [20:34:48] * micmania1 has joined #silverstripe
213: [20:36:38] * UndefinedOffset quit (Quit: Leaving.)
214: [20:40:41] * Stomach quit (Ping timeout: 250 seconds)
215: [20:41:53] * zippy has joined #silverstripe
216: [20:42:47] * Stomach has joined #silverstripe
217: [20:48:42] * zippy quit (Read error: Connection reset by peer)
218: [20:59:03] * zippy has joined #silverstripe
219: [21:10:09] * micmania1 quit (Quit: micmania1)
220: [21:14:23] * micmania1 has joined #silverstripe
221: [21:17:06] * UndefinedOffset has joined #silverstripe
222: [21:17:49] * Tron__ has joined #silverstripe
223: [21:18:52] * Stomach quit (Quit: zzz)
224: [21:19:49] * Stomach has joined #silverstripe
225: [21:19:57] * neomang has joined #silverstripe
226: [21:29:20] <neomang> I'm getting the error "the method 'fortemplate' does not exist on 'ArrayData'" when i try to call a function in my template. The data is being retrieved properly, put in an arraydata then put in an arraylist but I can't then use the fields from the arraydata to loop over information in the template
227: [21:29:32] <neomang> is there another way I should be approaching this issue?
228: [21:35:28] * UndefinedOffset quit (Quit: Leaving.)
229: [21:39:04] * wmk quit (Ping timeout: 252 seconds)
230: [21:42:19] * lerni quit (Quit: Connection closed for inactivity)
231: [21:42:54] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
232: [21:43:57] * janneklouman-- quit (Ping timeout: 240 seconds)
233: [21:51:50] * micmania1 quit (Quit: micmania1)
234: [22:01:28] * trash__ has joined #silverstripe
235: [22:07:57] * micmania1 has joined #silverstripe
236: [22:13:05] * shlinx quit (Quit: Page closed)
237: [22:24:00] <zippy> !paste neomang
238: [22:24:01] <ss-helper> neomang: Please paste your code using something like http://kopy.io/ or http://www.sspaste.com/ or https://gist.github.com/ and then paste the link here.
239: [22:28:01] <neomang> http://www.sspaste.com/paste/show/585075e9abc3d
240: [22:44:00] * janneklouman-- has joined #silverstripe
241: [22:51:05] <neomang> zippy, any ideas?
242: [22:53:45] <zippy> neomang: interesting, do $Me.Channel
243: [22:54:07] <zippy> but then, m
244: [22:55:28] * Audlex has joined #silverstripe
245: [22:55:44] * Audlex quit (Changing host)
246: [22:55:44] * Audlex has joined #silverstripe
247: [22:56:45] <samsam> Hmm, when using $SomeHTMLField.Summary in the template it returns a non-html part of the content. But it doesn’t parse linebreaks so new lines are just attached to the previous line
248: [22:57:14] <samsam> anyone know a fix for this? or should I just write my own “summary” function that respects linebreaks and replaces them with a whitespaces
249: [22:58:03] * Audlex- quit (Ping timeout: 250 seconds)
250: [23:00:02] * ss-helper quit (Remote host closed the connection)
251: [23:00:15] * ss-helper has joined #silverstripe
252: [23:08:20] <Firesphere> Yeah, Summary strips out tags to not accidentally end with half a tag
253: [23:10:42] <Nightjar> samsam, yeh, nl2br($that->Summary)
254: [23:10:58] <Nightjar> OR
255: [23:11:03] <trash__> neomang: try wtih strval
256: [23:11:11] <Nightjar> white-space: pre; (or similar)
257: [23:11:15] <trash__> because you will have xml elements
258: [23:11:21] <Nightjar> Which I usually find... better.
259: [23:12:14] <neomang> trash__ i'll worry about filtering out those elements once I can get it to display anything at all but thanks for the tip, I hadn't considered that
260: [23:12:33] <samsam> thanks guys, I used this custom function: http://www.sspaste.com/paste/show/585080535a132
261: [23:12:50] <trash__> after I put strval the error gone
262: [23:12:58] <trash__> *I have put
263: [23:13:19] <Nightjar> neomang, I think you might be misinterpreting what $item->thing returns.
264: [23:13:25] <Nightjar> ie, not strings.
265: [23:13:51] <Nightjar> since they're objects, they're cast to ArrayData, which in turn does not have a forTemplate method.
266: [23:14:24] <trash__> also you will need to change $Channel-Link to $Channel_Link or something like this
267: [23:15:10] <Nightjar> Try $Channel.__toString
268: [23:15:56] <neomang> that worked! okay thanks for the explanation Nightjar, I knew it would get some xml but it should have output it as a string, I didn't know it would perform that cast
269: [23:16:25] <Nightjar> Yeah, your presumption is wrong ;) http://php.net/manual/en/class.simplexmlelement.php
270: [23:16:58] <Nightjar> it will implicitly be cast to a string in PHP, iff attempted to be used as one.
271: [23:17:33] <Nightjar> In the case of templates, it checks type, rather than $string = $string . $value
272: [23:17:50] <trash__> isn't it better to use strval when you are creating the ArrayData instead of $Channel.__toString in the template?
273: [23:18:02] <neomang> i did use strval
274: [23:18:12] <Nightjar> is there a strval? I just skimmed the docs :>
275: [23:18:23] <trash__> yes there is
276: [23:18:34] <trash__> http://bg2.php.net/manual/en/function.strval.php
277: [23:18:44] <Nightjar> oh, in the php, gotcha.
278: [23:18:49] <Nightjar> duh :>
279: [23:19:48] <Nightjar> if you run into escaping issues (title has a '>' in it for example) then you should explictly use one of the classes SilverStripe provides.
280: [23:19:57] <Nightjar> it also casts strings into HTMLString or somesuch
281: [23:20:02] <Nightjar> to avoid injections
282: [23:20:32] <Nightjar> or rather TextField escapes html, HTMLTextField does not. Or something like that.
283: [23:20:40] <Nightjar> api.silverstripe.org will help you there :)
284: [23:21:57] <neomang> alright, thanks
285: [23:22:34] <neomang> i'm also having an issue where a listboxfield isn't appearing in the CMS. I've got one built using the same method that appears, but the second one doesn't
286: [23:22:35] <neomang> http://www.sspaste.com/paste/show/5850827aad657
287: [23:23:34] <zippy> or (string)$foo
288: [23:24:23] <Nightjar> no zippy
289: [23:25:05] <zippy> :(
290: [23:25:52] <Nightjar> oh, for putting into the arraydata? yeah it'll work, I guess.
291: [23:26:01] <Nightjar> Not for output to a template though.
292: [23:26:38] <Nightjar> It's a layer too deep for that, it'll still be cast to viewabledata object, then have val called :>
293: [23:26:46] <Nightjar> or something like that
294: [23:26:50] * Nightjar shrugs
295: [23:27:00] <Nightjar> complexities of automagic frameworkings!
296: [23:27:06] <Nightjar> \o/
297: [23:27:08] <trash__> Nightjar: it should be Topics not Topic
298: [23:27:12] <trash__> ups
299: [23:27:21] <Nightjar> huh
300: [23:27:27] <trash__> neomang: it should be Topics not Topic
301: [23:27:30] <Nightjar> on you mean neomang haha
302: [23:27:49] <Nightjar> off-by-one tab completion xD
303: [23:27:51] <trash__> ListboxField::create('Resources', 'Resource', $source, $value, $size = null, $multiple = true), 'Topics');
304: [23:27:59] <trash__> yeah
305: [23:28:05] <Nightjar> gg
306: [23:29:47] <samsam> So here’s another tricky one.. Ampersands (&) are converted to “and” in SiteTree URL Segments
307: [23:30:03] <samsam> Is there a way to make it replace & with a translation of “and”?
308: [23:31:43] <Nightjar> Yes.
309: [23:31:47] <Nightjar> There is!
310: [23:32:44] <Nightjar> http://api.silverstripe.org/3.5/source-class-URLSegmentFilter.html#112
311: [23:34:06] <Nightjar> Make one of these I guess: http://api.silverstripe.org/3.5/class-SS_Transliterator.html
312: [23:34:34] <Nightjar> Alternatively, use the config to change: http://api.silverstripe.org/3.5/source-class-URLSegmentFilter.html#30
313: [23:34:43] * janneklouman-- quit (Ping timeout: 258 seconds)
314: [23:34:57] <Nightjar> samsam, ^
315: [23:35:16] * Tron__ quit (Ping timeout: 260 seconds)
316: [23:36:37] * darianno has joined #silverstripe
317: [23:38:34] <trash__> it's time to go to sleep
318: [23:38:37] <trash__> see you
319: [23:43:26] * trash__ quit (Ping timeout: 260 seconds)
320: [23:46:16] <samsam> Nightjar: Ha, nice one! Let’s have a look how to use this

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