#silverstripe IRC Log

IRC log for 16 May 2016

All timestamps are in UTC.

1: [00:00:01] * ss-helper quit (Remote host closed the connection)
2: [00:00:13] * ss-helper has joined #silverstripe
3: [00:33:34] * UncleCheese has joined #silverstripe
4: [00:41:46] * UncleCheese quit (Read error: Connection reset by peer)
5: [00:58:19] * micmania1 quit (Quit: micmania1)
6: [01:09:16] <Pyrmnk> the channels are alive with the sound, of silence.
7: [01:11:01] <spronk> la la la laaaa
8: [01:12:13] <Firesphere> \o
9: [01:13:34] <Nightjar> o/
10: [01:25:27] * micmania1 has joined #silverstripe
11: [01:48:14] * Nightjar quit (Quit: leaving)
12: [02:34:52] <Pyrmnk> #ded
13: [02:37:29] <spronk> pretty much
14: [02:46:50] * Hailwood has joined #silverstripe
15: [02:47:46] <Hailwood> Hey folks, does anyone have an example of saving a page only to Stage?
16: [02:48:02] <Firesphere> In code you mean?
17: [02:48:21] <Hailwood> Yep
18: [02:48:48] <Hailwood> I've tried simply doing $bp = BlogPost::create(); $form->saveInto($bp); $bp->write(); but while things are getting created in the BlogPost table, nothing is getting inserted into SiteTree
19: [02:49:50] <Hailwood> Actually no I'm wrong... wtf
20: [02:50:47] <Hailwood> Things are getting created in their Respective _Live tables
21: [02:51:02] <Hailwood> but not in the non _Live tables, which is the opposite of what I'm after
22: [02:55:56] <Firesphere> if($obj->isPublished()) { $obj->doUnpublish(); }
23: [03:03:55] * irogue has joined #silverstripe
24: [03:10:36] <Hailwood> Firesphere, So... publish the page, then unpublish it?
25: [03:12:24] <Hailwood> Ah, instead of ->write() I needed ->writeToStage('Stage');
26: [03:25:19] <spronk> man
27: [03:25:25] <spronk> gradual typing with catchable errors is neat
28: [03:25:29] <spronk> (strict_types=1)
29: [03:31:14] <Firesphere> Ah, writeToStage
30: [03:33:26] <Firesphere> Yeah, I knew there was something like that, but couldn't find it
31: [03:44:22] * Stomach quit (Quit: zzz)
32: [03:45:13] * Stomach has joined #silverstripe
33: [04:08:43] <Pyrmnk> no one can ever find anything on Versioned
34: [04:17:57] * zlinux quit (Ping timeout: 260 seconds)
35: [05:38:22] * Dedra has joined #silverstripe
36: [05:38:39] <Dedra> Good morning :)
37: [05:58:37] <Stomach> good morning
38: [06:00:06] * spronk quit (Quit: I may need a longer sleep timer...)
39: [06:01:01] <irogue> afternoon :)
40: [06:03:47] <Dedra> huhu ^^
41: [06:03:51] <Dedra> it's morning for me :P
42: [06:03:55] <Dedra> 8.04 ^^
43: [06:04:20] * micmania1 quit (Quit: micmania1)
44: [06:05:06] <Dedra> Hehe, the bootstrap ICR chat is more quiet than the silverstripe chat :D
45: [06:05:14] <Dedra> But 3x more people :P
46: [06:05:18] <Dedra> so SS wins ^^
47: [06:10:36] <Dedra> Someone used to Bootstrap 3? I just testing the framework a bit. I have a short question about it, sure it's not SS related. But it's quiet in here anyways :P
48: [06:13:11] * spronk has joined #silverstripe
49: [06:15:01] <Dedra> The Question is: Is there a special Boostrap3 class which controls the space (margin-top) of a content? For example: http://dedra-sc.com/Tutorial2/index.html Visit this, delete: "Content-Area" <h1> via inspect. You'll see the "Lorem ipsum" <p>-Tag is connected to the top navigation (no space). Visit: http://dedra-sc.com/Tutorial2/example.html do the same, delete the <h1>-Tag. You'll see, there is a space. That's my common
50: [06:15:02] <Dedra> solution for that "issue". I just add an extra <div> with a margin around content elements. Everything what comes from the CMS Editor gets this, because I don't know what the user types.
51: [06:18:51] * Stomach quit (Quit: zzz)
52: [06:27:31] * Dedra2 has joined #silverstripe
53: [06:30:57] * cheddam quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
54: [06:31:38] * Dedra quit (Ping timeout: 265 seconds)
55: [06:33:16] * irogue quit (Ping timeout: 252 seconds)
56: [06:36:17] * Stomach has joined #silverstripe
57: [06:38:37] * Mike123 has joined #silverstripe
58: [06:40:27] <Mike123> hey guys
59: [06:40:46] <Stomach> hiya
60: [06:43:00] <Mike123> have strage bug in SS, when selecting media from files, can't enter page in pagination, it's like disabled or something... http://prntscr.com/b33v1y
61: [06:54:13] * marvanni has joined #silverstripe
62: [06:55:20] <Stomach> hmm I've never tried that to be honest
63: [06:56:12] <Mike123> oh so another question, how can i extend GridField.css ? i mean override it a bit
64: [06:57:41] <Stomach> put one into you mysite/ dir then load it with extra_requirements
65: [06:58:07] <Stomach> LeftAndMain:
66: [06:58:07] <Stomach> extra_requirements_css:
67: [06:58:07] <Stomach> - mysite/css/extraconfig.css
68: [06:58:26] <Mike123> nice ! Thank you :)
69: [06:58:39] <Stomach> :)
70: [07:02:17] * spronk quit (Quit: I may need a longer sleep timer...)
71: [07:14:30] * spronk has joined #silverstripe
72: [07:19:30] * elgabbu has joined #silverstripe
73: [07:28:30] <Stomach> where irogue gone :(
74: [07:37:13] <marvanni> is there a tool to convert sha1_v2.4 passwords to blowfish encrypted passwords?
75: [07:52:23] * marvanni quit (Ping timeout: 250 seconds)
76: [08:06:36] * marvanni has joined #silverstripe
77: [08:08:26] * slievr has joined #silverstripe
78: [08:20:23] * kinglozzer has joined #silverstripe
79: [08:25:53] * spronk quit (Quit: I may need a longer sleep timer...)
80: [08:37:11] * irogue has joined #silverstripe
81: [08:38:22] <Stomach> yaaaaay hes back :D
82: [08:40:48] * marvanni quit (Ping timeout: 276 seconds)
83: [08:42:37] * irogue quit (Ping timeout: 265 seconds)
84: [08:44:58] <Stomach> awww hes gone
85: [08:46:55] * agent44 has joined #silverstripe
86: [08:47:44] * irogue has joined #silverstripe
87: [08:48:00] <Stomach> Yaaaaay hes back :D
88: [08:48:29] <irogue> hey I got a capital Y this time :P
89: [08:50:13] <Stomach> haha :D
90: [08:52:21] * spronk has joined #silverstripe
91: [08:52:54] * marvanni has joined #silverstripe
92: [08:53:36] * spronk quit (Max SendQ exceeded)
93: [09:08:11] <Firesphere> Hmmm, I think you want some sort of "gutter" method for that bootstrap issue Dedra2
94: [09:11:01] * kinglozzer quit (Remote host closed the connection)
95: [09:14:56] * cupcake quit (Ping timeout: 250 seconds)
96: [09:15:47] * kinglozzer has joined #silverstripe
97: [09:24:25] <marvanni> Firesphere what do you think of my cli installer ? https://github.com/axyr/silverstripe-cli-installer
98: [09:29:06] * waef has joined #silverstripe
99: [09:29:06] <ss-helper> waef: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
100: [09:29:16] * mrguits has joined #silverstripe
101: [09:29:49] <mrguits> Hi, How can i prolong the time before a user session in silverstripe destroys (and user is being logged out)
102: [09:30:47] * Eliseth has joined #silverstripe
103: [09:31:10] <kinglozzer> mrguits: ping the server
104: [09:31:41] <kinglozzer> https://github.com/silverstripe/silverstripe-framework/blob/3.3/admin/javascript/LeftAndMain.Ping.js
105: [09:31:44] <kinglozzer> That's how the CMS does it
106: [09:33:34] * waef quit (Ping timeout: 250 seconds)
107: [09:35:08] <Stomach> morning kinglozzer
108: [09:39:46] <kinglozzer> Hey Stomach
109: [09:40:04] <Stomach> hows it going
110: [09:40:22] <kinglozzer> Good thanks, busy busy busy! Yourself?
111: [09:40:42] <Stomach> the same :) waiting on a large database dump being uploaded to SS platform for a launch
112: [09:40:58] <kinglozzer> Must be pretty large if you're having to wait for it ;)
113: [09:40:59] <Stomach> and then I can push this project live and go home and sleep for the next 36 hours
114: [09:41:08] <Stomach> 2.2 gb :(
115: [09:41:21] <kinglozzer> Whoa, impressive! :P
116: [09:42:02] <Stomach> haha yay for multi-year projects (and designers who don't know what "optimise" means)
117: [09:45:15] <ss-helper> Form template location - https://groups.google.com/d/msg/silverstripe-dev/6ME-tIROq1o/uaySi7YyCwAJ
118: [09:51:19] * GioVdK has joined #silverstripe
119: [09:52:34] <GioVdK> Hello, I set up a cron job running sake as explained on https://docs.silverstripe.org/en/3.3/developer_guides/cli/
120: [09:53:05] <GioVdK> I did that before and worked fine, now I'm on a server with cPanel and for some reason the email with the output is just showing some headers
121: [09:53:41] <GioVdK> Status: 302 Found [...] Location: /Security/login?BackURL=%2Fdev%2Ftasks%2F[...]Task
122: [09:54:22] <GioVdK> so it looks like it is trying to redirect to the login page, but if I run the same command from terminal, it works fine
123: [09:54:49] * wakes has joined #silverstripe
124: [09:55:01] <slievr> Is there a built in function for accessing the data in SiteTree_ImageTracking ?
125: [09:56:07] <wakes> Hi guys, think I may have found a bug in SQLConditionalExpression where I seem to be loosing the name of first table in a set of joins
126: [09:57:42] * irogue waves at kinglozzer
127: [09:57:59] <irogue> and I'm here cos I'm the one uploading the dump for Stomach :P
128: [09:58:08] * Stomach <3 Ed
129: [09:59:29] <kinglozzer> yo irogue
130: [09:59:51] <marvanni> GioVdK are you using php framework/cli-script.php dev/task MyTask or wget domain.com/dev/task/MyTask ?
131: [09:59:57] <kinglozzer> wakes: Can you give more detail? I think I might know which bug you're experiencing...
132: [10:00:02] <kinglozzer> many_many by any chance?
133: [10:00:16] <ss-helper> Re: [silverstripe-dev] Form template location - https://groups.google.com/d/msg/silverstripe-dev/6ME-tIROq1o/Ef0xlIczCwAJ
134: [10:00:29] <GioVdK> marvanni: nope none, I'm running sake directly
135: [10:01:04] <marvanni> hm. that should work..
136: [10:01:32] <GioVdK> yep :p
137: [10:01:43] <kinglozzer> GioVdK, marvanni: Perhaps framework isn't detecting that you're on CLI?
138: [10:01:57] <kinglozzer> Thinks you're using web interface, so wants a login?
139: [10:02:02] * kinglozzer guessing
140: [10:03:11] <GioVdK> kinglozzer: it may be, but why only when ran from cron and not from prompt? maybe env variable not set?
141: [10:03:21] <marvanni> I had an issue with running tests that the cli did not put the site in dev mode…
142: [10:03:35] <GioVdK> this is the crontab:
143: [10:03:37] <GioVdK> MAILTO="dev@[...].com"
144: [10:03:37] <GioVdK> SHELL="/bin/bash"
145: [10:03:37] <GioVdK> 0 0,12 * * * /home/[...]/www/framework/sake dev/tasks/[...]Task
146: [10:08:42] <wakes> kinglozzer: I think its the array_unshift line 315 where sometimes the value is an array and not a string, so when it gets pushed back front of array the key is '0' not the table name, so subsequent iteration
147: [10:09:13] <kinglozzer> wakes: What's the query you're trying to do?
148: [10:09:16] <wakes> kinglozzer: where the key should be the alias on return of getOrderedJoins gets an empty table name as it is '0'
149: [10:11:09] <wakes> kinglozzer: it gets built as SELECT DISTINCT "CERAModel"."ID" FROM LEFT JOIN "CERAModel" ON "RecordArticle_Keywords"."KeywordAttributeID" = "CERAModel"."ID" LEFT JOIN "ArticleModel" ON "ArticleModel"."ID" = "CERAModel"."ID" LEFT JOIN "RecordArticle" ON "RecordArticle"."ID" = "CERAModel"."ID" INNER JOIN "RecordArticle_Keywords" ON "RecordArticle_Keywords"."RecordArticleID" = "CERAModel"."ID" LEFT JOIN "KeywordAttribute" ON "Reco
150: [10:11:33] <kinglozzer> wakes: Does that involve a many_many relation by any chance?
151: [10:11:42] <wakes> but if you see between the 'FROM' and the first 'LEFT JOIN' the 'base table' 'CERAModel' has gone
152: [10:12:06] <wakes> kinlozzer: yes indeed
153: [10:12:36] <kinglozzer> wakes: Yeah we've been working on this bug in core recently - it's partially solved by this https://github.com/silverstripe/silverstripe-framework/pull/5530 but not fully
154: [10:13:09] * Eliseth quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
155: [10:13:18] <kinglozzer> wakes: How are you reaching that query? You might need to look for a different approach if possible (for now)
156: [10:14:56] <wakes> kinglozzer: It's just to get a filter from IDs passed on query string for keywords so results filter those out by ID, can look at another way though
157: [10:15:17] <ss-helper> Re: Form template location - https://groups.google.com/d/msg/silverstripe-dev/6ME-tIROq1o/zBls7AY0CwAJ
158: [10:15:45] <wakes> kinglozzer: it's interesting as one line before am doing the same thing (I think, haven't double checked) and it does work I get SELECT DISTINCT "CERAModel"."ID" FROM "CERAModel" LEFT JOIN "ArticleModel" ON "ArticleModel"."ID" = "CERAModel"."ID" LEFT JOIN "RecordArticle" ON "RecordArticle"."ID" = "CERAModel"."ID" INNER JOIN "RecordArticle_Aspects" ON "RecordArticle_Aspects"."RecordArticleID" = "CERAModel"."ID" LEFT JOIN "Taxono
159: [10:16:17] <wakes> kinglozzer: in this case the value for the joins is the table name and not an array so appears to work
160: [10:16:31] <wakes> kinglozzer: will look at doing it 'backwards' instead :-)
161: [10:16:40] <kinglozzer> wakes: It only happens for many_many relations that are self-referencing (either a many_many between the same class, or a descendant class)
162: [10:17:14] <kinglozzer> We fixed the missing FROM table, but the search filter needs fixing still
163: [10:17:54] <wakes> kinglozzer: ah, OK, I have both RecordArticle and KeywordAttribute descending from a 'CERAModel' class so can put common functionality across models in there
164: [10:18:26] <wakes> kinglozzer: I don't want to change inheritance at this stage so will have to look at workaround I guess
165: [10:19:13] <wakes> kinglozzer: thx for your help, glad to know it's not just me then :-)
166: [10:24:29] * cheddam has joined #silverstripe
167: [10:26:37] <Stomach> gidday cheddam
168: [10:26:49] <cheddam> howdy!
169: [10:31:46] <Stomach> hows it going
170: [10:33:11] <cheddam> Helping irogue out atm :P
171: [10:35:26] <Stomach> you guys are getting flowers tomorrow
172: [10:35:58] <irogue> will they be edible flowers?
173: [10:36:05] <cheddam> mmmm flowersss
174: [10:36:31] <Stomach> haha edible flowers :D
175: [10:36:34] <Stomach> will do some research
176: [10:36:49] <cheddam> (y)
177: [10:37:56] <Stomach> :D
178: [10:55:19] * wakes quit (Quit: Page closed)
179: [11:09:34] <mrguits> thanx kinglozzer (on How can i prolong the time before a user session in silverstripe destroys) ..
180: [11:09:38] <mrguits> ..i had to go away
181: [11:09:57] * irogue quit (Quit: My Mac has gone to sleep. ZZZzzz…)
182: [11:10:01] <mrguits> yes, that´s a good idea ..but otherwise .. can you set the timelimit somehow?
183: [11:13:39] * _longines quit (Read error: Connection reset by peer)
184: [11:16:19] * Pyrmnk has joined #silverstripe
185: [11:16:52] <Pyrmnk> ss23: do you the solder and the multimeter?
186: [11:18:26] * irogue has joined #silverstripe
187: [11:21:43] <Pyrmnk> memoserv full nick to answer. need the sleeps.
188: [11:22:01] <Pyrmnk> finally the opsrogue?
189: [11:22:27] <Pyrmnk> :)
190: [11:22:57] <Pyrmnk> computer repair suggestions irogue?
191: [11:23:13] <irogue> a hammer
192: [11:23:18] <Pyrmnk> ha
193: [11:24:00] <ss23> Pyrmnk: I do! Though... perhaps not like... at my house
194: [11:24:18] <ss23> I have a multimeter with me, but it's a fluke 114 so not as fully featuerd as some
195: [11:24:23] <ss23> Think my soldering iron is still at sivlerstripe
196: [11:24:24] <Pyrmnk> laptop power needs a refix
197: [11:24:47] <ss23> irogue: when you get time are you able to drop that stuff off here? and the sleeping bag cheddam hasn't returned yet too? <3
198: [11:24:49] <Pyrmnk> not sure if anything burnt out.
199: [11:25:12] <cheddam> rofl
200: [11:25:40] <Pyrmnk> oh look, everyone important is here :>
201: [11:26:21] <irogue> ss23: yeah aiight. remind me in the weekend
202: [11:26:28] <Pyrmnk> ss23 I keep missing locksport too :<
203: [11:26:37] <ss23> irogue: will try o/
204: [11:26:45] <ss23> p.s. invite me for dinner some time when you're cooking real food
205: [11:27:12] <Pyrmnk> ss23 would you like to help me debug hardware?
206: [11:27:16] <ss23> Um
207: [11:27:23] <ss23> I am *really* not good at hardware
208: [11:28:30] <Pyrmnk> neither, but is hopefully simple case of cable torquing contacts off pcb
209: [11:29:25] <Pyrmnk> coz long ridged plugs on laptops wtf.
210: [11:29:27] <ss23> You're welcome to borrow my gear, but I don't really wanna debug stuff soz :(
211: [11:29:36] * Dedra2 quit (Quit: Bye guys, have to go!)
212: [11:29:51] <Pyrmnk> kk. well will see :) might give it a go
213: [11:30:12] <ss23> good luck :D
214: [11:30:22] <ss23> This one time I plugged a different cord into my modem and it started working
215: [11:30:27] <Pyrmnk> thought you were into hardware coz of copter n stuff
216: [11:30:28] <ss23> I was pretty proud of my l33t electronics skills
217: [11:30:34] <ss23> I want to be, I'm just... not I guess
218: [11:30:44] <ss23> Takes more time to learn than I've put in to have any level of knowledge I think
219: [11:30:48] <Pyrmnk> haha, know dem feels.
220: [11:31:34] <Pyrmnk> anyway, suddenly 11:30pm, fk, gotta zzz. nite all.
221: [11:31:51] <ss23> nn
222: [11:32:31] <GioVdK> hi kinglozzer, I double checked and I think you're right... it is not running it while it is ran from the cron, so probably it thinks it is not on CLI
223: [11:35:27] <Stomach> ss23 are you a solr professional
224: [11:35:41] <GioVdK> at the moment it is checking it with return (php_sapi_name() == "cli");, I'll see what it returns when ran from cron
225: [11:36:09] <Stomach> wait is Pyro in NZ now?
226: [11:36:48] <irogue> Stomach: yup he's welly-based now
227: [11:36:51] <Stomach> oh wow
228: [11:37:00] <Stomach> will definitely need to come down now
229: [11:38:18] <GioVdK> ok so when run by the cron it is cgi-fcgi :P
230: [11:40:32] * DimiStripe quit (Remote host closed the connection)
231: [11:42:30] * DimiStripe has joined #silverstripe
232: [11:42:36] <cheddam> So apparently MacBook Pros hate it when you leave them unplugged asleep for ~5 weeks
233: [11:46:11] <Stomach> ahhh that moment when you disable flux
234: [11:46:12] <Stomach> >_<
235: [11:46:15] <Stomach> my eyes
236: [11:46:41] <cheddam> I know that feel, friend
237: [11:55:18] <ss23> Stomach: fite me irl
238: [11:55:34] <Stomach> what
239: [11:55:35] <Stomach> why
240: [11:55:38] <Stomach> >_>
241: [11:55:39] <cheddam> >solr
242: [11:55:41] * kinglozzer quit (Remote host closed the connection)
243: [11:56:15] * kinglozzer has joined #silverstripe
244: [11:58:47] <Mike123> how can i pass valid json with HTML templates to ajax ?
245: [12:01:18] * GioVdK quit (Remote host closed the connection)
246: [12:12:51] * irogue quit (Quit: My Mac has gone to sleep. ZZZzzz…)
247: [12:22:51] * UndefinedOffset has joined #silverstripe
248: [12:23:26] * Dedra has joined #silverstripe
249: [12:27:19] * Azure|dc quit (Quit: My Mac has gone to sleep. ZZZzzz…)
250: [12:30:52] * kinglozzer quit (Ping timeout: 260 seconds)
251: [12:34:30] * kinglozzer has joined #silverstripe
252: [12:36:49] * DimiStripe_alt has joined #silverstripe
253: [12:40:09] * Azure has joined #silverstripe
254: [12:49:05] * Stomach quit (Quit: zzz)
255: [12:50:53] * kinglozzer quit (Remote host closed the connection)
256: [12:51:00] * kinglozzer has joined #silverstripe
257: [12:52:10] <Mike123> how can i pass JSON of templates to the ajax call ?
258: [12:52:29] <elgabbu> hi
259: [12:52:45] <Mike123> using renderWith() i cant get it validated, and JSON.parse is showing me validation error
260: [12:52:51] <Mike123> hi elgabbu :)
261: [12:53:27] <elgabbu> anyone experience issues when using different config for HTMLEditor ... basically when switching between different page types that are using different configs there seems to be some sort of browser cache that keeps showing the last seen config
262: [12:53:48] <elgabbu> hi Mike123 :)
263: [13:05:27] <Mike123> how can i get template with renderWith() suitable for JSON ?
264: [13:05:51] <Mike123> forTemplate() gets me all white space and \r \n
265: [13:05:56] <Mike123> and i get error
266: [13:06:04] <Mike123> for invalid JSON
267: [13:09:04] <slievr> if you're getting it with ajax do you need to use renderWith?
268: [13:09:27] <slievr> can't you just return json_encode(array());
269: [13:09:46] * kinglozzer quit (Remote host closed the connection)
270: [13:10:13] * kinglozzer has joined #silverstripe
271: [13:10:23] * kinglozzer quit (Remote host closed the connection)
272: [13:10:30] * kinglozzer has joined #silverstripe
273: [13:15:33] <Mike123> slievr, i dont get you
274: [13:16:03] <kinglozzer> Mike123: Why don't you just return json_encode($this->renderWith('Foo')); ?
275: [13:16:31] * g-n0m3 quit (Ping timeout: 250 seconds)
276: [13:16:36] <kinglozzer> Then $.parseJSON() assuming you're using jQuery
277: [13:17:39] * g-n0m3 has joined #silverstripe
278: [13:18:04] <slievr> json_encode(ArrayList()->toArray());
279: [13:18:11] <slievr> is the data I assuemd you had
280: [13:18:18] <slievr> but spelled correctly
281: [13:18:58] <Mike123> kinglozzer, i need to return 4 templates, so.. it look something like this http://www.sspaste.com/paste/show/5739c8af2dd6c
282: [13:19:07] <Mike123> if i;'m doing something wrong please correct me
283: [13:21:17] <kinglozzer> Mike123: That looks fine
284: [13:22:03] <Mike123> kinglozzer, well glad to hear that, but i cant parse it in jQuery, on $.parseJSON() i get error
285: [13:22:47] <kinglozzer> Mike123: Can you paste the whole method?
286: [13:23:55] <Mike123> http://www.sspaste.com/paste/show/5739c9dade6be
287: [13:25:08] <Mike123> and this is my ajax http://www.sspaste.com/paste/show/5739ca2ae35c2
288: [13:25:38] <Mike123> btw, dont look at code perfection, it's beta only for now, just need to get it working
289: [13:26:38] <Mike123> i want to pass all 4 templates in one way, rather than calling ajax 4 times
290: [13:26:57] <kinglozzer> Mike123: Try adding a content type header to your PHP response, and then removing the JSON.parse from the JS
291: [13:27:11] <kinglozzer> $this->getResponse()->addHeader('Content-Type', 'application/json')->addHeader('Vary', 'X-Requested-With');
292: [13:27:32] <kinglozzer> You should then be able to access data.Desktop directly, without parsing it
293: [13:27:40] <kinglozzer> (jQuery will detect the content type)
294: [13:27:58] <kinglozzer> You might need to remove the dataType: 'html' too
295: [13:29:53] <kinglozzer> http://pastie.org/10839345 this is something that I just copied from a live site that works
296: [13:36:33] * Eliseth has joined #silverstripe
297: [13:39:09] <Mike123> kinglozzer, it seems i'm getting something different than html https://snag.gy/Dho9fz.jpg
298: [13:39:42] * mrguits quit (Ping timeout: 250 seconds)
299: [13:39:45] <kinglozzer> Ah, looks like you just need to cast to a string then Mike123
300: [13:39:59] <kinglozzer> 'Desktop' => (string) $this->customise($data)->renderWith("ajaxProgramLine")->forTemplate()
301: [13:40:01] <kinglozzer> etc
302: [13:45:51] <marvanni> or ->forTemplate()->forTemplate() ; ..
303: [13:45:58] <marvanni> that will return the string
304: [13:46:20] <marvanni> i know, it looks stupid. but I needed it as well sometimes
305: [13:50:15] <Mike123> i really dont know what's going on... i done everything as you said and still get : SyntaxError: JSON.parse: bad character in string literal at line 1 column 25 of the JSON data
306: [13:52:19] <kinglozzer> Mike123: You don't need to use JSON.parse
307: [13:52:24] <kinglozzer> If you've set the content header
308: [13:52:27] <Mike123> i dont use it
309: [13:52:54] <kinglozzer> Hm, maybe jQuery is failing to parse it internally then
310: [13:52:59] <Mike123> http://www.sspaste.com/paste/show/5739d0b55ff9b
311: [13:53:06] <kinglozzer> Mike123: Try removing all the templates except one and see if it works
312: [13:53:15] <Mike123> o
313: [13:53:21] <kinglozzer> Maybe one of the templates is breaking it, and you just need to work out which one
314: [13:55:32] <kinglozzer> I've used that exact approach on this site and it works http://www.arnoldskeys.com/estate-agents/property-search/
315: [13:57:11] <Mike123> tried with every template, every has it's line of error : SyntaxError: JSON.parse: bad control character in string literal at line 1 column 15 of the JSON data
316: [13:57:46] * muskie9 has joined #silverstripe
317: [13:58:55] <Mike123> when i remove all spacec, \r and \n it's working but i get invalid html then , here my template that i;m getting error in http://www.sspaste.com/paste/show/5739d20e1cfaf
318: [14:00:57] <Mike123> and btw... then i use not json, and just return one template like $this->customise($data)->renderWith("ajaxProgramLine"), it's working fine, because html is without those slashes etc
319: [14:02:13] <kinglozzer> Mike123: Hmm, it's failing because of the new line (it should be replaced with \n)
320: [14:04:38] <kinglozzer> Mike123: Do you know if you have magic_quotes_gpc enabled? StackOverflow says that can cause those issues
321: [14:07:23] <Mike123> no magic quotes enabled
322: [14:08:19] <Mike123> kinglozzer, is there any workaround for this ? :/
323: [14:09:53] <kinglozzer> Mike123: What does the template look like?
324: [14:11:04] * xyphoid quit (Ping timeout: 240 seconds)
325: [14:12:21] <Mike123> kinglozzer, here it is: http://www.sspaste.com/paste/show/5739d52e9057b
326: [14:14:50] * xyphoid has joined #silverstripe
327: [14:17:14] <kinglozzer> Mike123: The template looks fine... I really don't know what could be causing it :/
328: [14:19:43] <Mike123> :/
329: [14:19:44] <Mike123> sad
330: [14:20:01] <kinglozzer> Mike123: Are you using any special characters?
331: [14:20:04] <Mike123> what if i return an array ?
332: [14:20:24] <kinglozzer> Try utf8_encode(json_encode($data)); ?
333: [14:20:31] <Mike123> nop, no special chars
334: [14:20:36] <kinglozzer> No, not that way around sorry
335: [14:20:49] <Mike123> its' because of new lines
336: [14:21:00] <Mike123> maybe i can remove them with regex
337: [14:22:03] <kinglozzer> Mike123: I can't figure out why it does encode some of the newlines, but not all of them :S
338: [14:32:40] * agent44 quit (Quit: zzz)
339: [14:35:48] * agent44 has joined #silverstripe
340: [15:06:22] * Mike123 quit (Ping timeout: 250 seconds)
341: [15:09:51] * Dedra2 has joined #silverstripe
342: [15:14:14] * Dedra quit (Ping timeout: 276 seconds)
343: [15:30:24] <ss-helper> RFC: Use Symfony Console Component for Tasks and better cli support - https://groups.google.com/d/msg/silverstripe-dev/-jKKzkkaQ-8/afrs2VlFCwAJ
344: [15:37:46] * agent44 quit (Quit: zzz)
345: [15:39:01] * agent44 has joined #silverstripe
346: [15:44:55] <marvanni> How does this syntax look ?
347: [15:44:56] <marvanni> http://sspaste.com/paste/show/5739eae5597f2
348: [15:50:44] <kinglozzer> marvanni: A bit confusing tbh, without the code comments you wouldn't be able to guess what is happening :(
349: [15:51:03] <marvanni> thanks, thats what I want to know
350: [15:51:16] * muskie9 quit (Quit: My Mac has gone to sleep. ZZZzzz…)
351: [15:51:45] <marvanni> and like this ?
352: [15:51:47] <marvanni> Member::fake(5)->Team(2);
353: [15:52:51] <kinglozzer> marvanni: I get that there are 5 members, and 2 teams
354: [15:52:59] * muskie9 has joined #silverstripe
355: [15:53:03] <kinglozzer> But I don't know how many will be added to each team
356: [15:53:14] <marvanni> hm yes
357: [15:53:17] <kinglozzer> Will it add one at random to each of the two teams? Or more than one to each?
358: [15:53:27] <marvanni> and if you knew it is a has_one relation?
359: [15:55:09] <kinglozzer> Member has_one Team? It could still mean that 2 members are added to each team (not sure if that should matter though)
360: [15:56:08] <marvanni> yes it does :)
361: [15:57:16] <marvanni> I ment : create 5 fake Members, 2 fake Teams and since it is a has_one realtion, attach all members randomly to one of the Teams
362: [16:01:13] <kinglozzer> marvanni: I see
363: [16:01:21] <kinglozzer> Putting together a module to help with unit testing? :)
364: [16:02:07] <marvanni> Yes, but also to generate fake data while crafting a demo website
365: [16:02:09] <kinglozzer> Last time I did something like that was a Laravel seeder using https://github.com/fzaninotto/Faker, but it was a long long time ago I can't remember anything about how that worked with relations :P
366: [16:02:39] <marvanni> laravel can indeed create fake relations with the Factory class
367: [16:02:48] * cheddam quit (Ping timeout: 276 seconds)
368: [16:04:11] <marvanni> laravel has so much nice featrues that silverstripe could use
369: [16:05:15] <marvanni> and I indeed ment Faker :)
370: [16:06:20] <kinglozzer> Without thinking at all about how it might work, my preference would be to do something like $membersCollection = Faker::create('Member', 5); $teamsCollection = Faker::create('Team', 5); $membersCollection->randomAssign('<TeamRelationName>', $teamsCollection); $membersDatalist = $membersCollection->toDataList();
371: [16:07:49] <kinglozzer> But then you don't want to waste days building unit test mock classes instead of actual websites ;)
372: [16:09:02] <marvanni> Well everybody needs to practice now and then…
373: [16:09:40] * cheddam has joined #silverstripe
374: [16:09:44] <marvanni> and it might save time in the future
375: [16:10:13] <marvanni> at least it will save boring tasks like creating sample data with lorem ipsum
376: [16:10:15] <kinglozzer> Hehe, true, I just meant that my idea might be too time-consuming to be realistic :)
377: [16:10:43] <kinglozzer> Would definitely be a very useful tool though! Better than YAML-all-the-things
378: [16:11:03] <marvanni> yaml is way to time consuming some times
379: [16:11:17] <marvanni> I never use fixtures for tdd
380: [16:11:26] <marvanni> in php im way faster to code the fakers
381: [16:22:35] * Dedra2 quit (Read error: Connection reset by peer)
382: [16:31:43] * kinglozzer home time
383: [16:31:44] <kinglozzer> ciao!
384: [16:31:44] * kinglozzer quit ()
385: [16:36:44] * Azure quit (Quit: My Mac has gone to sleep. ZZZzzz…)
386: [16:39:08] * Azure has joined #silverstripe
387: [16:51:36] * marvanni quit (Quit: marvanni)
388: [16:58:13] * agent44 quit (Quit: zzz)
389: [17:12:58] * marvanni has joined #silverstripe
390: [17:28:52] * marvanni has left #silverstripe
391: [17:29:01] * marvanni has joined #silverstripe
392: [18:07:06] * Eliseth quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
393: [18:20:21] * r3v3rb has joined #silverstripe
394: [18:20:32] <r3v3rb> hi
395: [18:20:57] <r3v3rb> , how can I call a js function on a succesful save of a datobject in the CMS admin?
396: [18:21:40] <r3v3rb> the first load of a page calls the js fine but saving the DO doesn’t recall the JS
397: [18:22:06] <r3v3rb> is there a good example of doing something like this within entwine?
398: [18:22:57] * helenclarko has joined #silverstripe
399: [18:23:08] <helenclarko> Hey all!
400: [18:23:43] <r3v3rb> hi helenclarko
401: [18:24:17] <helenclarko> Its been awhile since I have just come in here to hang out haha.
402: [18:24:39] <helenclarko> No questions today haha!
403: [18:26:13] <r3v3rb> answer mine then :D
404: [18:26:41] <r3v3rb> how can I use entwine to call a function on saving a dataobject in the CMS admin :\
405: [18:51:09] <helenclarko> r3v3rb: Wouldnt know
406: [18:51:11] <helenclarko> Soz
407: [18:53:13] * neomang quit (Quit: Page closed)
408: [18:53:31] * neomang has joined #silverstripe
409: [19:06:26] <neomang> what's the best way to filter a datalist to only get the dataobjects associated with one page when they are allowed to be associated with many
410: [19:07:02] <neomang> for example, a dataobject could be associated with page1, page2, and page4, but I want only objects associated with page2
411: [19:08:18] <muskie9> neomang get the page record (i.e. $page = MyPage::get()->filter('foo', 'bar')->first();) then get the objects by relation $objects = $page->MyObjectRelationName();
412: [19:12:20] <neomang> okay, and could i then filter that by objects that are also related to page2's parent?
413: [19:12:23] <neomang> in the sitetree
414: [19:13:22] <neomang> Im restructuring my site and looking at a few options
415: [19:13:27] <r3v3rb> helenclarko: np, i’m still digging through documentation
416: [19:14:06] <muskie9> neomang I believe so yes
417: [19:14:43] <neomang> okay. I'll probably be bugging this channel a bit today, the site doesn't work as is so restructuring time
418: [19:14:59] <neomang> thanks muskie9
419: [19:15:06] <muskie9> sure
420: [19:21:36] * helenclarko quit (Ping timeout: 250 seconds)
421: [19:34:14] <r3v3rb> any entwine users onboard tonight?
422: [19:35:10] <r3v3rb> \\o/
423: [19:35:19] <r3v3rb> I have an extra arm!
424: [19:44:06] * r3v3rb quit (Quit: r3v3rb)
425: [20:00:14] * Stomach has joined #silverstripe
426: [20:08:15] * r3v3rb has joined #silverstripe
427: [20:09:38] <marvanni> Argh, would this not be nice :)
428: [20:09:39] <marvanni> public function __construct($locale = i18n::get_locale())
429: [20:14:15] * muskie9 quit (Ping timeout: 250 seconds)
430: [20:21:21] * BackEndCoder quit (Quit: https://github.com/BackEndCoder)
431: [20:24:56] * muskie9 has joined #silverstripe
432: [20:44:23] * UndefinedOffset quit (Quit: Leaving.)
433: [20:50:52] * Olliepop has joined #silverstripe
434: [20:54:54] * marvanni quit (Quit: marvanni)
435: [20:59:32] * Olliepop quit (Ping timeout: 250 seconds)
436: [21:02:59] * adrexia has joined #silverstripe
437: [21:19:04] * cheddam quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
438: [21:19:22] * micmania1 has joined #silverstripe
439: [21:27:27] * muskie9 quit (Quit: My Mac has gone to sleep. ZZZzzz…)
440: [21:32:25] * muskie9 has joined #silverstripe
441: [21:41:18] * r3v3rb quit (Ping timeout: 246 seconds)
442: [21:42:34] * irogue has joined #silverstripe
443: [21:42:35] * irogue quit (Changing host)
444: [21:42:35] * irogue has joined #silverstripe
445: [21:43:04] * cheddam has joined #silverstripe
446: [21:46:00] * r3v3rb has joined #silverstripe
447: [21:59:47] * micmania1 quit (Quit: micmania1)
448: [22:13:30] * muskie9 quit (Quit: My Mac has gone to sleep. ZZZzzz…)
449: [22:15:38] * micmania1 has joined #silverstripe
450: [22:18:40] * micmania1 quit (Client Quit)
451: [22:43:21] * Stomach quit (Quit: zzz)
452: [22:45:48] * Stomach has joined #silverstripe
453: [22:46:32] * micmania1 has joined #silverstripe
454: [23:23:35] * Stomach quit (Quit: zzz)
455: [23:34:32] * Stomach has joined #silverstripe
456: [23:45:36] <ss-helper> Re: [silverstripe-dev] Re: Better support for testing out of the box - https://groups.google.com/d/msg/silverstripe-dev/YQ9ru7UuUV0/2cDnSFIMAQAJ
457: [23:48:12] * UncleCheese has joined #silverstripe
458: [23:49:56] * Stomach quit (Quit: zzz)

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