#silverstripe IRC Log

IRC log for 14 September 2016

All timestamps are in UTC.

1: [00:00:02] * ss-helper quit (Remote host closed the connection)
2: [00:00:15] * ss-helper has joined #silverstripe
3: [00:08:24] * DanaeNZ quit (Remote host closed the connection)
4: [00:32:25] * micmania1 quit (Quit: micmania1)
5: [00:33:58] * jaydenseric quit (Ping timeout: 244 seconds)
6: [00:38:33] * Stomach quit (Quit: zzz)
7: [00:45:03] <ss-helper> Get SiteConfig variables inside _config.php - http://stackoverflow.com/questions/39254997/get-siteconfig-variables-inside-config-php
8: [00:59:08] * micmania1 has joined #silverstripe
9: [01:24:10] * DanaeNZ has joined #silverstripe
10: [01:30:23] * muskie9 has joined #silverstripe
11: [01:33:40] * isaac_ has joined #silverstripe
12: [01:36:26] <isaac_> hey guys, is it possible for a page to have some sections editable and others not? I have a GridField that needs to be editable but the rest of the page shouldn't be. If i put page::canEdit->{return true} all the fields become editable, and if I put page::canEdit->{return false} nothing is editable. Anyone have any ideas?
13: [01:38:01] <muskie9> isaac_ you'll have to wrap your fields in getCMSFields() with the permission logic afaik... rather than the global page's can permissions
14: [01:43:59] * jo__ has joined #silverstripe
15: [01:44:13] <jo__> hi wonderful people.
16: [01:44:42] <jo__> just a quick question regarding new update to the ->renderWith() function in v4-alpha.
17: [01:45:36] <jo__> the changelog said the path to template file is more strict, and I did update the corresponding path to include the folder, but still doesn't work.
18: [01:46:07] <jo__> my template lives in: <root>/subsites/templates/Includes/SubsiteList.ss
19: [01:46:46] <jo__> the Controller class is located in <root>/subsites/code/SubsiteXHRController.php, and trying to load the SubsiteList template.
20: [01:47:44] <jo__> I updated the code from ->renderWith('SubsiteList') to ->renderWith('/subsites/templates/Includes/SubsiteList')
21: [01:47:59] <jo__> for some reason it won't find it. Does anyone have any idea?
22: [01:50:22] <DanaeNZ> jo__: someone in here had that problem the other day
23: [01:50:32] <DanaeNZ> I forgot what the fix was
24: [01:50:58] <jo__> wow, what a coincidence.
25: [01:51:09] <jo__> it seems something very trivial, but...
26: [01:51:24] <jo__> trying to make the silverstripe/subsites plugin work, unfortunately it doesn't support v4-alpha yet.t
27: [01:51:38] <jo__> crossing fingers it will be updated soon.
28: [01:53:50] <muskie9> jo__ ya, I think modules will start to work out support once alpha2/beta1 is released as many many bugs are being worked out at this point, so things could still change fairly drastically
29: [01:54:29] <muskie9> I know that template namespacing was a hot ticket recently, not sure if it's been fully resolved at this point
30: [01:57:00] <jo__> yea, quite a few of my fellow devs are having problem with the namespacing
31: [01:58:22] <muskie9> It'll be nice once it's all sorted
32: [01:59:35] <muskie9> sadly I'm stuck worderping for the foreseeable future 😞 so I don't get to play
33: [02:00:45] <jo__> aww
34: [02:02:37] <muskie9> cleaning up another agency's dirty work... finding "//todo this is broken, need to fix" throughout the code
35: [02:05:01] <jo__> typical. massive site?
36: [02:06:07] <muskie9> ya, higher education... connects to a campus wide Oracle database and does an api call twice a day... the result parsing is jacked up... worderp isn't meant for what they're trying to do with it
37: [02:14:36] * Stomach has joined #silverstripe
38: [02:14:53] * DanaeNZ quit (Remote host closed the connection)
39: [02:15:27] * DanaeNZ has joined #silverstripe
40: [02:19:49] * DanaeNZ quit (Ping timeout: 255 seconds)
41: [02:24:38] * DanaeNZ has joined #silverstripe
42: [02:26:05] * Stomach quit (Quit: zzz)
43: [02:27:59] * Stomach has joined #silverstripe
44: [02:32:51] * Stomach quit (Client Quit)
45: [02:38:39] <DanaeNZ> Anyone used Let's Encrypt yet?
46: [02:39:28] <xyphoid> i have tried it out
47: [02:40:01] <xyphoid> the biggest downside is the cert expiry period is just past my attention span - so it was all going great, then first cert expiry something went wrong and i haven't gotten around to looking at it
48: [02:40:14] * micmania1 quit (Quit: micmania1)
49: [02:40:39] <muskie9> we have it on an internal review server... I didn't set it up though, but guess it's working
50: [02:41:08] <DanaeNZ> xyphoid: I'm looking at certbot - you can run a cron twice a day to renew the certificates
51: [02:41:16] * Stomach has joined #silverstripe
52: [02:41:29] <DanaeNZ> muskie9: cool, I'm gonna set it up on this little internal server do-hickey I am about to set up
53: [02:41:30] <xyphoid> yeah it looked like it was working :(
54: [02:41:50] <muskie9> just asked our dev who set it up... his response was "
55: [02:41:50] <muskie9> i had it mostly working manually, but failed over SSH. Just install the libraries and setup a cron, was pretty simple"
56: [02:42:01] <DanaeNZ> yeah ssl certs aren't exactly a straightforward thing a=eh
57: [02:42:17] <DanaeNZ> cron sounds about right
58: [02:42:21] <DanaeNZ> certbot + cron
59: [02:42:28] <ss23> 14:40:01 < xyphoid> the biggest downside is the cert expiry period is just past my attention span - so it was all going great, then first cert expiry something went wrong and i haven't gotten around to looking at it
60: [02:42:36] <ss23> it's intentionally like this so you have to automate it
61: [02:42:36] <ss23> :P
62: [02:43:41] <xyphoid> oh yeah i did that
63: [02:43:47] <xyphoid> it's just hte automation was broken
64: [02:45:18] <xyphoid> appeared to be working but then it expired WHOOPS - what i would like is week-long certs for testing tbh
65: [02:45:31] <DanaeNZ> xyphoid: I think they have a staging environment
66: [02:45:41] <DanaeNZ> I've only just vaguely looked at it
67: [02:46:49] <xyphoid> i mean i'm not really complaining it's just how *I* managed to fail haha
68: [03:05:26] * Stomach_ has joined #silverstripe
69: [03:07:29] * Stomach quit (Ping timeout: 250 seconds)
70: [03:37:21] * muskie9 quit (Quit: Textual IRC Client: www.textualapp.com)
71: [03:39:02] * Stomach_ quit (Quit: zzz)
72: [03:43:41] * muskie9 has joined #silverstripe
73: [03:44:08] <jo__> just wondering if anyone knows what this error is about?
74: [03:44:08] <jo__> <b>Fatal error</b>: Map is read-only. Unset cannot be called on keys derived from the DataQuery in
75: [03:44:19] <jo__> trying to "manually
76: [03:44:34] <jo__> upgrade" a silverstripe/subsites module to work with v4-alpha.
77: [03:45:48] * Stomach has joined #silverstripe
78: [03:49:12] * wat quit (Ping timeout: 240 seconds)
79: [03:49:36] * micmania1 has joined #silverstripe
80: [03:50:28] <DanaeNZ> jo__: seems like it's trying to use DataQuery as an array which won't work
81: [03:50:35] <DanaeNZ> ->Map()[0] or something
82: [03:53:01] <muskie9> maybe ->Map()->toArray()
83: [03:53:11] <muskie9> if needing it as an array
84: [03:53:34] <muskie9> or better yet, ->Map()->toNestedArray()
85: [03:54:54] <muskie9> sleep time
86: [03:54:58] * muskie9 quit (Quit: Textual IRC Client: www.textualapp.com)
87: [04:01:58] * Stomach quit (Quit: zzz)
88: [04:06:02] * Stomach has joined #silverstripe
89: [04:21:51] * spronk quit (Quit: I may need a longer sleep timer...)
90: [04:59:46] * Hailwood quit (Remote host closed the connection)
91: [05:00:07] <ss-helper> Silverstripe subsite not returning all children of the pages - http://stackoverflow.com/questions/39482729/silverstripe-subsite-not-returning-all-children-of-the-pages
92: [05:04:56] * Stomach quit (Quit: zzz)
93: [05:09:44] * pandauxstudio has joined #silverstripe
94: [05:25:26] <isaac_> hey is anyone able to help me out with http://pastebin.com/vgikv24L ?
95: [05:26:12] * pandauxstudio quit (Ping timeout: 240 seconds)
96: [05:30:08] <ss-helper> Get SiteConfig variables inside _config.php - http://stackoverflow.com/questions/39254997/get-siteconfig-variables-inside-config-php
97: [05:33:11] * Stomach has joined #silverstripe
98: [05:40:17] * spronk has joined #silverstripe
99: [05:41:11] * micmania1 quit (Quit: micmania1)
100: [05:41:28] * micmania1 has joined #silverstripe
101: [05:43:55] * Stomach quit (Quit: zzz)
102: [05:45:27] * spronk quit (Ping timeout: 268 seconds)
103: [05:45:51] * Stomach has joined #silverstripe
104: [05:47:18] * wmk has joined #silverstripe
105: [05:56:08] * adrexia quit (Quit: My Mac has gone to sleep. ZZZzzz…)
106: [06:03:30] * Stomach quit (Ping timeout: 265 seconds)
107: [06:08:27] * Shrike_Finland has joined #silverstripe
108: [06:16:01] * micmania1 quit (Quit: micmania1)
109: [06:53:21] * Stomach has joined #silverstripe
110: [07:02:12] * isaac_ quit (Ping timeout: 240 seconds)
111: [07:33:32] * Stomach quit (Quit: zzz)
112: [07:46:03] * swaiba has joined #silverstripe
113: [07:53:43] * irogue quit (Ping timeout: 255 seconds)
114: [07:53:49] * shellbackpacific quit (Ping timeout: 244 seconds)
115: [08:03:10] <Shrike_Finland> Anyone familiar with Silverstripe Cache file locking on NFS?
116: [08:06:04] * DanaeNZ quit (Quit: TIME TO FEED)
117: [08:07:45] * janneklouman-- has joined #silverstripe
118: [08:24:08] * spronka has joined #silverstripe
119: [08:28:42] * jo__ quit (Ping timeout: 240 seconds)
120: [08:35:05] * spronka quit (Quit: Textual IRC Client: www.textualapp.com)
121: [08:40:43] * pweh has joined #silverstripe
122: [08:46:29] * shellbackpacific has joined #silverstripe
123: [08:51:10] * micmania1 has joined #silverstripe
124: [09:47:11] * DarjusIT has joined #silverstripe
125: [09:49:27] * agent44 has joined #silverstripe
126: [10:14:45] * agent44 quit (Quit: zzz)
127: [10:19:25] * agent44 has joined #silverstripe
128: [10:24:01] * agent44 quit (Ping timeout: 255 seconds)
129: [10:30:10] * pweh quit (Ping timeout: 260 seconds)
130: [10:30:13] <ss-helper> SilverStripe - /admin is running out of memory - http://stackoverflow.com/questions/39488068/silverstripe-admin-is-running-out-of-memory
131: [10:33:34] * agent44 has joined #silverstripe
132: [10:42:21] * irogue has joined #silverstripe
133: [10:49:27] * Shrike_Finland1 has joined #silverstripe
134: [10:49:27] * Shrike_Finland quit (Read error: Connection reset by peer)
135: [11:04:31] * irogue quit (Quit: Textual IRC Client: www.textualapp.com)
136: [11:12:13] * ocmnt has joined #silverstripe
137: [11:12:16] <ocmnt> howdy!
138: [11:17:12] * pweh has joined #silverstripe
139: [11:22:36] * micmania1 quit (Quit: micmania1)
140: [11:28:46] * agent44 quit (Quit: zzz)
141: [11:33:37] <ocmnt> what is the right way to validate a formfield without being it a required field
142: [11:33:55] <ocmnt> so that its value gets validated (matched against regex) when filled, but without having it as required field for the end user
143: [11:35:12] <swaiba> ocmnt ...
144: [11:35:13] <swaiba> http://stackoverflow.com/questions/22492396/silverstripe-conditional-validation
145: [11:35:17] <swaiba> https://docs.silverstripe.org/en/3.3/developer_guides/forms/validation/
146: [11:35:21] <swaiba> https://github.com/sheadawson/silverstripe-zenvalidator
147: [11:35:22] <swaiba> :)
148: [11:35:37] <ocmnt> thnx swaiba, that was quick
149: [11:35:41] <ocmnt> shame there is no out of the box solution for this
150: [11:36:05] <swaiba> well many fields have validation built in for say email, numeric, etc
151: [11:36:23] <swaiba> you could simply add html5 validation without all this..
152: [11:36:39] <ocmnt> but then when js is disabled (or some console hacker wants to be bad) they still pass the form
153: [11:36:47] <ocmnt> me no wants that
154: [11:37:04] <swaiba> then i don't suggest html5 validation :)
155: [11:37:18] <ocmnt> I want both :D
156: [11:39:24] * agent44 has joined #silverstripe
157: [11:40:09] * Shrike_Finland1 quit (Read error: Connection reset by peer)
158: [11:40:16] * Shrike_Finland has joined #silverstripe
159: [11:40:20] <ocmnt> hm, I am thinking
160: [11:40:28] <ocmnt> perhaps there is some beforepostform function?
161: [11:40:41] <ocmnt> before the formaction is called on which I can hook my fieldvalidation
162: [11:40:49] <ocmnt> err, fieldValueValidation :P
163: [11:40:55] <swaiba> ocmnt that would be the validation fucntions I've shared with you
164: [11:41:12] <swaiba> otherwise check out how things like email feild do their validation
165: [11:43:57] * Shrike_Finland1 has joined #silverstripe
166: [11:44:06] * Shrike_Finland quit (Read error: Connection reset by peer)
167: [11:44:36] * _em has joined #silverstripe
168: [11:44:36] <ss-helper> _em: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
169: [11:45:19] <ocmnt> fair point :) thanks anyway for pointing in some directions swaiba
170: [11:45:26] * arnhoe has joined #silverstripe
171: [11:47:49] <_em> Hi all :), documentation says: Any action you define on a controller must be defined in a $allowed_actions static array. But if action is not defined whats happened? Because I have function getEvents which is called in template (like $getEvents) and it is working when getEvents its defined in allowed_actions or not...
172: [11:49:57] <Zauberfisch> _em: "actions" are methods that represent an url
173: [11:50:07] * Shrike_Finland has joined #silverstripe
174: [11:50:27] <Zauberfisch> _em: so let's say you have a page with the URLSegment "foo". then http://website.com/foo/bar
175: [11:50:29] <_em> only in URL? like form submition or ajax?
176: [11:50:44] <Zauberfisch> this would attempt to call the method bar, if bar is in $allowed_actions
177: [11:50:51] <Zauberfisch> _em: anything really
178: [11:50:58] * Shrike_Finland1 quit (Read error: Connection reset by peer)
179: [11:51:19] <Zauberfisch> (the url pattern is by default: website.com/$URLSegment/$Action/$ID/$OtherID)
180: [11:51:53] <Zauberfisch> form submission or ajax are example usecases
181: [11:52:01] <Zauberfisch> but it can be used for any type of request
182: [11:52:22] <_em> and methods used in templates or anywhere else ? ... its not necessary to define it to $allowed_actions?
183: [11:52:26] <Zauberfisch> picture this: you have a CarPage because your website sells cars
184: [11:52:55] <Zauberfisch> you could have: website.com/opel-123 as the page of one opel you'd like to sell
185: [11:53:05] <Zauberfisch> let's say you want more details on subpages
186: [11:54:13] <Zauberfisch> website.com/opel-123/insurance to display insurance info. website.com/opel-123/features to display all the features in the car and so on
187: [11:54:39] <_em> so insurance or features need to be in allowed_actions
188: [11:54:51] <Zauberfisch> exactly
189: [11:55:41] <Zauberfisch> in class CarPage_Controller you would add "public function insurance() { return $this->customise(['Title' => 'Insurance Info for this car', 'Content', 'foo bar']); }"
190: [11:56:11] <_em> and what about method getCarInfoWithExtraStats() which is used only once - in template, should I put getCarInfoWithExtraStats to allowed_actions or not?
191: [11:56:23] <Zauberfisch> ocmnt: the best way is to write a custom validator
192: [11:56:33] * Shrike_Finland quit (Read error: Connection reset by peer)
193: [11:56:47] * Shrike_Finland has joined #silverstripe
194: [11:57:14] <Zauberfisch> ocmnt: I made a module for easier validation: https://github.com/Zauberfisch/silverstripe-better-form-validator
195: [11:57:19] <_em> because its not "part of URL"
196: [11:57:25] <Zauberfisch> _em: no
197: [11:57:27] <ocmnt> thnx zauberfish, I will take a look at that ^^
198: [11:57:48] <Zauberfisch> only methods that need to handle an URL
199: [11:58:01] <ocmnt> was thinking to put it in the Action, if preg_match(pattern, field['fieldname']) { return false, msg and blablalbla)
200: [11:58:07] <ocmnt> but guess that is bad practise?
201: [11:58:51] <Zauberfisch> ocmnt: not sure what you mean
202: [11:59:43] <Zauberfisch> ocmnt: ah, you mean spam protection for example? I actually do it this way. on some forms I just check if viagra or a few other words exist in the text, and show a validation error if they do
203: [11:59:56] <ocmnt> hahaha :D
204: [12:00:04] <ocmnt> y u no want viagra?
205: [12:00:07] <ocmnt> :P
206: [12:00:27] <_em> thx Zauberfisch... mark some good white point for help :)
207: [12:01:20] <Zauberfisch> _em: if you wish to learn more, check out the docs for Controller
208: [12:01:21] <ocmnt> but I think I go with your better validator, seems to do what I need ^^
209: [12:01:21] <Zauberfisch> _em: https://docs.silverstripe.org/en/3.4/developer_guides/controllers/introduction/
210: [12:01:27] <ocmnt> thnx
211: [12:01:49] <Zauberfisch> ocmnt: it's pretty low level I guess. and with the lambda stuff you don't have to create a new extra class
212: [12:02:29] <ocmnt> what I basically want to check, if that a given phone number is an workable phone number
213: [12:02:36] <ocmnt> min chars, + - and \d allowed
214: [12:02:51] <ocmnt> and spaces, because some people write phone numbers like, +31 12 3 4 56 7 8 9
215: [12:02:59] <ocmnt> with some - in between
216: [12:03:01] <Zauberfisch> yeah, sure. that will work
217: [12:03:39] <Zauberfisch> (just note that the return false or return true at the end don't currently effect the outcome, because for some reason silverstripe forms ignore that at the moment. I hope to get that fixed in the future though)
218: [12:04:42] * _em quit (Ping timeout: 240 seconds)
219: [12:05:29] <ocmnt> thanks for the warning :D
220: [12:05:58] <Zauberfisch> just noticed a mistake in the example
221: [12:06:00] <Zauberfisch> was missing a !
222: [12:06:05] <Zauberfisch> updated
223: [12:07:09] <ocmnt> hurray :D
224: [12:08:12] * Shrike_Finland1 has joined #silverstripe
225: [12:08:12] * Shrike_Finland quit (Read error: Connection reset by peer)
226: [12:10:56] * Shrike_Finland1 quit (Read error: Connection reset by peer)
227: [12:11:08] * Shrike_Finland has joined #silverstripe
228: [12:12:15] * Mike123 has joined #silverstripe
229: [12:15:12] * Shrike_Finland quit (Read error: Connection reset by peer)
230: [12:15:14] * Shrike_Finland1 has joined #silverstripe
231: [12:17:01] * Shrike_Finland has joined #silverstripe
232: [12:17:02] * Shrike_Finland1 quit (Read error: Connection reset by peer)
233: [12:21:36] <Mike123> what ports and services are needed for stable SS work ?
234: [12:25:01] * Shrike_Finland1 has joined #silverstripe
235: [12:25:01] * Shrike_Finland quit (Read error: Connection reset by peer)
236: [12:25:15] * cupcake has joined #silverstripe
237: [12:26:34] <cupcake> ola ola o/
238: [12:26:46] * Shrike_Finland1 quit (Read error: Connection reset by peer)
239: [12:27:05] * Shrike_Finland has joined #silverstripe
240: [12:31:44] * UndefinedOffset has joined #silverstripe
241: [12:35:07] * Shrike_Finland1 has joined #silverstripe
242: [12:35:08] * Shrike_Finland quit (Read error: Connection reset by peer)
243: [12:37:07] * Shrike_Finland has joined #silverstripe
244: [12:37:08] * Shrike_Finland1 quit (Read error: Connection reset by peer)
245: [12:39:28] * Shrike_Finland1 has joined #silverstripe
246: [12:39:29] * Shrike_Finland quit (Read error: Connection reset by peer)
247: [12:40:40] <Mike123> what ports and services are needed for stable SS workflow ?
248: [12:40:59] * MattyBalaam has joined #silverstripe
249: [12:44:24] * MattyBalaam quit (Client Quit)
250: [12:45:44] * Shrike_Finland1 quit (Quit: Leaving.)
251: [12:50:14] <swaiba> Mike123 which ever port you want to browse internet on... normally 80
252: [12:50:25] <swaiba> and "services".... err a LAMP stack?
253: [12:54:53] * pweh quit (Read error: Connection reset by peer)
254: [12:59:22] <wmk> in theory: php, database, webserver
255: [12:59:28] <wmk> Mike123, ^^
256: [12:59:40] <wmk> also runs on shared hosting (but i don't recommend that)
257: [13:00:09] <wmk> workflow: you need ssh, git, composer installed on the machine if you don't upload via ftp
258: [13:03:51] <swaiba> php, database, webserver = PHP, MySQL, Apache, Lunix = PMAL or LAMP
259: [13:04:04] <ocmnt> wmk, git and composer on your production server?
260: [13:04:13] <ocmnt> I wouldnt recommend that
261: [13:04:19] <wmk> why?
262: [13:04:47] <ocmnt> you should deploy finished code to your production server
263: [13:05:07] <ocmnt> dont need to update things there, nor push/pull git changes
264: [13:05:33] <ocmnt> use a deploy/test/dev server for development, and deploy to production when things are fixed/finished via a buildserver or something
265: [13:06:21] <ocmnt> in my experience having git / composer on a prod. server leads to bad practice. people fixing things there, or pulling untested code to prod server, leading to severe server errors :p
266: [13:11:07] <wmk> you mean deploying using something like capistrano?
267: [13:11:33] <wmk> this drove me crazy sometimes, e.g. when a package wasn't available any more
268: [13:11:51] <swaiba> ocmnt I disagree, bad habits are bad habits you just need to purge them
269: [13:12:11] * Eliseth has joined #silverstripe
270: [13:12:34] <ocmnt> bad habits should be punished by death :P
271: [13:12:54] <wmk> omg--- we're all dead ocmnt !!11!!!eleven!!
272: [13:13:01] <ocmnt> :D
273: [13:13:08] <ocmnt> see, save the planet
274: [13:13:12] <ocmnt> jump of a bridge :P
275: [13:13:24] <swaiba> I'' start planning my funeral arrangments...
276: [13:31:33] * agent44 quit (Ping timeout: 265 seconds)
277: [13:32:18] <ocmnt> Zauberfisch, I found some weird thing in your better form validation
278: [13:32:31] <ocmnt> the clientside validation (i.e. required attr) no longer works
279: [13:39:35] * agent44 has joined #silverstripe
280: [13:44:22] <Eliseth> Hi
281: [13:47:22] <ocmnt> hm, I think I found another way to solve the optional but validated field
282: [13:47:22] <Eliseth> When I try to call a has_many though $this->MyObjects() this works fine in a page, but when I try this in an extension for all pages it throws: undefined method MyExtension::MyObjects()
283: [13:48:13] <ocmnt> what is your extensoin? a dataobject?
284: [13:50:20] <ocmnt> this is my solution to the problem
285: [13:50:21] <ocmnt> http://www.sspaste.com/paste/show/57d9559097af0
286: [13:50:46] <swaiba> hi Eliseth how about... $this->owner->MyObjects() ?
287: [13:54:57] <Eliseth> My brain can't stand this heat... thanks ><
288: [14:02:06] <Zauberfisch> ocmnt: ah, yes
289: [14:02:29] <Zauberfisch> ocmnt: what the RequiredFilds() does is basically add ->setAttribute('required', 'required') on a form field
290: [14:02:54] <Zauberfisch> but because my validator is for more advanced usescases, it's hard to guess what fields should be required client side
291: [14:02:59] <Zauberfisch> so you will have to set those yourself
292: [14:03:02] <Zauberfisch> but that's easy
293: [14:03:09] <Zauberfisch> $field = new TextField('Foo');
294: [14:03:17] <Zauberfisch> $field->setAttribute('required', 'required');
295: [14:03:51] <Zauberfisch> or if you want it as a one-liner (new TextField('Foo'))->setAttribute('required', 'required')
296: [14:04:09] <swaiba> shouldn't that be TextField::create('Foo')->setAttribute('required', 'required'); ?
297: [14:04:25] <swaiba> ^^ Zauberfisch
298: [14:04:26] <Zauberfisch> or that, yes
299: [14:09:37] <wmk> Zauberfisch, can you do a conditional required field?
300: [14:09:45] <wmk> e.g. it is required if another field has some value
301: [14:10:07] <Zauberfisch> you have to write that yourself
302: [14:10:14] <Zauberfisch> as you have to write everything yourself here
303: [14:10:28] <wmk> ok. just had this requirement...
304: [14:10:31] <Zauberfisch> check the readme for an example (the callback thing)
305: [14:10:48] <Zauberfisch> the phone number is only required if the callback checkbox is checked
306: [14:11:00] <Zauberfisch> but that just does php validation. for frontend you have to write your own javascript
307: [14:13:51] <ocmnt> Zauberfisch did you see my sspaste?
308: [14:13:57] <ocmnt> how I solved the optional field with validation?
309: [14:14:50] <Zauberfisch> ocmnt: is that code even running?
310: [14:14:56] <Zauberfisch> $strlen looks like a syntax error
311: [14:15:03] <ocmnt> yea, that was an error
312: [14:15:11] <ocmnt> I have some more logic in my if ()
313: [14:15:19] <ocmnt> which I stripped out to make it more sense
314: [14:15:41] <ocmnt> $strlen(length) should be strlen($value)
315: [14:16:08] <ocmnt> its this part: $validator->removeRequiredField($this->name); which does the magic
316: [14:16:22] <Zauberfisch> ocmnt: they way you are doing it right now is subclassing a form field
317: [14:16:34] <Zauberfisch> if you are already doing that, you actually don't need my module
318: [14:16:34] <ocmnt> yup
319: [14:16:44] <ocmnt> I know, already removed it :P
320: [14:17:07] <ocmnt> anyway, time to go home
321: [14:17:17] <ocmnt> my ISP is going to fix my interwebz at home
322: [14:17:20] <ocmnt> after 3 months without any connection
323: [14:17:40] <ocmnt> so cya :D
324: [14:17:43] * ocmnt quit (Quit: Page closed)
325: [14:22:18] <swaiba> wmk not that I think it does, but that would be nice in UC's display logic
326: [14:22:42] <wmk> hmm... display logic != validation
327: [14:23:04] <wmk> but of course, some combination would be nice.
328: [14:24:05] <swaiba> yeah I know it isn't validation, but if a field is hideen I'd expect it somewhat to not affect validation, there is a small difference
329: [14:28:49] <Zauberfisch> javascript validation is a tricky thing
330: [14:29:27] <Zauberfisch> because you don't want to interfere with other existing javascript on the page
331: [14:29:52] <Zauberfisch> nor do you want to load in additional dependencies just to validate a single form field
332: [14:36:03] <swaiba> so if you set a field to be hidden with his tech, you'd still expect it's value to be required?
333: [14:36:18] <swaiba> and the message hidden because the field is hidden?
334: [14:36:33] <swaiba> that is what I see as the issue Zauberfisch
335: [14:37:51] <Zauberfisch> it is
336: [14:37:59] <Zauberfisch> it is an issue
337: [14:38:27] <Zauberfisch> but I am not sure where to best solve this
338: [14:38:38] <Zauberfisch> which module should be responsible to fix this
339: [14:39:03] <Zauberfisch> honestly, complex validations I do server side only actually
340: [14:39:24] <Zauberfisch> I simply use ajax for the form
341: [14:39:33] <swaiba> well me too, I write many validators
342: [14:39:40] <swaiba> but I do like the display logic
343: [14:39:49] <Zauberfisch> so you only get validation on submit, and display logic still works this way
344: [14:39:59] <swaiba> I've heard your module mentioned but not tried it yet, I'll put it on my "try" list :)
345: [14:40:05] <swaiba> indeed
346: [14:40:18] <Zauberfisch> but I actually think this is not to bad. my ajax form submission is fast enough not to be anoying
347: [14:41:02] <swaiba> yeah ideal work is html5 validation, but is' limited and I don't know the take up yet
348: [14:41:16] <swaiba> we use a little of that, a little dispaly logic and validators
349: [15:03:12] * Mike123 quit (Ping timeout: 240 seconds)
350: [15:13:29] * Eliseth quit (Ping timeout: 240 seconds)
351: [15:22:03] * wmk quit (Ping timeout: 240 seconds)
352: [15:27:32] * wmk has joined #silverstripe
353: [15:34:31] * janneklouman-- quit (Ping timeout: 244 seconds)
354: [15:43:10] * ^pH has joined #silverstripe
355: [15:45:38] * Shrike_Finland has joined #silverstripe
356: [16:19:18] * Shrike_Finland quit (Quit: Leaving.)
357: [16:30:42] * cupcake quit (Ping timeout: 240 seconds)
358: [16:56:59] * agent44 quit (Quit: zzz)
359: [16:58:56] * arnhoe quit ()
360: [16:59:42] * arnhoe has joined #silverstripe
361: [17:09:45] * slievr quit (Quit: Leaving.)
362: [17:10:02] * arnhoe quit ()
363: [17:56:31] * UndefinedOffset quit (Quit: Leaving.)
364: [18:00:18] * shellbackpacific quit (Ping timeout: 265 seconds)
365: [18:00:30] * shellbackpacific has joined #silverstripe
366: [18:21:26] * shellbackpacific quit (Ping timeout: 250 seconds)
367: [18:44:32] * Stomach has joined #silverstripe
368: [18:51:09] * UndefinedOffset has joined #silverstripe
369: [19:04:21] * Stomach quit (Quit: zzz)
370: [19:23:13] * UndefinedOffset quit (Quit: Leaving.)
371: [19:43:21] * UndefinedOffset has joined #silverstripe
372: [19:57:54] * Stomach has joined #silverstripe
373: [20:09:47] * shellbackpacific has joined #silverstripe
374: [20:10:00] * wmk quit (Read error: Connection reset by peer)
375: [20:10:09] * wmk has joined #silverstripe
376: [20:16:00] * UndefinedOffset quit (Quit: Leaving.)
377: [20:19:43] * ^pH quit (Ping timeout: 244 seconds)
378: [20:20:09] * UndefinedOffset has joined #silverstripe
379: [20:32:00] * UndefinedOffset quit (Quit: Leaving.)
380: [20:42:38] * gelignite has joined #silverstripe
381: [20:48:24] * Stomach quit (Quit: zzz)
382: [20:59:09] * Stomach has joined #silverstripe
383: [21:06:41] * shellbackpacific quit (Ping timeout: 240 seconds)
384: [21:07:49] * wmk quit (Read error: Connection reset by peer)
385: [21:08:17] * wmk has joined #silverstripe
386: [21:13:13] * wmk quit (Ping timeout: 265 seconds)
387: [21:19:30] * Hailwood has joined #silverstripe
388: [21:33:49] * DanaeNZ has joined #silverstripe
389: [21:56:37] * micmania1 has joined #silverstripe
390: [22:09:04] * MichalKleiner has joined #silverstripe
391: [22:10:50] * micmania1 quit (Quit: micmania1)
392: [22:14:50] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
393: [22:19:11] <DanaeNZ> IT'S THURSDAY??!?!?!?!?!
394: [22:19:19] <ss23> IT'S THURSDAY
395: [22:19:20] <ss23> :D
396: [22:19:22] <ss23> ALMOST FRIDAY
397: [22:20:20] <DanaeNZ> I have like
398: [22:20:24] <DanaeNZ> 100 hours of work to do
399: [22:20:26] <ss23> lol
400: [22:20:27] <DanaeNZ> and like
401: [22:20:29] <ss23> bro just don't work it's great
402: [22:20:31] <DanaeNZ> 40 hours to do it
403: [22:20:34] <ss23> I highly recommend it
404: [22:20:38] <DanaeNZ> hahahah
405: [22:20:43] <DanaeNZ> Oh man sounds amazing
406: [22:22:03] <xyphoid> the week back after holiday'ing is the worst - why am i looking at a computer i'm supposed to be covered in wombats
407: [22:33:29] * Stomach quit (Quit: zzz)
408: [22:33:49] * Stomach has joined #silverstripe
409: [22:51:33] <MichalKleiner> Hai
410: [22:51:48] <ss23> xyphoid: yeah :(
411: [22:51:52] <ss23> xyphoid: week before holiday is bad too
412: [22:52:01] <ss23> I'm going away next week but like... planning to work while away
413: [22:52:03] <ss23> so it's even worse
414: [22:52:07] <ss23> I can't even stop working :(
415: [22:55:50] <xyphoid> ew - i tried to log into a server once while away but hobart airport blocks dropbox for some reason so WELP NO KEYS
416: [22:56:06] <xyphoid> oh no i'll have to keep not working
417: [22:56:11] <MichalKleiner> does anyone know what PHPCS rules helpfulrobot uses?
418: [22:57:17] <Stomach> ss23 where do you work now
419: [22:57:29] <ss23> working at a pentesting place, zx security
420: [22:57:29] <Stomach> MichalKleiner likely https://github.com/FriendsOfPHP/PHP-CS-Fixer
421: [22:57:40] <MichalKleiner> Stomach - that's the tool
422: [22:57:40] <ss23> https://www.zxsecurity.co.nz/ <- i will hack u!!!!
423: [22:57:56] <Stomach> yeah and its following PSR-2 and PSR-4 I imagine
424: [22:58:12] <MichalKleiner> but if I run it with defaults, I think it goes beyond what helpfulrobot does, so I guess there is a SS specific set of switches used
425: [22:58:17] <MichalKleiner> which is what I'm after
426: [22:58:22] <ss23> xyphoid: don't have an SSH tunnel? :P
427: [22:58:38] <Stomach> MichalKleiner ping assertchris on twitter and ask
428: [22:58:44] <Stomach> ss23 - simple HTML only website
429: [22:58:48] <Stomach> definitely a security company
430: [22:58:49] <ss23> :P
431: [22:58:53] <MichalKleiner> will try, thanks
432: [22:59:00] <xyphoid> i couldn't get my keepass file haha - new ipad hadn't downloaded it yet
433: [22:59:04] <ss23> Stomach: even before working here, I was of the mind that more sites should be 100% statically published
434: [22:59:19] <xyphoid> also is ZX named after the ZX spectrum
435: [22:59:19] <Stomach> time, money or security
436: [22:59:21] <Stomach> pick none
437: [22:59:26] <ss23> xyphoid: ya
438: [22:59:30] <xyphoid> sweeet
439: [22:59:34] <ss23> xyphoid: the desk next to me has one
440: [22:59:42] <ss23> coworker was talking about fixing it up and getting it running agian
441: [23:00:09] <ss23> Stomach: tbh, statically published site requires slightly more intial investment then done (for simple sites)
442: [23:00:18] <ss23> Stomach: if your site doesn't have interactivity, is a good idea for lots of reasosn
443: [23:00:25] <Stomach> ss23 yeah definitely
444: [23:00:30] <xyphoid> i gave mine away :(
445: [23:00:48] <ss23> aww xyphoid
446: [23:06:38] <DanaeNZ> I'm heading to Korea/Japan next Friday
447: [23:06:46] <DanaeNZ> so much to do
448: [23:06:51] <Hailwood> Just casually
449: [23:06:52] <DanaeNZ> but I won't be able to work while I'm over there
450: [23:07:06] <DanaeNZ> oh wellll
451: [23:07:10] <ss23> DanaeNZ: wow fancy
452: [23:07:15] <ss23> whatcha visiting?
453: [23:07:25] <DanaeNZ> ss23: heaps bro
454: [23:07:28] <ss23> nice
455: [23:07:28] <DanaeNZ> Seoul
456: [23:07:30] <ss23> how long?
457: [23:07:36] <DanaeNZ> Osaka, Kyoto, Tokyo
458: [23:07:38] <DanaeNZ> 3 weeks
459: [23:07:45] <DanaeNZ> first big trip like, ever
460: [23:07:48] <ss23> I did two weeks for osaka kyoto tokyo :O
461: [23:08:28] <DanaeNZ> well technically I'll be doing 2 weeks
462: [23:08:31] <DanaeNZ> first week is Seoul
463: [23:08:39] <DanaeNZ> lol I have so much planning and buying things to do
464: [23:08:50] <DanaeNZ> Oh shit I'm supposed to go to the bank
465: [23:09:02] <ss23> lol
466: [23:09:16] <ss23> meanwhile I'm like "shit au next week... hope my passport can be found"
467: [23:12:10] * micmania1 has joined #silverstripe
468: [23:12:23] <xyphoid> haha yeah what's this 'vital physical document' thing
469: [23:13:12] <xyphoid> it'll be in dropbox i can find it by searching right?
470: [23:14:33] <ss23> lol
471: [23:14:39] <ss23> I'm pretty sure it'll be in my room *somewhere*
472: [23:14:40] <ss23> she'll be right
473: [23:42:49] * Stomach quit (Quit: zzz)
474: [23:45:58] * Stomach has joined #silverstripe

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