#silverstripe IRC Log

IRC log for 12 June 2013

All timestamps are in UTC.

1: [00:01:34] <supernovah> In 2.4.x what does $Top.variable mean? I though $Top was only for 3 and later
2: [00:01:41] <supernovah> in a template that is
3: [00:02:22] <supernovah> Oh nvm found the reference page that says it does
4: [00:11:01] <clodeindustrie> ok so
5: [00:11:10] <clodeindustrie> updated to 3.1
6: [00:11:31] <clodeindustrie> more a pages on the list, included some deleted ones, but no sign of the ones I was looking for
7: [00:11:43] <supernovah> Is it possible to use Member::currentUserID(); inside a template directly?
8: [00:12:44] <nikrolls> $CurrentMember.ID
9: [00:13:09] <nikrolls> Member is a TemplateGlobalProvider, Member::get_template_global_variables shows you what it exposes
10: [00:13:29] <supernovah> But if I had my own class, not just interested in Member
11: [00:14:09] <nikrolls> If required, you could implement TemplateGlobalProvider and expose a static function in a similar way
12: [00:16:36] <supernovah> Ok so I'll rephrase, what syntax allows me to use a static member variable or property of a class, directly from within the template given that the scope is accesable
13: [00:16:57] <nikrolls> TemplateGlobalProvider does
14: [00:17:02] <supernovah> Oh ok
15: [00:17:03] <nikrolls> For static functions
16: [00:17:38] <nikrolls> The alternative is writing a 'getter' function on your page controller, but that's not very clean if you want it on multiple unrelated changes
17: [00:17:51] <nikrolls> *multiple unrelated pages
18: [00:24:27] <supernovah> I see
19: [00:30:04] <Pyromanik> how to tell gridfield to not escape column output?
20: [00:30:18] <Pyromanik> building an img tag in a summary field
21: [00:30:32] <Pyromanik> comes out as escaped text, not an img tag
22: [00:33:11] <nikrolls> Try casting the pseudo-field as HTMLText
23: [00:33:20] <Pyromanik> how though, is what I'm asking.
24: [00:33:22] <nikrolls> That works in a project we have here
25: [00:33:28] <Pyromanik> ^
26: [00:33:38] <Pyromanik> it's what I know to do, but I don't know HOW.
27: [00:33:41] <nikrolls> :D
28: [00:33:51] <Pyromanik> :P
29: [00:34:07] <nikrolls> Wait a sec
30: [00:34:19] <Pyromanik> thanks in advance, going to lunch, back later.
31: [00:39:26] <nikrolls> Something like this (adapted from a working class, so not tested in the form that is pasted, but should be good to go off): http://www.sspaste.com/paste/show/51b7c307bf14f
32: [00:45:36] <supernovah> My CMS is storing my dates as 1970-01-01 (zero unix) when I use a calendar helper that isn't American formatted...
33: [00:45:43] * mattybalaam quit (Quit: mattybalaam)
34: [00:49:47] <mobiusnz> supernovah: set your locale for the cms
35: [00:50:29] * clodeindustrie quit (Quit: Textual IRC Client: www.textualapp.com)
36: [01:00:12] <supernovah> Okay works ty mobiusnz, can I ask also, how would I give a $Top.method a varable from within my control as in $Top.method($dataBeforeTop)
37: [01:00:43] <mobiusnz> you can't pass a variable into a template function unfortunately
38: [01:00:56] <mobiusnz> you can do $Top.method(foo) but not $Top.method($foo)
39: [01:01:25] * joelpittet quit (Remote host closed the connection)
40: [01:01:28] <nikrolls> Is that a 2.4 thing? Because you can in 3, with the caveat that it's always casted to string
41: [01:01:45] <mobiusnz> I'm fairly sure you can't do that in 3
42: [01:01:50] <mobiusnz> I've tried
43: [01:02:02] <nikrolls> I use it frequently
44: [01:02:22] <supernovah> I'm on 2.4 - it's not a template function, it's in my page controller. I sometimes want to access the variable in an unprocessed form, and other times process it
45: [01:02:23] <nikrolls> Let me double check before committing to that :)
46: [01:03:02] <supernovah> As in my page_controller has this variable and a function which processes it
47: [01:03:22] <supernovah> When I do $Top.method(foo), method is receiving "foo" as a string
48: [01:03:51] <nikrolls> Yeah, you can pass a variable using $ in v3, but the function receives its value as a string rather than receiving whatever object it was
49: [01:04:09] <nikrolls> So I suspect it's evaluated in place, and then the function call is made
50: [01:05:07] <supernovah> So then if I have a dataobjectset and I want to alter a column of it, I have to comb over it outside of my template? Since this prevents me being able to use a variable from a control loop in a page_controller method
51: [01:05:38] <nikrolls> Yeah you wouldn't be able to pass a list that way
52: [01:05:42] <supernovah> All I'm trying to do is reformat a date column
53: [01:06:02] <supernovah> I don't want the sql datetime, I want NZ style
54: [01:06:37] <mobiusnz> $Date.Nice
55: [01:06:52] <nikrolls> '$func($param, $param2)', would first be converted by the parser to '$func("paramValue", "param2Value")'
56: [01:07:22] <supernovah> except I'm getting "param" out lol
57: [01:07:32] <supernovah> Oh that's 3 anyway
58: [01:07:32] <nikrolls> Again, this is my experience with v3, I haven't used 2.4
59: [01:07:33] <mobiusnz> nikrolls: ah, that might have been the problem I was having. I was wanting to do $Date1.range($Date2)
60: [01:07:54] * popeshoe has joined #silverstripe
61: [01:07:54] <nikrolls> mobiusnz: Yep, it loses its object-ness :)
62: [01:08:16] <nikrolls> supernovah: 2.4 may work the same, but someone else would have to confirm
63: [01:08:22] <mobiusnz> supernovah: you can format the date in the template easy enough
64: [01:08:28] <nikrolls> ^
65: [01:08:33] <supernovah> No it gets the param variable name as a string instead
66: [01:08:45] <mobiusnz> supernovah: can you pastie your template code?
67: [01:09:00] <supernovah> It's quite long man don't worry
68: [01:09:10] <supernovah> I'll look into template functions (haven't done so yet)
69: [01:09:10] <nikrolls> If you only want to format it then mobiusnz's suggestion would work. But if you want to pass the nicely formatted date into another function, that's tricky
70: [01:09:30] <nikrolls> Or rather, if you want to pass the Date object into a function, that's the tricky bit
71: [01:12:59] <supernovah> wait shouldn't a method in my page controller be accessible as just $method(variableInControl) from any control?
72: [01:17:27] <supernovah> And if I an an associative array or the like outside a control loop, I can't access it without some page_controller kung-foo?
73: [01:17:58] <nikrolls> Yes to your first
74: [01:18:08] <nikrolls> And that's also the case in the page model
75: [01:18:26] <nikrolls> And I think yes to the second? I don't fully understand
76: [01:19:52] <nikrolls> You could call the function on your controller which does a calculation based on other data in the controller/model (even data that the templates can't access), and then return the result to the template
77: [01:20:13] * mattybalaam has joined #silverstripe
78: [01:21:21] <Pyromanik> nikrolls: I thought $casting only worked in templates.
79: [01:21:40] <nikrolls> CMS is a template too?
80: [01:21:50] <Pyromanik> hmm
81: [01:21:51] <Pyromanik> maybe
82: [01:22:00] <nikrolls> We fiddled around with that for a while, and this combination ended up working
83: [01:22:28] <Pyromanik> depends if it calls an SSViewer to render the grid cell's contents or if it uses strings.
84: [01:22:36] <Pyromanik> I guess
85: [01:22:39] <supernovah> So how can I reformat a date inside the template
86: [01:22:52] <Pyromanik> supernovah: $Date.Format()
87: [01:22:58] * C10ne quit (Ping timeout: 250 seconds)
88: [01:23:10] <Pyromanik> using a string formed like http://php.net/date
89: [01:23:38] * dospunto_ quit (Remote host closed the connection)
90: [01:23:44] <supernovah> I mean within a template control loop
91: [01:24:06] <supernovah> Because that provides the same problem, I can't get control loop data into a method outside of it
92: [01:24:24] * dospuntocero has joined #silverstripe
93: [01:25:03] * mattybalaam quit (Ping timeout: 256 seconds)
94: [01:25:11] <supernovah> This should be something so preposterously simple....
95: [01:25:20] * priithansen quit (Quit: priithansen)
96: [01:25:44] <nikrolls> Would have to see your code I think, even a portion of it would make it easier, otherwise we're guessing what you're trying to do
97: [01:26:17] <Pyromanik> nikrolls: public function Thumbnail return $test ? DBField::create_field('HTMLVarchar', '<img ... />') : false;
98: [01:26:20] <Pyromanik> works too
99: [01:26:34] <Pyromanik> supernovah: what are you talking about?
100: [01:26:56] <supernovah> I have a dataobjectset which is just a database query, I want to reformat the Created column each time when printing it in a table on a template
101: [01:26:57] <nikrolls> Pyromanik: Ah, of course! Even better. Thanks, I will note that down
102: [01:27:00] * popeshoe quit (Quit: This computer has gone to sleep)
103: [01:27:07] <Pyromanik> you're either a) doing it wrong, b) doing it all kinds of wrong
104: [01:27:17] <supernovah> I access the set as control methodWhichReturnsTheSet and the date variable as $Created
105: [01:27:34] <nikrolls> <% control methodWhichReturnsTheSet %>
106: [01:27:38] <supernovah> yes
107: [01:27:43] <nikrolls> $Date.Format('d M Y')
108: [01:27:49] <nikrolls> <% end_control %>
109: [01:27:50] <Pyromanik> then $Created.Format('d M Y')
110: [01:27:51] <nikrolls> Something like that?
111: [01:27:56] <Pyromanik> exactly like that.
112: [01:28:00] <Pyromanik> $Created, not date
113: [01:28:01] <supernovah> ty
114: [01:28:02] <nikrolls> Er, sorry, $Created.
115: [01:28:03] <nikrolls> :)
116: [01:28:19] <supernovah> Where would that be covered in the reference
117: [01:28:24] <Pyromanik> everywhere.
118: [01:28:41] <Pyromanik> also, stop using outdated software if at all possible.
119: [01:28:59] <Pyromanik> 2.4 was superceeded almost a year ago now.
120: [01:29:00] <supernovah> I don't have time to try and upgrade this entire site to 3
121: [01:29:01] <spronk> ughhh
122: [01:29:03] <nikrolls> It's an inherited site
123: [01:29:05] <spronk> subsites is so fucking buggy
124: [01:29:11] <nikrolls> http://doc.silverstripe.org/framework/en/2.4/reference/advanced-templates
125: [01:29:24] <Pyromanik> yeh, hence disclaimer 'if at all possible'
126: [01:29:36] <nikrolls> supernovah: That page should have it
127: [01:29:43] <nikrolls> Or something close
128: [01:29:44] <Pyromanik> $Variable.Method(optional, params)
129: [01:29:52] <Pyromanik> for pretty much anything.
130: [01:30:09] <Pyromanik> http://doc.silverstripe.org/framework/en/2.4/reference/built-in-page-controls
131: [01:31:33] <Pyromanik> same as it is in 3 for the most part.
132: [01:32:19] <supernovah> But this is only going to work for specific things, how do I perform my own method on my own variable
133: [01:32:58] <nikrolls> $Variable.Method works in most cases
134: [01:33:08] <nikrolls> And $Variable.Method(params, optional)
135: [01:42:55] <mobiusnz> ugh. the PhoneNumberField is so bung
136: [01:53:38] * mattybalaam has joined #silverstripe
137: [01:58:01] * mattybalaam quit (Ping timeout: 260 seconds)
138: [02:00:21] <Pyromanik> supernovah: I think you should explain your situation better.
139: [02:01:00] <Pyromanik> We've told you exactly what you've asked for, but you're telling us it's not going to work, so I think there's a bit of context missing in the middle here.
140: [02:01:16] <Pyromanik> mobiusnz: lol, pretty much never (use).
141: [02:04:13] <supernovah> Using format on the date field worked
142: [02:06:46] * stellalie has joined #silverstripe
143: [02:07:00] <supernovah> But only because it has the date fieldtype already from sapphire getting it out of the DB. I guess I'm just not used to MVC virtually isolating view and controller
144: [02:08:37] * metanat has joined #silverstripe
145: [02:10:08] * nickmolhoek has joined #silverstripe
146: [02:10:09] * nickmolhoek quit (Remote host closed the connection)
147: [02:10:09] <supernovah> Sorry to be annoying somewhat
148: [02:10:15] <supernovah> I'll be back later
149: [02:10:23] * nickmolhoek has joined #silverstripe
150: [02:16:00] <mobiusnz> i <3 HTML5 forms
151: [02:16:17] <mobiusnz> I wish SS3 generated them
152: [02:16:31] <ss23> Wriet a patch!
153: [02:16:42] <mobiusnz> actually, that reminds me - I think I did
154: [02:16:46] <mobiusnz> well, a module
155: [02:17:02] <mobiusnz> a patch would probably better, as there's no real reason to not use html5 forms
156: [02:18:05] <mobiusnz> oh yeah, only 2 years ago
157: [02:18:06] <mobiusnz> https://github.com/mobiusnz/silverstripe-html5formfields
158: [02:24:40] <mobiusnz> needs a bit of work
159: [02:26:39] * SightUnseen has joined #silverstripe
160: [02:28:49] * stellalie quit (Ping timeout: 260 seconds)
161: [02:28:50] * mobiusnz quit (Read error: Connection reset by peer)
162: [02:30:08] * mobiusnz has joined #silverstripe
163: [02:30:46] <metanat> Is it possible to use GridField for has one relations?
164: [02:31:50] * clodeindustrie has joined #silverstripe
165: [02:32:46] * clodeindustrie quit (Client Quit)
166: [02:53:57] * mattybalaam has joined #silverstripe
167: [02:54:14] <mobiusnz> I hate segfaults
168: [02:55:06] <zippy__> apache segfaults?
169: [02:55:59] <mobiusnz> yeah
170: [02:56:40] <zippy__> op code caching on?
171: [02:58:41] * mattybalaam quit (Ping timeout: 260 seconds)
172: [02:59:20] <mobiusnz> not as far as I'm aware
173: [02:59:29] <mobiusnz> local install of apache on my laptop
174: [03:02:10] <mobiusnz> found the problem - inherited function didn't have same method signature. I wish that would just show me a php fatal error rather than crashing apache
175: [03:02:58] <nikrolls> That usually crashes Apache for me too (I have to check the logs), but I've never seen a segfault from it
176: [03:07:11] * dospuntocero quit (Remote host closed the connection)
177: [03:09:07] * supernovah has joined #silverstripe
178: [03:18:11] <supernovah> How do I use a url that's mysite.com/action/id/otherid where I've supplied action and want to show a different template section?
179: [03:18:56] <nikrolls> Do you want to know how to create a different template for it, or how to generate the URL?
180: [03:19:26] <supernovah> The URL is static, I just want a form to come up when I go to /action
181: [03:19:39] <nikrolls> Oh, a static route
182: [03:20:12] <supernovah> I'm looking for a tutorial that explains it all
183: [03:20:25] <nikrolls> Not sure about routing directly to a controller. Usually the naming convention is ControllerClassName_action.ss
184: [03:20:53] * zippy__ quit (Quit: zippy__)
185: [03:21:11] <nikrolls> So a controller called MyController_Controller would look for a template called MyController.ss -- and if an action is called on it, then it suffixes it with _actionName
186: [03:21:22] <nikrolls> That may or may not work for routes
187: [03:22:04] <supernovah> so I need a class mycontroller_controller_actionname
188: [03:22:39] <supernovah> Oh right no sorry I read that wrong
189: [03:22:57] <nikrolls> MyController_actionName.ss would usually do it with page controllers
190: [03:23:06] <nikrolls> Or rather, ContentController subclasses
191: [03:24:58] * stellalie has joined #silverstripe
192: [03:27:54] <supernovah> This doesn't seem the way to do it lol
193: [03:28:17] <supernovah> What would be the standard way to have a form show up in my template when I access the "action" "add" for example
194: [03:28:30] <supernovah> I've allowed the action by that name
195: [03:32:19] <supernovah> Does the function in the controller it's inside with the name of the action get called when you visit the page with that action?
196: [03:32:37] <nikrolls> Yep
197: [03:39:53] <supernovah> The guy before me has done elsewhere in a page_controller extension class, public function action = new actionForm($this, "actionForm"), and has a file in mysite/forms called actionForm.php and it works
198: [03:40:15] <supernovah> I do the same and it tells me no class found in my controllers php file
199: [03:41:38] <supernovah> oops he has, public function action(){return new actionForm($this, "actionForm")} and it finds the file in mysite/forms which has those params in its constructor and the name actionForm
200: [03:41:44] <supernovah> which I replicated
201: [03:42:20] <nikrolls> A form of classname ActionForm will look for a template of name ActionForm.ss when you try to render it in a template
202: [03:43:46] <Pyromanik> 14:06 < supernovah> [...] I guess I'm just not used to MVC virtually isolating view and controller
203: [03:43:52] <Pyromanik> It's not really MVC if it's not.
204: [03:44:09] <supernovah> >_>
205: [03:44:24] <supernovah> by it I mean SS finds it
206: [03:45:03] <Pyromanik> supernovah: make a controller
207: [03:45:08] <Pyromanik> named action
208: [03:45:27] <Pyromanik> that's it.
209: [03:45:51] <supernovah> which extends form in this case?
210: [03:45:56] <Pyromanik> no
211: [03:46:01] <Pyromanik> form is not a controller
212: [03:46:08] <Pyromanik> it's a request handler, yes.
213: [03:46:20] <supernovah> I am so confused
214: [03:46:26] <Pyromanik> how?
215: [03:46:37] <supernovah> because he has only what I told you on another part of the site
216: [03:46:38] <Pyromanik> class action extends Controller { }
217: [03:46:38] <supernovah> and it works
218: [03:47:03] <supernovah> I did a file contents search for his URLSegmentForm and it comes up in his controller only
219: [03:47:11] <supernovah> With the code I wrote
220: [03:47:16] <Pyromanik> 15:19 < nikrolls> Not sure about routing directly to a controller.
221: [03:47:40] <Pyromanik> Director calls a controller named url segment if there are no rules overriding that.
222: [03:47:56] <Pyromanik> eg you can load yoursite/Page_Controller
223: [03:48:20] <nikrolls> Pyromanik: ooh, interesting. Always thought routes were required
224: [03:48:46] <Pyromanik> nikrolls: they are. But there are default routes as part of Framework
225: [03:48:56] <nikrolls> Gotcha
226: [03:48:59] <Pyromanik> y'know, to make things work and all
227: [03:50:05] <Pyromanik> supernovah: again, more info required.
228: [03:50:11] <Pyromanik> you're asking a question, not telling us your problem.
229: [03:50:13] <nikrolls> Right, didn't realise there was a default that searched for them by name. I guess that's how you can call a Task by its name
230: [03:50:18] <Pyromanik> so we don't give the right answers.
231: [03:50:26] <Pyromanik> because we answer your question, not solve your problem.
232: [03:50:32] <supernovah> Haha okay
233: [03:50:39] <supernovah> I'm going to prep something on sspaste
234: [03:50:42] <Pyromanik> nikrolls: yeh. It's how you use framework without CMS.
235: [03:50:50] <nikrolls> Ah of course
236: [03:50:53] <nikrolls> Good to know
237: [03:51:03] <nikrolls> Thanks
238: [03:52:31] <supernovah> http://sspaste.com/paste/show/51b7f04bef0f0
239: [03:52:52] <supernovah> And the error of course is Fatal error: Class 'CreditForm' not found in C:\xampp\htdocs\mysite\code\Pages\Credits.php on line 70
240: [03:53:44] <supernovah> And I put in credit.php just to show you the $db
241: [03:54:02] <Pyromanik> supernovah: for starters ?> is always a bad idea in pure php files.
242: [03:54:30] <supernovah> True didn't notice I'd done that
243: [03:54:37] <Pyromanik> white space or other characters ruin all the things
244: [03:54:49] <nikrolls> As an aside, I would take out the forTemplate function as it stands. Currently it's only replicating (or rather restricting) built-in functionality.
245: [03:54:49] <Pyromanik> yeah well you might not have, could have been the chap before you, I dunno.
246: [03:54:52] <Pyromanik> just pointing it out
247: [03:54:55] <Pyromanik> yeah
248: [03:54:57] * mattybalaam has joined #silverstripe
249: [03:55:00] <Pyromanik> fortemplate is pointless
250: [03:55:12] <supernovah> Okay well now it at least finds it hah
251: [03:55:18] <nikrolls> forTemplate will already look for Form.ss when it can't find CreditForm.ss
252: [03:55:32] <nikrolls> Because of class inheritance
253: [03:55:55] <Pyromanik> although
254: [03:55:58] <Pyromanik> why CreditForm?
255: [03:56:12] <Pyromanik> why not just make a normal Form?
256: [03:56:24] * cloph_away quit (Read error: Operation timed out)
257: [03:57:00] <supernovah> I was testing to see if the name was an issue
258: [03:57:13] <supernovah> now I have security ID's don't match, possible CSRF attack
259: [03:57:20] <supernovah> or token
260: [03:57:27] * cloph_away has joined #silverstripe
261: [03:57:33] * joelpittet has joined #silverstripe
262: [03:58:25] <Pyromanik> you need to refresh the controller
263: [03:58:38] <Pyromanik> that'll happen if you try to access the form directly
264: [03:59:02] * mattybalaam quit (Ping timeout: 240 seconds)
265: [03:59:58] <Pyromanik> supernovah: so what is it you want to achieve with this controller?
266: [04:00:02] <Pyromanik> / page
267: [04:00:35] <supernovah> I just want to have the user be able to add credits
268: [04:00:53] <supernovah> with a form that doesn't have all the other template info in it
269: [04:01:50] <Pyromanik> template info?
270: [04:02:05] <Pyromanik> you mean you don't want it to render with a full page?
271: [04:02:14] <Pyromanik> ie. ajax
272: [04:02:27] <Pyromanik> or you don't want it to render with CreditPage's content and stuff?
273: [04:02:47] <supernovah> I don't want creditpages template stuff
274: [04:02:49] <Pyromanik> ie show header and footer, etc but only a form instead of content?
275: [04:02:53] <Pyromanik> right
276: [04:02:54] <Pyromanik> well
277: [04:02:57] <supernovah> because it contains random stuff like welcome boxes and etc
278: [04:03:01] <Pyromanik> CreditPage_Controller
279: [04:03:12] <Pyromanik> public function add() {
280: [04:03:13] <Pyromanik> }
281: [04:03:18] <Pyromanik> return $this
282: [04:03:26] <Pyromanik> (inside the function obviously)
283: [04:03:33] <supernovah> ya
284: [04:03:37] <Pyromanik> that's it.
285: [04:03:44] <Pyromanik> add 'add' to $allowed_actions
286: [04:03:51] <Pyromanik> make a template CreditPage_add.ss
287: [04:03:55] <Pyromanik> have $Form in it.
288: [04:03:59] <Pyromanik> done.
289: [04:04:06] <Pyromanik> OR
290: [04:04:33] <Pyromanik> you could <% if Action == add %> $Form <% else %> (all the current template stuff) <% end_if %> in the CreditPage.ss
291: [04:04:56] <Pyromanik> That's it man.
292: [04:05:13] <Pyromanik> were $Form might be $CreditForm though.
293: [04:05:39] <supernovah> I see
294: [04:05:50] <nikrolls> It's a pattern you'll get *really* used to before long, but can be a little confusing the first time
295: [04:06:28] <Pyromanik> it's not that confusing.
296: [04:06:32] <Pyromanik> it goes like this:
297: [04:06:48] <Pyromanik> A url is basically a Controller
298: [04:06:56] <Pyromanik> an action is a method on that controller
299: [04:07:24] <Pyromanik> $ID and $OtherID are parameters (so use them insstead of ?blah=derp&wtf=ohnoes
300: [04:07:27] <Pyromanik> )
301: [04:07:34] <nikrolls> :D
302: [04:07:48] <supernovah> When you said CreditPage did you mean just Credits (with an s?)
303: [04:07:59] <Pyromanik> and that makes up the director rule $URLSegment//$Action/$ID/$OtherID
304: [04:08:20] <Pyromanik> supernovah: copy and paste what you're referring to?
305: [04:08:36] <supernovah> Pyromanik CreditPage_Controller
306: [04:08:46] * metanat has left #silverstripe
307: [04:08:52] <supernovah> Because I already have Credits_Controller extends Page_Controller
308: [04:09:25] <Pyromanik> supernovah: Yes, I mean make your function add IN that class
309: [04:09:33] * Pat_tas has joined #silverstripe
310: [04:09:42] <supernovah> I just got it thanks man
311: [04:09:52] <Pat_tas> anyone know why search would be returning results from /framework and /assets etc?
312: [04:10:07] <Pat_tas> when it should really only return pages?
313: [04:10:50] <supernovah> Thanks nikrolls and Pryomanik
314: [04:11:10] <nikrolls> No worries, hope I was a help at some point :)
315: [04:12:52] <Pat_tas> or better yet, restrict /assets from FullTextSearchable?
316: [04:14:36] <Pyromanik> http://sspaste.com/paste/show/51b7f04bef0f0
317: [04:14:44] <Pyromanik> see comment
318: [04:14:47] <Pyromanik> Oh he left :<
319: [04:15:07] <nikrolls> Yeah
320: [04:15:57] <Pyromanik> Pat_tas: because FulltextSearchable::enable() searches Page content AND Asset content by default.
321: [04:16:05] <Pyromanik> you can choose either or both, but no other classes.
322: [04:16:49] <Pyromanik> Pat_tas: http://api.silverstripe.org/3.0/class-FulltextSearchable.html
323: [04:16:57] <Pat_tas> <Pyromanik> thanks
324: [04:17:05] <Pyromanik> FulltextSearchable::enable(array('SiteTree'));
325: [04:17:18] <Pyromanik> will exclude Files (/assets)
326: [04:22:31] <Pat_tas> <Pyromanik> blegh - we're using Solr
327: [04:27:21] * Stomach quit (Quit: Leaving.)
328: [04:47:17] * Pyromanik quit (Quit: leaving)
329: [04:47:41] * Stomach has joined #silverstripe
330: [04:48:24] <Peavers> is there a quick way to group pages by their date field just like the blog sidebar widget does?
331: [04:48:42] <Peavers> ..I can't find that code that does this to copy it, so if anyone knows where that is...
332: [04:54:15] * Stomach quit (Quit: Leaving.)
333: [05:00:50] * mobiusnz quit (Quit: Leaving.)
334: [05:00:59] <Bollig|DesignCty> Anyone know how I can get the Virtual Page I'm on via PHP, rather than the page it's replicating?
335: [05:02:02] * DigNZ quit (Quit: DigNZ)
336: [05:09:23] * supernovah has joined #silverstripe
337: [05:09:50] * nickmolhoek quit (Quit: nickmolhoek)
338: [05:10:27] <supernovah> Hey guys, me again :( Is there a default form handler class that identifies when a form was submitted (a form made by the Form class)
339: [05:10:48] <supernovah> And can tell me the data etc, to avoid leaving the framework to do it I mean
340: [05:11:06] <nikrolls> By default, it's handled by the same function that generates the form in the first place
341: [05:11:24] <nikrolls> At the top level, anyway. Then SS will call the function matching the name of the action clicked
342: [05:11:55] <supernovah> I noticed that
343: [05:12:16] <supernovah> It seems to be more a result of ending up at the action in the URL
344: [05:12:48] <nikrolls> Yeah, the form action is the function that defines the form. You could override the form action but then you're losing built in functionality
345: [05:12:51] * Peavers quit (Ping timeout: 256 seconds)
346: [05:13:21] <nikrolls> Usually you create an action (button) and then a function in the controller with the same name, which is passed the form object and the form data as parameters
347: [05:16:21] <supernovah> Ya I have that, actions and a fieldset right?
348: [05:16:43] <nikrolls> Yep
349: [05:17:00] <supernovah> I know the framework has a built in form validator which I wanted to use
350: [05:17:06] <nikrolls> new FormAction('submit') will call a function called submit
351: [05:17:12] <nikrolls> From memory
352: [05:18:21] <supernovah> Oh I see! I calls the first member of the actions map and passes it the formdata and form
353: [05:18:24] <supernovah> it*
354: [05:18:29] <supernovah> I can still use that cool
355: [05:19:09] <nikrolls> Well it should call the function matching the FormAction name, but yep, you get an assoc array and a $form object
356: [05:19:14] <nikrolls> *Form object
357: [05:19:21] <supernovah> I'm just trying to separate different parts of the controller and its forms to minimise the size of files
358: [05:19:36] <supernovah> If you're wondering
359: [05:21:46] <supernovah> I mean separate them into their own files/templates etc
360: [05:22:18] <nikrolls> Yeah, I've done some work similar to that recently. Not only does it make them easier to manage, it also means your user flow is less likely to break if they refresh a result page or something
361: [05:23:15] <nikrolls> I've found the key is to always redirect to the result page on success rather than render on the action -- because then you stop them refreshing and submitting the form again, or breaking the flow
362: [05:25:38] <supernovah> Haha yes!
363: [05:26:33] * supernovah quit (Read error: Connection reset by peer)
364: [05:27:02] * supernovah has joined #silverstripe
365: [05:29:15] * Hippieeee has joined #silverstripe
366: [05:30:10] <MrJeremy> Wishing there was overloading of has_ones
367: [05:30:17] * Hippieee quit (Ping timeout: 255 seconds)
368: [05:30:46] <supernovah> hmm I have a problem, my form seems to be inheriting the form action (in the DOM) by the name of the class which extends the form which creates it even though I have an actions array which tells it to do otherwise
369: [05:32:30] <supernovah> as in `$actions = new FieldSet(new FormAction('add',"Add"));` is given to the parent::__construct(...), yet the forms action comes up as the classes name
370: [05:33:19] <nikrolls> new Form($this, $name, ...)
371: [05:33:32] <nikrolls> $name is the name of the form, and therefore the action that is called on submit
372: [05:33:53] <nikrolls> *after* that, 'add' will be called with the usual data
373: [05:37:24] <supernovah> Can you make the name something, the actual sapphire form.php doesn't seem to allow it
374: [05:41:34] <supernovah> Because my form given the action add, wants to make its action "mysite.com/add" not "mysite.com/URLSegment/add"
375: [05:42:27] <nikrolls> Hmm, usually it builds it going by the URL of the controller passed as the first argument
376: [05:42:41] <supernovah> Yes it does that
377: [05:42:57] <supernovah> which is irritating, because then I can't have multiple parts of the site with the same name
378: [05:43:01] <supernovah> and my urls look dumb
379: [05:43:15] <supernovah> mysite.com/feature/feature_add, mysite.com/feature2/feature2_add
380: [05:43:34] <nikrolls> The action should be something like mysite.com/MyController/MyFormName
381: [05:44:04] <supernovah> If you make it as a new form($this, $name) it might
382: [05:44:20] <supernovah> but this is a class becomingTheAction extends form
383: [05:44:43] <supernovah> Fuck it I'm going to have beer
384: [05:44:46] <supernovah> bb
385: [05:50:16] <nikrolls> supernovah: So if you see this, don't access the form class by URL, instead access a controller that outputs the Form, like Pyromanik suggested. Then you can use 'new Form', etc, and get standard functionality
386: [06:18:00] * zfmf1 has joined #silverstripe
387: [06:20:17] * SightUnseen has left #silverstripe
388: [06:28:55] * kinglozzer has joined #silverstripe
389: [06:32:07] * stellalie quit (Ping timeout: 240 seconds)
390: [06:44:23] * nikrolls needs key shortcuts in the CMS
391: [06:44:34] <nikrolls> I keep pressing Ctrl+S to save the page
392: [06:55:48] * Liquide quit ()
393: [06:58:24] * openbees has joined #silverstripe
394: [07:07:01] * SightUnseen has joined #silverstripe
395: [07:07:07] * SightUnseen has left #silverstripe
396: [07:08:12] * Bollig|DesignCty quit (Quit: Bollig|DesignCty)
397: [07:12:53] * Sjohn has joined #silverstripe
398: [07:16:15] * hubertusanton has joined #silverstripe
399: [07:16:33] * ARNHOE has joined #silverstripe
400: [07:17:01] * joelpittet quit (Remote host closed the connection)
401: [07:22:09] * MrJeremy quit (Quit: MrJeremy)
402: [07:32:02] * ARNHOE quit (Remote host closed the connection)
403: [07:33:02] * Zauberfisch|idle has joined #silverstripe
404: [07:34:37] * ARNHOE has joined #silverstripe
405: [07:36:47] * Zauberfisch^idle quit (Ping timeout: 256 seconds)
406: [07:43:55] * LoveDuckie quit (Read error: Connection reset by peer)
407: [07:45:58] * g4b0_ has joined #silverstripe
408: [07:51:15] * willr_ has joined #silverstripe
409: [07:51:15] * willr_ quit (Changing host)
410: [07:51:15] * willr_ has joined #silverstripe
411: [07:58:03] * mattybalaam has joined #silverstripe
412: [07:59:01] * mento has joined #silverstripe
413: [08:02:43] * mattybalaam quit (Ping timeout: 248 seconds)
414: [08:04:12] * chillu has joined #silverstripe
415: [08:05:24] * popeshoe has joined #silverstripe
416: [08:05:52] * C10ne has joined #silverstripe
417: [08:09:01] * gumble has joined #silverstripe
418: [08:09:15] * osterlaus has joined #silverstripe
419: [08:10:29] <gumble> hey, can someone point me to a nice workflow showing how to move a silverstripe site to a new server?
420: [08:19:10] <nikrolls> Hmm, I don't have a workflow
421: [08:19:33] <nikrolls> But I manage a migration script
422: [08:19:43] <nikrolls> Broken into two parts: filesystem and db
423: [08:21:14] <nikrolls> So you're generally good to zip up the files and export the db, then import the db on the new server and extract the files to the new docroot
424: [08:22:49] <nikrolls> Main consideration is if the site uses an _ss_environment.php file -- you will have to configure either this or mysite/_config.php
425: [08:22:54] <nikrolls> For the new environment
426: [08:24:16] * mrzero_ has joined #silverstripe
427: [08:24:16] * mrzero_ quit (Changing host)
428: [08:24:16] * mrzero_ has joined #silverstripe
429: [08:24:35] <nikrolls> Don't know if that helps or not?
430: [08:26:05] * priithansen has joined #silverstripe
431: [08:27:08] * lobarvaz has joined #silverstripe
432: [08:27:24] * travis-ci has joined #silverstripe
433: [08:27:24] <travis-ci> [travis-ci] silverstripe/silverstripe-framework#271 (3.1 - 4df7f5f : Ingo Schommer): The build passed.
434: [08:27:24] <travis-ci> [travis-ci] Change view : https://github.com/silverstripe/silverstripe-framework/compare/dfdb274773ef...4df7f5f0f859
435: [08:27:24] <travis-ci> [travis-ci] Build details : http://travis-ci.org/silverstripe/silverstripe-framework/builds/8008641
436: [08:27:24] * travis-ci has left #silverstripe
437: [08:28:21] * mrzero quit (Ping timeout: 245 seconds)
438: [08:28:22] * mrzero_ is now known as mrzero
439: [08:29:15] * ARNHOE quit (Remote host closed the connection)
440: [08:29:56] <willr_> gumble if you're on UNIX based machines check out https://github.com/sminnee/sspak
441: [08:30:47] <willr_> packages up an ss install to a single file allowing you to import on the new server easily. But all you really need to do is copy the database and assets
442: [08:31:49] <gumble> willr_, why the assets? I found another workflow which told: install ss, copy mysite/code/ and themes/ directory, import database, run /dev/build
443: [08:31:55] <gumble> I am trying this atrm
444: [08:32:09] <willr_> Well assets has your CMS file uploads
445: [08:32:16] <nikrolls> Assets will be referred to in the DB
446: [08:32:19] <nikrolls> If an existing site
447: [08:32:29] <willr_> You probably want to keep those uploaded files if you have CMS authors uploading files :)
448: [08:32:58] <willr_> Also the old documentation had steps for moving a site - https://github.com/mattclegg/silverstripe-doc-restructuring/blob/master/input/recipes/publishing-to-web-server.txt
449: [08:33:36] <nikrolls> @willr_: sspak looks interesting
450: [08:34:38] <gumble> ok thanks guys!
451: [08:35:01] <gumble> I think I'll just import the database, move assets and hope it works
452: [08:38:30] <gumble> does anyone know a nice mysql client gui for linux/gnome?
453: [08:39:03] * aragonne has joined #silverstripe
454: [08:39:47] <aragonne> hey guys, in SilverStripe 3, is there a method I to check if a page is currently live/published?
455: [08:42:26] <nikrolls> isPublished looks like the one
456: [08:42:39] <nikrolls> SiteTree#isPublished()
457: [08:43:33] <aragonne> thanks nikrolls!
458: [08:43:37] <nikrolls> :)
459: [08:45:32] * gordon__ is now known as elgrodo
460: [08:47:23] <elgrodo> what's the best way of dealing with a has_one relationship when editing, if the number of products in the dropdown is sufficiently large to hang the browser?
461: [08:47:52] <elgrodo> Trying GridFieldHasOneRelationHandler but it looks like I would still need to load several thousand items on one page
462: [08:48:27] <elgrodo> I therefore seek the advice of the wise old silverstripe men
463: [08:57:19] <elgrodo> I am surprised there is no has one AJAX field for this case
464: [08:57:23] <elgrodo> *sadface*
465: [08:58:53] <kinglozzer> The only AJAX dropdown as far as I'm aware is the TreeDropdownField
466: [08:59:07] <kinglozzer> But that's not designed for thousands of items :/
467: [08:59:47] * mattybalaam has joined #silverstripe
468: [09:00:32] <kinglozzer> Can you set the relationship the other side? As in on the product side
469: [09:03:29] * Colin[pi] quit (Ping timeout: 256 seconds)
470: [09:04:54] * mattybalaam quit (Ping timeout: 276 seconds)
471: [09:08:52] * travis-ci has joined #silverstripe
472: [09:08:52] <travis-ci> [travis-ci] silverstripe/silverstripe-framework#272 (3.1 - 25ba77d : Ingo Schommer): The build passed.
473: [09:08:52] <travis-ci> [travis-ci] Change view : https://github.com/silverstripe/silverstripe-framework/compare/4df7f5f0f859...25ba77d333b0
474: [09:08:52] <travis-ci> [travis-ci] Build details : http://travis-ci.org/silverstripe/silverstripe-framework/builds/8009671
475: [09:08:52] * travis-ci has left #silverstripe
476: [09:12:57] <gumble> I have a phpmyadmin directory on the localhost, but when I go to 127.0.0.1/phpmyadmin directory, silverstripe shows me it can't find the directory
477: [09:13:08] <gumble> i mean i get default 404 page
478: [09:13:17] <gumble> because silverstripe is handling the url
479: [09:14:48] <nikrolls> Is the phpmyadmin folder in the SS siteroot?
480: [09:17:02] <nikrolls> If so then /phpmiadmin/index.php *may* work, but better would be to A) move it outside and set up an alias in Apache, or B) create an exception for that folder in the .htaccess file in SS root
481: [09:17:12] <nikrolls> */phpmyadmin/index.php
482: [09:18:12] * travis-ci has joined #silverstripe
483: [09:18:12] <travis-ci> [travis-ci] silverstripe/silverstripe-framework#273 (3.1 - ab9e028 : Ingo Schommer): The build passed.
484: [09:18:12] <travis-ci> [travis-ci] Change view : https://github.com/silverstripe/silverstripe-framework/compare/25ba77d333b0...ab9e0286f049
485: [09:18:12] <travis-ci> [travis-ci] Build details : http://travis-ci.org/silverstripe/silverstripe-framework/builds/8009846
486: [09:18:12] * travis-ci has left #silverstripe
487: [09:18:31] <gumble> nikrolls, I have it in another folder and I am using a symbolic link but it doesn't work
488: [09:18:58] <nikrolls> Instead of a symbolic link you could use an Apache alias like the default install on Ubuntu does
489: [09:19:07] <nikrolls> That will kick in before SS
490: [09:19:20] <nikrolls> Otherwise you could exclude that folder from SS's rewrite it /.htaccess
491: [09:19:30] <gumble> nikrolls, how do I set up apache alias? I'm not on ubuntu
492: [09:20:52] <nikrolls> I will get you a gist
493: [09:20:56] <nikrolls> Of one of ours
494: [09:21:09] <nikrolls> Ubuntu not required, it's just the way apt-get does it
495: [09:22:48] <nikrolls> This is probably way overqualified
496: [09:22:49] <nikrolls> https://gist.github.com/nikrolls/7fa6dc9b0a6086a75fcf
497: [09:22:59] <nikrolls> But you get the idea
498: [09:23:17] <nikrolls> You'd remove the symlink from the SS root and point to it via this conf
499: [09:23:27] <nikrolls> And the conf can go in with your Vhosts
500: [09:24:02] <nikrolls> Note that this configures for *all* vhosts -- if you want it for just one then declare it within that vhost itself
501: [09:24:06] <nikrolls> Hope that makes sense
502: [09:24:35] <gumble> yes, thanks very much nikrolls, I am now looking at it
503: [09:24:48] <nikrolls> Welcome :)
504: [09:32:59] <kinglozzer> Anyone in here know much AngularJS? I have a $scope.backgroundUrl, I don't want to set the background url to be '' if it's blank, so I need to do an 'if'. Apparently Angular doesn't do 'ifs' though :(
505: [09:40:08] * osterlaus quit (Quit: Leaving.)
506: [09:45:22] <Sjohn> Hi everyone
507: [09:46:24] <Sjohn> Is there a code snippet for silverstripe that limits the root items in the sitetree? (I want there to be max 6 root items)
508: [09:49:38] <nikrolls> I haven't come across anything like that so far
509: [09:49:46] <nikrolls> What's the purpose? Is it because of the menu?
510: [09:51:10] * cloph_away quit (Remote host closed the connection)
511: [09:53:15] <nikrolls> If so I'd limit the menu items rendered rather than the number of items at the top level. The reason being that they can have items at the top level that are hidden from menus, if they want convenient top-level URLs for example
512: [10:01:34] * gumble quit (Ping timeout: 240 seconds)
513: [10:09:55] <C10ne> Anybody knows why the backend doesn't load templated js on first opening of edit form, but only on refresh?
514: [10:12:38] <kinglozzer> Sjohn: public function canCreate($member=null) { return (SiteTree::get()->filter('ParentID', 0)->count() <= 6); }
515: [10:13:04] <kinglozzer> Not an ideal solution though, they can still drag pages from lower down to the top level
516: [10:13:34] <kinglozzer> We normally allow clients to add as many as they like, and just tell them that only the first 6 items will be displayed in the nav menu
517: [10:13:48] <kinglozzer> As nikrolls said ^^
518: [10:17:45] <nikrolls> On a slightly related note, I've found that SS will 'search' for nested URL segments that you try to access at the root level. Eg: /info/win/ could be accessed via /win/, and SS will figure it out and redirect you
519: [10:18:08] <nikrolls> As long as there is no /win/ page already, that is
520: [10:20:50] <Sjohn> kinglozzer: I think that will do though, thanks for your help :)
521: [10:24:35] * nikrolls quit (Ping timeout: 255 seconds)
522: [10:26:39] * r3v3rb has joined #silverstripe
523: [10:27:00] * mattybalaam has joined #silverstripe
524: [10:29:07] <Sjohn> Nikrolls solution would be to limit the output of the menu right? like : <% control Navigation(2) %> ?
525: [10:31:47] <kinglozzer> Sjohn: <$ loop Menu(1).Limit(6) %> I think
526: [10:31:58] * willr_ quit (Quit: willr_)
527: [10:44:00] * lx-berlin_ has joined #silverstripe
528: [10:45:29] <mattybalaam> Does anyone know how can I add my own function tho those in DBField? abstract class DBField extends ViewableData
529: [10:58:19] * r3v3rb kicks wall in frustration at allowing scope to cause me an hour of debugging I needn't have bothered with! GRRRR
530: [11:00:50] <priithansen> mattybalaam: something like this should work http://www.sspaste.com/paste/show/51b8547ee8c13
531: [11:02:02] <mattybalaam> Thanks, I will give that a go.
532: [11:07:06] * gumble has joined #silverstripe
533: [11:08:49] * zfmf1 has left #silverstripe
534: [11:25:25] <mattybalaam> It’s not working as I hope. If I put this code in DBfield.php it works: public function RAW2URL() { return Convert::raw2url($this->value); } but in a class called ExtraDBFields with the extension called in config I get this error: [Notice] Undefined property: ExtraDBFields::$value
535: [11:27:07] * svandragt has joined #silverstripe
536: [11:29:08] <svandragt> On my production webserver containing multiple silverstripe sites, after adding and picking a cache backend, I get php errors where extensions from one site are applied to another. clearly the caches are getting mixed up. anyone have tips? I have picked a unique cache name I think.
537: [11:29:17] <svandragt> http://pastie.org/8036851
538: [11:32:35] <C10ne> Anybody knows why the backend doesn't load templated js on first opening of edit form, but only on refresh?
539: [11:32:49] <priithansen> mattybalaam: try $this->parent->value
540: [11:32:51] <C10ne> How can that be fixed?
541: [11:34:17] <priithansen> mattybalaam: ignore the last one $this->owner->value should be the right way
542: [11:37:06] <gumble> why does silverstripe have to spitt out mysql password/username stuff in error logs?
543: [11:37:13] <gumble> i mean errors
544: [11:37:15] <gumble> not logs
545: [11:37:31] <gumble> when you get this can't connect to mysql and its showing everything
546: [11:40:28] <priithansen> gumble: use live mode in production
547: [11:55:15] * LoveDuckie has joined #silverstripe
548: [11:55:33] <LoveDuckie> Does anyone know how I can access a list of a has_many field within the page controller?
549: [11:55:48] * travis-ci has joined #silverstripe
550: [11:55:49] <travis-ci> [travis-ci] chillu/silverstripe-cms#41 (pulls/sitetree-urlsegment-votes - 0c4b2f8 : Ingo Schommer): The build passed.
551: [11:55:49] <travis-ci> [travis-ci] Change view : https://github.com/chillu/silverstripe-cms/compare/97489b6b18d0^...0c4b2f815764
552: [11:55:49] <travis-ci> [travis-ci] Build details : http://travis-ci.org/chillu/silverstripe-cms/builds/8013425
553: [11:55:49] * travis-ci has left #silverstripe
554: [11:56:00] <kinglozzer> LoveDuckie: $this->RelationName()
555: [11:56:58] <LoveDuckie> Yeah just comes out empty
556: [11:57:05] <LoveDuckie> I have Gallery as a has_many field
557: [11:57:09] <LoveDuckie> basically trying to pull that down
558: [11:58:20] <kinglozzer> That's the syntax for it, try echo $this->RelationName()->count();die; and see if there's anything actually in there
559: [12:00:38] * mattybalaam quit (Quit: mattybalaam)
560: [12:01:13] <LoveDuckie> Ah yeah, got what I wanted now.
561: [12:02:26] <LoveDuckie> Thanks.
562: [12:03:47] * UndefinedOffset has joined #silverstripe
563: [12:08:28] * osterlaus has joined #silverstripe
564: [12:13:35] * mattybalaam has joined #silverstripe
565: [12:14:40] <mattybalaam> Thanks pritthansen, works like a treat now!
566: [12:15:06] * Shrike_Finland has joined #silverstripe
567: [12:21:14] * openbees quit (Quit: Leaving)
568: [12:35:49] <C10ne> Anyone knows why Requirements::javascriptTemplate doesn't work until refresh in cms?
569: [12:36:44] <kinglozzer> C10ne: Where are you using it?
570: [12:37:02] <kinglozzer> I think there's an issue with using Requirements when editing something that's attached to a page
571: [12:38:14] <kinglozzer> martimiz mentioned something similar a few days ago
572: [12:39:11] * ARNHOE has joined #silverstripe
573: [12:40:25] <C10ne> kinglozzer: Yeah, on dataobjects within a page
574: [12:40:48] <C10ne> Just never loads custom js, or templated ones.
575: [12:41:48] <kinglozzer> Yep, exactly what martimiz described. One possible solution is to use entwine, load the custom JS on the page (load it 'early'), then use an onmatch event to detect when the dataobject edit form has been loaded
576: [12:47:29] <C10ne> I did try that, but only the data object has the data necessary to fill the custom variables, so it can't be loaded earlyer
577: [12:49:34] * lx-berlin_ has left #silverstripe
578: [12:57:25] * gumble quit (Ping timeout: 264 seconds)
579: [12:57:35] * elgrodo is dealing with a 3.0.2 site at the moment. When dealing with the GridFieldConfig_RelationEditor
580: [12:57:45] <elgrodo> if there an option to configure it to do detach instead of delete?
581: [13:03:55] * Shrike_Finland quit (Quit: Leaving.)
582: [13:16:32] * ARNHOE quit (Remote host closed the connection)
583: [13:29:53] <elgrodo> it's in the constructor for GridFieldDeleteAction - the default false renders the delete button, true renders the unlink button
584: [13:30:05] <elgrodo> and of course the default is the delete button
585: [13:30:09] <elgrodo> nooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo!
586: [13:31:22] * r3v3rb quit (Quit: r3v3rb)
587: [13:34:24] <UndefinedOffset> elgrodo that was fixed in 3.0.3 i believe
588: [13:34:39] <elgrodo> oh........
589: [13:34:45] <UndefinedOffset> you could hack around it if you cannot update the site to 3.0.5
590: [13:35:43] <elgrodo> the behaviour I observed was that the item was being deleted but not the relationship, and the client is expecting it to be the other way around
591: [13:35:51] <elgrodo> this is a handover project as well, boy it's a mess :(
592: [13:35:52] <UndefinedOffset> just remove the GridFieldDeleteAction and replace it with the same class but passing in true to the constructor of GridFieldDeleteAction
593: [13:36:19] <elgrodo> UndefinedOffset: Yip I realise that but if everything is scaffolded I either have to create all the forms by hand or hack the core
594: [13:36:28] <UndefinedOffset> if the relationship is a many_many relationship the relationship should unlink in 3.0.3+
595: [13:36:39] <UndefinedOffset> ya best bet update the core, problem solved :)
596: [13:37:12] <elgrodo> aha! https://github.com/silverstripe/silverstripe-framework/commit/9088692
597: [13:37:18] <elgrodo> Got your name beside it
598: [13:37:27] <UndefinedOffset> :)
599: [13:37:43] <UndefinedOffset> ya same as you it was driving me nuts and it was an easy fix https://github.com/silverstripe/silverstripe-framework/commit/9088692
600: [13:38:01] <UndefinedOffset> but updating the core if you can is always best anyways, fixes allot of security issues and other bugs
601: [13:38:17] <elgrodo> for sure
602: [13:38:26] <elgrodo> like the 'editing is very broken' bug :(
603: [13:39:23] <UndefinedOffset> lol mm
604: [13:40:45] <elgrodo> I'm dealing with some LOL worthy page rendering as well, such as a page of 20 images using 900 SQL queries and also loading every photo in the database for good measure
605: [13:41:00] <elgrodo> viewing a single image does the above, throws away the SQL, and then renders the single image
606: [13:47:39] <UndefinedOffset> lol
607: [13:55:01] <elgrodo> UndefinedOffset: I don't suppose you know if there is a nice has_one grid field editor?
608: [13:55:13] <elgrodo> problem I have is that a dropdown tries to render with 10,000 names and falls over
609: [13:55:27] <elgrodo> Simon's has one editor also has the same issue as i would to render 10,000 radio buttons
610: [13:55:51] * RojoD has joined #silverstripe
611: [13:55:52] * RojoD quit (Changing host)
612: [13:55:52] * RojoD has joined #silverstripe
613: [13:55:53] <elgrodo> would rather not have to write an ajaxy thing as I only estimated 0.4 hours for the task :(
614: [14:09:45] * Nivery has joined #silverstripe
615: [14:13:47] * RojoD is now known as ROJOD|WORK
616: [14:18:15] * stellalie has joined #silverstripe
617: [14:23:27] * priithansen quit (Quit: priithansen)
618: [14:29:16] * Shrike_Finland has joined #silverstripe
619: [14:30:02] * gumble has joined #silverstripe
620: [14:33:28] <svandragt> Ok so when I enable caching on my SS sites, the ConfigManifest is pushing manifests from other sites into the current one.
621: [14:34:07] <svandragt> 17.6822 19510552 5. require_once('/site2/public_html/cms/_config.php') /site1/public/framework/core/manifest/ConfigManifest.php:103
622: [14:34:36] <svandragt> is that a known bug?
623: [14:47:22] * gumble quit (Quit: Verlassend)
624: [14:50:13] * UncleCheese has joined #silverstripe
625: [14:51:11] * r3v3rb has joined #silverstripe
626: [14:51:22] * Shrike_Finland quit (Ping timeout: 276 seconds)
627: [14:53:01] <elgrodo> Why bother using database ids when you can use free text on names that are not unique in a table #fixingaclusterfuck
628: [14:57:05] * UncleCheese quit (Quit: UncleCheese)
629: [15:10:39] * Sjohn quit (Ping timeout: 250 seconds)
630: [15:18:37] * Zauberfisch|idle quit (Ping timeout: 256 seconds)
631: [15:19:26] * travis-ci has joined #silverstripe
632: [15:19:26] <travis-ci> [travis-ci] silverstripe/silverstripe-framework#275 (3.1 - 88595e3 : Ingo Schommer): The build passed.
633: [15:19:26] <travis-ci> [travis-ci] Change view : https://github.com/silverstripe/silverstripe-framework/compare/ab9e0286f049...88595e38f9cf
634: [15:19:26] <travis-ci> [travis-ci] Build details : http://travis-ci.org/silverstripe/silverstripe-framework/builds/8019812
635: [15:19:26] * travis-ci has left #silverstripe
636: [15:20:52] * Zauberfisch|idle has joined #silverstripe
637: [15:23:03] * jenst has joined #silverstripe
638: [15:24:27] <jenst> hello, anyone there that can help me with the translatable installation in SS 3.0.5?
639: [15:24:41] * micmania1 has joined #silverstripe
640: [15:34:23] * hubertusanton quit (Ping timeout: 252 seconds)
641: [15:52:08] * osterlaus has left #silverstripe
642: [15:56:02] * svandragt quit (Read error: Connection reset by peer)
643: [15:57:00] * g4b0_ quit (Quit: Sto andando via)
644: [16:00:38] * mento quit (Quit: Page closed)
645: [16:03:30] * priithansen has joined #silverstripe
646: [16:04:56] * jenst quit (Quit: Page closed)
647: [16:07:55] * mattybalaam quit (Quit: mattybalaam)
648: [16:10:01] * micmania1 quit (Ping timeout: 250 seconds)
649: [16:11:35] * guzzlefry_dev has joined #silverstripe
650: [16:16:44] * guzzlefry has joined #silverstripe
651: [16:36:33] * Guits has joined #silverstripe
652: [16:44:16] * lobarvaz quit (Remote host closed the connection)
653: [17:00:58] * UncleCheese has joined #silverstripe
654: [17:10:06] * mattybalaam has joined #silverstripe
655: [17:20:00] * Hippieeee quit (Read error: Connection reset by peer)
656: [17:21:05] * Guits quit (Ping timeout: 260 seconds)
657: [17:36:43] * UncleCheese quit (Quit: UncleCheese)
658: [17:41:06] * mattybalaam_ has joined #silverstripe
659: [17:41:07] * mattybalaam quit (Read error: Connection reset by peer)
660: [17:41:07] * mattybalaam_ is now known as mattybalaam
661: [17:45:34] * cloph_away has joined #silverstripe
662: [17:48:48] * cloph_away quit (Remote host closed the connection)
663: [17:48:55] * cloph_away has joined #silverstripe
664: [17:51:33] * cloph_away quit (Remote host closed the connection)
665: [17:54:58] * cloph_away has joined #silverstripe
666: [18:00:26] * cloph_away is now known as cloph
667: [18:00:58] * cloph is now known as cloph_away
668: [18:14:25] * LoveDuckie quit (Read error: Connection reset by peer)
669: [18:17:21] * popeshoe quit (Quit: This computer has gone to sleep)
670: [18:19:12] * guzzlefry is now known as guzz_afk
671: [18:20:00] * guzzlefry_dev quit (Quit: leaving)
672: [18:39:52] * Guits has joined #silverstripe
673: [18:49:29] * WilsonS has joined #silverstripe
674: [18:52:08] <WilsonS> Hi everyone. Quick question. I have a controller 'CollectionPage_Controller' and a dataobject 'Products'. I want to manipulate Products only in certain conditions. I have a method Products in the controller. How do I tell it to return the products it would've returned by default? I thought $this->data would do it but that's data from the CollectionPage class. Thanks!
675: [18:58:44] * r3v3rb has left #silverstripe
676: [19:01:47] <C10ne> Anyone knows why Requirements::javascriptTemplate doesn't work until refresh in cms?
677: [19:14:46] * gumble has joined #silverstripe
678: [19:15:49] <gumble> how do I make a PageType which isn't really a page but just the object? it won't have it's own page on the server, it's just used as child of other pages
679: [19:16:35] <FrozenFire> gumble, Google for "DataObjects as pages"
680: [19:16:51] <FrozenFire> You would have a Page which has a controller which can "serve" those DataObjects
681: [19:20:47] * joelpittet has joined #silverstripe
682: [19:21:08] <gumble> FrozenFire, thanks!
683: [19:34:41] * joelpittet quit (Remote host closed the connection)
684: [19:38:51] * willmorgan has joined #silverstripe
685: [19:38:55] * SightUnseen has joined #silverstripe
686: [19:39:31] * SightUnseen quit (Client Quit)
687: [19:39:46] * SightUnseen has joined #silverstripe
688: [19:40:00] * SightUnseen has left #silverstripe
689: [19:42:22] * Peavers has joined #silverstripe
690: [20:14:17] * cloph_away quit (Remote host closed the connection)
691: [20:14:54] * popeshoe has joined #silverstripe
692: [20:20:08] * mobiusnz has joined #silverstripe
693: [20:21:17] * WilsonS quit (Quit: Page closed)
694: [20:22:10] * cloph_away has joined #silverstripe
695: [20:23:36] * DigNZ has joined #silverstripe
696: [20:25:49] * UndefinedOffset quit (Quit: Leaving.)
697: [20:27:38] * ROJOD|WORK is now known as Rojod
698: [20:27:41] * Rojod is now known as RojoD
699: [20:44:29] * zippy__ has joined #silverstripe
700: [20:46:31] * Pyromanik has joined #silverstripe
701: [20:46:58] <Pyromanik> walls of GET /site-map
702: [20:47:17] <Pyromanik> from a handful of cyclic IPs
703: [20:47:25] <Pyromanik> how to prevent this?
704: [20:47:46] <zippy__> Hammering the server pretty hard?
705: [20:47:48] <ss23> cyclic?
706: [20:47:57] <Pyromanik> or, how to prevent apache from running OOM after such
707: [20:48:06] <Pyromanik> ss23: yeh, same ~10 IPs over and over
708: [20:48:08] <ss23> Shouldn't run OOM...
709: [20:48:18] <zippy__> SIlverstripe has memory leaks….
710: [20:48:18] <Pyromanik> why not?
711: [20:48:26] <Pyromanik> nothing to do with SS.
712: [20:48:30] <ss23> Using mpm prefork, Pyromanik?
713: [20:48:37] <Pyromanik> probably not :<
714: [20:48:40] <zippy__> you have to many apache workers running?
715: [20:48:44] <ss23> ^
716: [20:48:50] <Pyromanik> zippy__: yes, more like it.
717: [20:49:10] <ss23> Yuo need to figure out why it runs out of memroy. Like, does it run 20 apache processes at once? If so, lower the number of workers. If it runs 5 but they bloat to 2gb of memory each, make it restart workers sooner
718: [20:49:14] <zippy__> how much ram does the system have, what is the apache limits you have set? and how much % is a apache process yet
719: [20:49:24] <zippy__> *apache process using
720: [20:49:44] * Nivery quit (Quit: Nivery)
721: [20:51:06] <Pyromanik> ss23: yes
722: [20:51:07] <Pyromanik> well
723: [20:51:10] <Pyromanik> probably more like 50
724: [20:51:15] <Pyromanik> or more
725: [20:51:30] <Pyromanik> zippy__: ss23, I'm not a sysadmin :<
726: [20:51:33] <ss23> lol
727: [20:51:37] <ss23> Put on your sysadmin hat!
728: [20:51:42] <Pyromanik> ikr
729: [20:51:42] <zippy__> Pyromanik You got shell on the server?
730: [20:51:49] <Pyromanik> zippy__: yep
731: [20:52:12] <Pyromanik> do you want login info? it's root, and the password is lolnouthoughtjackpotrite?
732: [20:52:39] <zippy__> :P
733: [20:52:44] <Pyromanik> thanks in advance :P
734: [20:52:49] * Pyromanik giggles
735: [20:53:07] <zippy__> Pyromanik: login, and run 'top' - what is Mem: ……k total ? (e.g. Mem: 2097152k total)
736: [20:54:54] <Pyromanik> oh yeah I know how to top -.-
737: [20:55:22] <zippy__> Pyromanik: So how much ram does it have, and what processes are using the most ram?
738: [20:55:41] <zippy__> Pyromanik: and you know 'free -m' ? hows that looking?
739: [20:55:53] <Pyromanik> currently around ~200Mb free from 4Gb, and 2Gb swap, only 30Mb used.
740: [20:57:31] <Pyromanik> ~3.5% of mem per apache instance
741: [20:58:05] <Pyromanik> and between 5 and 30% for CPU usage per instance
742: [20:58:24] <zippy__> Pyromanik: Hows the cpu looking then?
743: [20:58:27] <Pyromanik> saw PHP flash up before, using some 20% of something, not sure if mem or cpu though
744: [20:58:43] <Pyromanik> Cpu(s): 10.5%us, 1.8%sy, 0.0%ni, 87.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
745: [20:58:55] <zippy__> Pyromanik: You can sort the colums by doing <shift> .
746: [20:59:01] <Pyromanik> jumps around, 10-20 ish
747: [20:59:02] <zippy__> <shift>+.
748: [20:59:30] <zippy__> then order by the high memory ones
749: [20:59:41] <zippy__> I would expect mysql or progress to be up there
750: [20:59:57] <Pyromanik> hmm yeah ok, 31 apache processes
751: [21:00:22] <zippy__> 31*3.5%=108% of memory
752: [21:00:27] <zippy__> for apache only :)
753: [21:00:44] <Pyromanik> yeah well
754: [21:00:52] <Pyromanik> like I say
755: [21:00:56] <zippy__> how much is your database using?
756: [21:01:02] <Pyromanik> how to stop apache being so damn hungry?
757: [21:01:11] <Pyromanik> zippy__: ~6%
758: [21:01:14] <zippy__> need to set the limits in your http config
759: [21:01:15] <zippy__> ok
760: [21:01:23] <Pyromanik> of mem
761: [21:01:45] * DigNZ quit (Quit: DigNZ)
762: [21:02:11] <zippy__> so if you say, 20 apache workers would be the limit. That would give you 70% of memory. Then 6% of database, and 24% for other things
763: [21:02:39] <zippy__> should also lower the KeepAlive to 2~ seconds if its on
764: [21:02:40] <Pyromanik> ok
765: [21:02:42] <Pyromanik> sounds legit
766: [21:03:05] * MrJeremy has joined #silverstripe
767: [21:03:15] <zippy__> what is the distro you got?
768: [21:03:21] <Pyromanik> can you explain to me the differences between worker and prefork, and which I might have?
769: [21:03:28] <Pyromanik> zippy__: ubuntu I think
770: [21:03:46] <zippy__> if you don't know and having changed it, I would be thinking your on prefork
771: [21:04:13] <Pyromanik> mmm, ubuntu 12.03 LTS iirc
772: [21:04:24] * RojoD quit (Ping timeout: 240 seconds)
773: [21:04:53] <Pyromanik> zippy__: and which is supposed to be the better one?
774: [21:05:04] <zippy__> type 'apache2 -l' and you will either see prefork.c or worker.c
775: [21:05:59] <Pyromanik> ah yeh
776: [21:06:17] * Pat_tas quit (Quit: Page closed)
777: [21:06:27] <Pyromanik> mm yeh prefork, thanks
778: [21:07:26] <zippy__> This should help you take care of those settings - http://serverfault.com/questions/244750/mpm-prefork-too-many-apache2-process
779: [21:07:34] <Pyromanik> right, so worker is apparently the better, but stuff needs to be threadsafe
780: [21:08:08] <zippy__> Now, when you change the limit to 20 processes, it means at any given time you can only serve 20 requests - any more than that you start to get delays, but least you won't run out of ram
781: [21:08:37] <zippy__> from there you need to work at speeding up those pages - optimise the code - add in some static caching or block those ips in htaccess / firewall
782: [21:08:42] <zippy__> or use CloudFlare
783: [21:09:09] <zippy__> You will be able to see if apache hit the MaxClients limit by looking in the apache error log
784: [21:09:11] <Pyromanik> planning to spread sites over multiple servers
785: [21:09:47] <zippy__> Something i have found to help with memory is to lower the MaxRequestsPerChild
786: [21:10:01] <zippy__> I have mine set to MaxRequestsPerChild 100 - just to help clear up memory leaks quicker
787: [21:10:53] <zippy__> hope all the above helps, good luck.
788: [21:11:13] <zippy__> ps, edit files with vim, then you can call yourself sysadmin :)
789: [21:12:03] * C10ne quit (Ping timeout: 250 seconds)
790: [21:13:24] <zippy__> and don't forget the keepalive
791: [21:13:33] <Pyromanik> I always vim.
792: [21:13:47] <Pyromanik> I pretty much am a sysadmin, except I don't really know what I'm doing most of the time.
793: [21:14:21] <Pyromanik> Like, I can administer a server, but I certainly wouldn't apply for a job doing it
794: [21:15:41] * pex has joined #silverstripe
795: [21:16:37] * Guits quit (Ping timeout: 264 seconds)
796: [21:16:51] * joelpittet has joined #silverstripe
797: [21:20:03] * stellalie quit (Ping timeout: 248 seconds)
798: [21:20:16] <Pyromanik> ROFL
799: [21:20:20] <Pyromanik> 80% CPU
800: [21:20:26] <Pyromanik> GG plesk.
801: [21:20:26] * stellalie has joined #silverstripe
802: [21:20:48] <zippy__> plesk makes me rage
803: [21:21:06] <Pyromanik> me too
804: [21:21:07] <Pyromanik> but
805: [21:21:14] <Pyromanik> lumped with it.
806: [21:21:20] <Pyromanik> because designers can't vim.
807: [21:21:34] * mattybalaam quit (Quit: mattybalaam)
808: [21:22:43] <irogue> Pyromanik: you probs got hacked
809: [21:22:44] <irogue> cos plesk
810: [21:22:45] <irogue> :P
811: [21:22:55] <Pyromanik> irogue: probs
812: [21:23:03] <Pyromanik> it's happened at least once.
813: [21:23:11] <Pyromanik> dunno if through site or through plesk though.
814: [21:23:23] <Pyromanik> just found a bunch of spam files sitting in a domain root one day.
815: [21:23:34] <Pyromanik> (ie, php files for propagating spam)
816: [21:23:52] <Pyromanik> found no trace in other domains
817: [21:25:10] <Pyromanik> I switched from mod_php to fastcgi recently on hopes that memory usage would decrease
818: [21:26:43] <irogue> Pyromanik: plesk got exploited pretty hard recently
819: [21:27:09] * SightUnseen1 has joined #silverstripe
820: [21:28:18] * SightUnseen1 has left #silverstripe
821: [21:28:56] * nikrolls has joined #silverstripe
822: [21:29:03] <Pyromanik> irogue: should probably apply that update then eh
823: [21:29:04] <zippy__> irogue: That only effects plesk 9 and older - not 10 or 11 it seems
824: [21:29:18] <Pyromanik> oh yeah, we had that issue come and go
825: [21:29:23] <Pyromanik> that was over a year ago though
826: [21:29:29] <Pyromanik> michael, let it go!
827: [21:29:39] <irogue> lol
828: [21:29:56] <zippy__> it came out a couple of days ago
829: [21:30:00] * Jakx has joined #silverstripe
830: [21:30:00] <zippy__> the issue
831: [21:30:01] <irogue> zippy__: i always assume the type of companies who use plesk also don't upgrade or apply security updates :P
832: [21:30:04] <Jakx> yo
833: [21:30:22] <Pyromanik> oh sweet, sec patch seems to have been applied in last nights update run
834: [21:30:38] <Pyromanik> zippy__: ah, so you mean <another> issue for plesk9
835: [21:30:43] <zippy__> yes
836: [21:30:53] <Pyromanik> irogue: managed server, and yeah, they do.
837: [21:31:23] <irogue> Pyromanik: ah, someone else does upgrades for you, that makes sense then
838: [21:31:34] <zippy__> irogue: pixies
839: [21:31:46] <Pyromanik> they certainly scrambled to pull all the plesks down until they patched them all and then chaned every users passwords last year
840: [21:32:16] <Pyromanik> irogue: yeah. Costs a dickload more but "Managed Server" ftw
841: [21:32:31] <Pyromanik> "CBF" or "IDK" -> Email support team, done.
842: [21:32:47] <zippy__> Pyromanik: Get them to sort out your memory / load issue then :)
843: [21:32:50] <Pyromanik> Jakx's old mates
844: [21:32:54] <Pyromanik> zippy__: tried :P
845: [21:33:05] <Pyromanik> it basically all comes down to this:
846: [21:33:17] <zippy__> they suck? :)
847: [21:33:18] <Pyromanik> I should not be hosting over 350 websites on the 1 server.
848: [21:33:26] <Pyromanik> no, lol.
849: [21:33:40] <zippy__> just give it more power
850: [21:33:48] <zippy__> moorreee ppowwweeerrr!
851: [21:33:51] <Pyromanik> yeh, tried.
852: [21:33:57] <Pyromanik> but then more sites followed
853: [21:35:31] <Jakx> wish I'd caught the beginning of this convo in my chat dialog heh.
854: [21:35:51] <nikrolls> Pyromanik: Until you reach 1.21 gigawatts, you're not trying hard enough
855: [21:36:26] <Jakx> SS question: where is the href of the previous page stored? I just wanna have it in a "Go Back" button in the template.
856: [21:37:26] <zippy__> javascript window back ? something
857: [21:37:38] <zippy__> history -1 maybe
858: [21:37:48] <nikrolls> history.back()
859: [21:37:52] <zippy__> Im not sure if SS stores it (session?)
860: [21:38:07] <nikrolls> Or history.go(-1)
861: [21:38:07] * mattybalaam has joined #silverstripe
862: [21:38:17] <Pyromanik> nikrolls: I think you mean jiggawatts
863: [21:38:21] <Jakx> where does redirectBack() get it from?
864: [21:38:36] * aragonne quit (Quit: aragonne)
865: [21:38:37] <zippy__> grep and you shall find
866: [21:38:43] <Pyromanik> Jakx: it doesn't.
867: [21:38:44] <nikrolls> Pyromanik: Pronunciation was implied :)
868: [21:39:08] <Jakx> Pyromanik, oh.
869: [21:39:15] <Pyromanik> Jakx: or it pulls the referrer
870: [21:39:26] <Pyromanik> check controller and find out?
871: [21:39:42] <Jakx> Pyromanik, hmm yeah. Will do
872: [21:39:45] <Pyromanik> nikrolls: no, giga and jigga are two way different things.
873: [21:39:56] <nikrolls> "Redirect back. Uses either the HTTP_REFERER or a manually set request-variable called "BackURL"."
874: [21:40:05] <Pyromanik> Jakx: if you want a go back button it's best to store it yourself in the session
875: [21:40:16] <Pyromanik> plonk some code in page_controller::init
876: [21:40:19] <Pyromanik> etc
877: [21:40:22] <nikrolls> "If none of the two variables is available, it will redirect to the base URL (see {@link Director::baseURL()})."
878: [21:40:43] <Jakx> Pyromanik, thx
879: [21:41:04] <Pyromanik> lol httpd.conf is empty :<
880: [21:41:09] <irogue> [09:35] <Jakx> wish I'd caught the beginning of this convo in my chat dialog heh.
881: [21:41:13] <irogue> logs!
882: [21:42:03] <zippy__> Pyromanik: vim /etc/apache2/apache2.conf
883: [21:42:37] <zippy__> Pyromanik: cp /etc/apache2/apache2.conf /root/apache2.conf.31.06.2013
884: [21:42:42] <zippy__> just in case you hose it up
885: [21:43:28] <Pyromanik> zippy__: yeh, ikr
886: [21:43:58] * Peavers has left #silverstripe
887: [21:44:19] <Pyromanik> mmm, max clients and servers set to 150
888: [21:44:51] <Pyromanik> keepalive 2, should I turn it down/
889: [21:44:52] <Pyromanik> ?
890: [21:45:05] <zippy__> 2 is ok
891: [21:45:17] <zippy__> some people turn it off, I roll with 2
892: [21:45:45] <Pyromanik> so maxclients 30 and maxservers 30 you reckon?
893: [21:46:03] <zippy__> 30 * 3.5% = 105%
894: [21:46:07] <zippy__> probably not
895: [21:46:11] <zippy__> 20
896: [21:46:23] <Pyromanik> k, for both
897: [21:46:23] <Pyromanik> ?
898: [21:48:20] <zippy__> yeap
899: [21:50:26] <zippy__> then run 'apache2ctl -t' and it should say
900: [21:50:27] <zippy__> Syntax OK
901: [21:50:33] <zippy__> then restart apache
902: [21:50:36] <zippy__> then beer time
903: [21:50:43] <Pyromanik> alright, bonus
904: [21:50:46] <Pyromanik> beer at 10am
905: [21:50:49] <Pyromanik> sounds legit
906: [21:51:10] <Pyromanik> fffffffffffffff zippy
907: [21:51:17] <Pyromanik> now I really want a beer :(
908: [21:52:38] <Pyromanik> alright, thanks for your help chap :)
909: [21:52:43] <Pyromanik> I'll see how this bakes
910: [21:52:51] <Pyromanik> will it rise?
911: [21:53:04] <zippy__> I really like the mod status module, with the extended status on - that way you can see all the requests going to which sites and pages - and how many clients are being used
912: [21:53:20] <zippy__> might already be on
913: [21:53:43] <zippy__> try 'curl 127.0.0.1/server-status'
914: [21:54:13] <zippy__> if you get back some html then, you can be a real guru and use lynx
915: [21:54:13] <Pyromanik> hmm, we used to have mod_slotlimit
916: [21:54:30] <Pyromanik> I know that trick, but a better one is apache2ctl fullstatus
917: [21:54:39] <Pyromanik> same shit, just not a web page
918: [21:55:14] <zippy__> doesn't look as pretty
919: [21:55:55] <zippy__> how many requests you got processing atm, whats the requests/sec look like?
920: [21:56:02] <zippy__> around or less than 10?
921: [21:57:12] <Pyromanik> 6
922: [21:57:22] <Pyromanik> 20
923: [21:57:35] <Pyromanik> 8.4 req/s
924: [21:57:42] <zippy__> ok
925: [21:57:42] <Pyromanik> 0 idle
926: [21:57:59] <zippy__> keep an eye on the error log to see how often you hit the maxclients limit
927: [21:58:01] <Pyromanik> 28% cpu
928: [21:58:08] <Pyromanik> hmm, good thinking batman
929: [21:58:45] <Pyromanik> so far so good
930: [21:58:47] <Pyromanik> none :>
931: [21:58:53] <zippy__> good as
932: [21:59:05] * gumble quit (Ping timeout: 246 seconds)
933: [21:59:27] <Pyromanik> just a buch of 404s for /var/www/vhosts/default/htdocs/autodiscover
934: [21:59:36] <Pyromanik> and /var/www/vhosts/default/htdocs/wpad.dat
935: [22:00:56] <Jakx> has anyone has the issue of $BaseHref adding a "%0A" to the end of the string? Resulting in "http://yourdomain.com/%0Acontroller/action/" ??
936: [22:01:57] <Pyromanik> lolwut no
937: [22:02:02] <Pyromanik> pool time
938: [22:02:05] <Jakx> yep... ><
939: [22:03:45] <zippy__> Pyromanik: use this, so you only see the MaxClients. tail -f /var/log/apache2/error.log | grep MaxClients
940: [22:04:01] * pex quit (Ping timeout: 264 seconds)
941: [22:11:30] * Peavers has joined #silverstripe
942: [22:12:17] <zippy__> hmm
943: [22:12:26] <zippy__> I have a DataObject - which has a field called Price
944: [22:12:46] * chillu23 has joined #silverstripe
945: [22:12:51] <zippy__> I created a function in that class called getPrice() which I check value, and may return something else..
946: [22:13:05] <zippy__> but $this->Price is NULL in my getPrice function
947: [22:13:16] <zippy__> if I remove it, and call $Price in my template it works
948: [22:13:32] <zippy__> so it seems my function is not calling something to populate the Price variable on the class...
949: [22:13:42] * chillu quit (Ping timeout: 260 seconds)
950: [22:13:42] * chillu23 is now known as chillu
951: [22:13:43] <zippy__> Seems I have overriding some magic
952: [22:13:49] <nikrolls> Pretty sure $this->Price will try to use your getter, and can't because of the inf loop
953: [22:13:58] <nikrolls> I've come across it a lot in the past
954: [22:14:15] * mrzero_ has joined #silverstripe
955: [22:14:25] <nikrolls> I usually steer clear and use a slightly different name
956: [22:14:37] * mrzero quit (Remote host closed the connection)
957: [22:14:37] * mrzero_ is now known as mrzero
958: [22:14:45] <zippy__> yea it does use my getter.
959: [22:14:55] <zippy__> hphm
960: [22:15:10] * DigNZ has joined #silverstripe
961: [22:15:11] * DigNZ quit (Remote host closed the connection)
962: [22:15:13] <nikrolls> Sorry, I mean even within your getter, it still tries to use your getter rather than access the property directly
963: [22:15:25] * DigNZ has joined #silverstripe
964: [22:15:27] <nikrolls> And bottoms out to avoid the loop
965: [22:16:45] <zippy__> rangi
966: [22:16:48] <zippy__> ah well, PrettyPrice is it
967: [22:17:05] * micmania1 has joined #silverstripe
968: [22:17:05] * gumble has joined #silverstripe
969: [22:17:13] <nikrolls> :)
970: [22:17:24] <nikrolls> Or write a setter, and call the property _Price
971: [22:20:29] * travis-ci has joined #silverstripe
972: [22:20:29] <travis-ci> [travis-ci] chillu/silverstripe-framework#3 (pulls/tabs-float - 98f8191 : Ingo Schommer): The build passed.
973: [22:20:29] <travis-ci> [travis-ci] Change view : https://github.com/chillu/silverstripe-framework/compare/34bc067400a9^...98f8191dff11
974: [22:20:29] <travis-ci> [travis-ci] Build details : http://travis-ci.org/chillu/silverstripe-framework/builds/8032913
975: [22:20:29] * travis-ci has left #silverstripe
976: [22:22:23] * DigNZ quit (Quit: DigNZ)
977: [22:27:32] <zippy__> a function on a page called from a view should be added to
978: [22:27:39] <zippy__> controller, or model of that page?
979: [22:28:00] <zippy__> I think model, since it's data being minipulated
980: [22:28:09] <zippy__> but then the view is part of the request
981: [22:28:27] <nikrolls> Yeah, that's a tricky one
982: [22:28:48] <zippy__> whats the convention
983: [22:28:57] <nikrolls> I generally think of it this way: If it's something that belongs to the model (as in data), that is useful outside the context of the request, then model
984: [22:29:13] <nikrolls> If only useful in the context of the page request, then the controller
985: [22:30:36] <nikrolls> Examples of useful outside of the request could be a blog category page which collates its children, you could use that from another page or widget that needed to display the info, so it's useful outside the CategoryPage's controller
986: [22:34:41] * pex has joined #silverstripe
987: [22:36:56] * willmorgan quit (Read error: Connection reset by peer)
988: [22:39:09] <Peavers> How does one go about preforming basic math on a database value?
989: [22:43:49] * xyphoid has left #silverstripe
990: [22:44:42] <micmania1> Peavers, try this: http://doc.silverstripe.org/framework/en/reference/sqlquery
991: [22:47:02] <spronk> sheesh
992: [22:47:09] <spronk> westpac.co.nz seems pretty broken at the moment
993: [22:47:16] <spronk> them silverstripe boys'll be in barney
994: [22:50:04] * zippy__ quit (Ping timeout: 252 seconds)
995: [22:50:17] <irogue> i see no broken?
996: [22:50:58] * DigNZ has joined #silverstripe
997: [22:51:21] <nikrolls> Not loading for me
998: [22:51:36] <nikrolls> Either 'could not connect' or perpetual loading ...
999: [22:52:02] <nikrolls> May just be coming right now
1000: [22:52:17] * Jakx quit (Read error: Connection reset by peer)
1001: [22:52:52] <nikrolls> Heh, nice homepage title: 'Bank'
1002: [22:53:01] * Jakx has joined #silverstripe
1003: [22:53:34] <irogue> might be some routing issues between ISPs or something going on
1004: [22:55:46] * travis-ci has joined #silverstripe
1005: [22:55:46] <travis-ci> [travis-ci] silverstripe/silverstripe-framework#278 (3.1 - 65209a0 : Ingo Schommer): The build passed.
1006: [22:55:46] <travis-ci> [travis-ci] Change view : https://github.com/silverstripe/silverstripe-framework/compare/88595e38f9cf...65209a0ed50f
1007: [22:55:46] <travis-ci> [travis-ci] Build details : http://travis-ci.org/silverstripe/silverstripe-framework/builds/8033925
1008: [22:55:46] * travis-ci has left #silverstripe
1009: [22:59:55] * zippy__ has joined #silverstripe
1010: [23:02:27] <Peavers> so if Member::get()->count() gives me a count of all members, how do I get a single column instead of the entire table? like SELECT memberID FROM Members
1011: [23:02:47] <nikrolls> ->column(name)
1012: [23:03:04] <Peavers> instead of get?
1013: [23:03:06] <Peavers> or after get
1014: [23:03:14] <nikrolls> On the list, so after get
1015: [23:03:41] <nikrolls> Or after filter, exclude, etc -- as long as you have a list
1016: [23:05:42] * chillu quit (Quit: chillu)
1017: [23:08:43] <spronk> irogue: got me an adsl splitter, gonna go do some dodgy DIY wiring >=D
1018: [23:10:47] * micmania1 quit (Ping timeout: 250 seconds)
1019: [23:12:00] * pex quit (Remote host closed the connection)
1020: [23:12:34] <irogue> spronk: sweeet
1021: [23:12:53] <spronk> and by dodgy i mean anal-retentively neat
1022: [23:13:09] * Chazz has joined #silverstripe
1023: [23:13:39] * Chazz has left #silverstripe
1024: [23:14:16] * willr_ has joined #silverstripe
1025: [23:16:55] * Colin[pi] has joined #silverstripe
1026: [23:17:00] * travis-ci has joined #silverstripe
1027: [23:17:01] <travis-ci> [travis-ci] silverstripe/silverstripe-framework#279 (3.1 - 8786007 : Ingo Schommer): The build passed.
1028: [23:17:01] <travis-ci> [travis-ci] Change view : https://github.com/silverstripe/silverstripe-framework/compare/65209a0ed50f...878600701f80
1029: [23:17:01] <travis-ci> [travis-ci] Build details : http://travis-ci.org/silverstripe/silverstripe-framework/builds/8034269
1030: [23:17:01] * travis-ci has left #silverstripe
1031: [23:18:26] * UncleCheese has joined #silverstripe
1032: [23:23:44] <Jakx> my BaseHref has a linefeed character in it >< wth
1033: [23:23:59] <spronk> dodgy
1034: [23:25:05] <Jakx> trying to think here this could be being added
1035: [23:25:15] <Jakx> where*
1036: [23:25:33] <zippy__> omg ANZ bank is retarted
1037: [23:25:57] <nikrolls> Jakx: Director::setBaseURL not being used anywhere?
1038: [23:26:09] <nikrolls> That's the only place I can think that bad data could get in
1039: [23:27:52] <nikrolls> "Uncaught Exception: SQLQuery::aggregate() doesn't work with groupby or limit, yet"
1040: [23:27:58] <nikrolls> "yet"; love it
1041: [23:27:58] <Jakx> nikrolls, not that I know of - and if I use it it doesn't manage to get rid of the linefeed sadly
1042: [23:28:18] <nikrolls> Jakx: curiouser and curiouser.
1043: [23:29:11] <Jakx> in ss 3 should I be using {} in my template? i.e {$BaseHref}?
1044: [23:29:22] <Jakx> it's the } that seems to be causing the \n char
1045: [23:29:44] <Pyromanik> zippy__: nikrolls $this->dbObject('Price')->Value()
1046: [23:30:16] <nikrolls> Pyromanik: ooh nice find
1047: [23:30:19] <nikrolls> That would work
1048: [23:30:46] <nikrolls> Jakx: It's not required, unless you have alphanumerics adjacent to the variable name
1049: [23:30:58] <Jakx> nikrolls, that I do.
1050: [23:31:00] <nikrolls> But it also shouldn't be doing that
1051: [23:31:13] <nikrolls> $BaseHref/stuff is fine
1052: [23:31:24] <nikrolls> $BaseHrefstuff isn't
1053: [23:31:35] <nikrolls> But yeah, } shouldn't be doing that ...
1054: [23:31:59] * UncleCheese quit (Quit: UncleCheese)
1055: [23:32:32] <Jakx> nikrolls, interesting. I wonder if it has anything to do with the fact that the anchor appears in a bootstrap modal
1056: [23:33:01] <nikrolls> Yeah, what does it look like elsewhere in the page?
1057: [23:33:33] <Pyromanik> Jakx: remove character, retype it
1058: [23:33:37] <Pyromanik> sometimes shit gets corrupted
1059: [23:33:49] <Pyromanik> (remove more than that one character, a few each side should do it)
1060: [23:34:11] <Jakx> nikrolls, as normal. But hard to say if a \n was rendered or not as the web browser may have quit easily stripped it from the DOM
1061: [23:34:18] <Jakx> Pyromanik, sweet - I'll give that a try
1062: [23:34:53] <Pyromanik> that or use $AbsoluteLink instead
1063: [23:35:06] <Pyromanik> (if you're calling from a linkable object)
1064: [23:36:38] * popeshoe quit (Quit: This computer has gone to sleep)
1065: [23:38:27] <Jakx> Pyromanik, Absolute link is a viable workaround
1066: [23:38:35] <Jakx> cheers!
1067: [23:38:51] <Jakx> nikrolls, thanks for you input :)
1068: [23:39:09] <Jakx> your*
1069: [23:39:48] * mobiusnz quit (Quit: Leaving.)
1070: [23:42:35] <Peavers> Does php have anything like a tokenizor/hasNext type thing? I've got a column in a table which holds a time value and I want to go through that column comparing the time to the time below it. So I can get something like "The time between first and second was 4 minutes, between third and fourth was 10 minutes" etc - Any recommendation on what type of pattern to use?
1071: [23:42:50] <spronk> where did the old ss recipes go :(
1072: [23:44:53] <Pyromanik> spronk: dead
1073: [23:44:57] <nikrolls> Jakx: welcome :)
1074: [23:45:20] <Pyromanik> Peavers: what is the datastructure?
1075: [23:45:28] <spronk> yuegh
1076: [23:45:35] <spronk> just want next/prev page links :[
1077: [23:45:49] * zippy__ quit (Quit: zippy__)
1078: [23:45:58] <Peavers> Using "Time"
1079: [23:46:46] <Pyromanik> spronk: Page::get()->filter(array('ParentID' => $this->ParentID, 'Sort' => ((int)$this->Sort)+1))
1080: [23:46:51] <Pyromanik> spronk: Page::get()->filter(array('ParentID' => $this->ParentID, 'Sort' => ((int)$this->Sort)-1))
1081: [23:47:07] <Pyromanik> spronk: maybe with ->first()
1082: [23:47:18] <Pyromanik> Peavers: I mean the 'table'
1083: [23:47:21] <spronk> yeh
1084: [23:51:11] <nikrolls> ss recipies -- what was that?
1085: [23:51:14] <spronk> ffs spronk
1086: [23:51:20] <spronk> sort is not spelled Sprt
1087: [23:52:21] <Pyromanik> nikrolls: recepies
1088: [23:52:43] <Pyromanik> predefined chunks of code to accomplish a goal shared by people in the hope that someone trying to achieve the same goal will find it helpful.
1089: [23:52:46] <nikrolls> * recipes
1090: [23:52:55] <Pyromanik> yeh, that too.
1091: [23:53:04] <nikrolls> Sorry, correcting my own as well :)
1092: [23:53:15] <nikrolls> Right, so what it sounded like -- what happened?
1093: [23:53:27] <spronk> the big cull
1094: [23:53:27] <nikrolls> I'm assuming it was a website
1095: [23:54:28] <nikrolls> Outdated?
1096: [23:58:29] <spronk> yeah somewhat

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