#silverstripe IRC Log

IRC log for 6 April 2016

All timestamps are in UTC.

1: [00:00:01] * ss-helper quit (Remote host closed the connection)
2: [00:00:17] * ss-helper has joined #silverstripe
3: [00:15:56] * BrewNaked quit (Remote host closed the connection)
4: [00:41:53] * Stomach quit (Quit: zzz)
5: [00:46:32] * micmania1 quit (Quit: micmania1)
6: [00:54:38] * Firesphere_ has joined #silverstripe
7: [00:59:42] * Firesphere_ quit (Ping timeout: 248 seconds)
8: [01:08:45] <Hailwood> MichalKleiner, One repo here as well, our initial setup process pulls in our stock theme and then deletes the the .git so it gets tracked under the main project.
9: [01:09:28] <MichalKleiner> cheers for opinions guys
10: [01:10:24] <MichalKleiner> would be interesting to hear about your branching models around that too.. e.g. frontend vs backend work
11: [01:10:52] * Stomach has joined #silverstripe
12: [01:11:44] <MichalKleiner> Stomach: would be interesting to hear about your branching model around that too.. e.g. frontend vs backend work
13: [01:12:01] <MichalKleiner> or multiple devs working on the same project
14: [01:12:07] <Stomach> MichalKleiner - we just use git flow for everything :)
15: [01:13:43] <MichalKleiner> hmm... and what about compiled styles - do you commit them? if not, how do you compile for release?
16: [01:13:58] <Stomach> yeah we commit all production assets
17: [01:14:05] <Stomach> we don't commit node_modules and whatnot
18: [01:14:45] <MichalKleiner> must be pain when merging minified styles, conflicts every time, no?
19: [01:15:20] * Tanger has joined #silverstripe
20: [01:35:18] <Hailwood> MichalKleiner, Currently for us it's a manual release of the minified assets after the git deploy
21: [01:35:56] <Hailwood> But we're working on a solution using hubot and a server with Strider-CD to automate our deployments, including building the assets for us
22: [01:36:04] <MichalKleiner> I realised it's possible to merge dev code and then compile in the release branch so the conflict could be avoided
23: [01:36:21] <MichalKleiner> nice, I was playing with strider a lot and now I have no time to make it useful
24: [01:37:00] <Hailwood> MichalKleiner, I'll keep you in mind if I have any questions ;)
25: [01:37:11] <Hailwood> Oh and for our branching model we also use git-flow
26: [01:37:32] <MichalKleiner> I always found it overkill for our way of work..
27: [01:37:38] <MichalKleiner> might give it another go
28: [01:38:16] <Hailwood> MichalKleiner, We're also looking at using it to automate our composer-updates since we're spending about 15 hours a month on maintenance
29: [01:38:30] <Hailwood> But we have a few hundred sites so yeah
30: [01:38:51] <Stomach> MichalKleiner - not really
31: [01:39:05] <Stomach> you just always over write the build files
32: [01:39:15] <Stomach> a release to get pushed to the server is always a full build
33: [01:40:03] * micmania1 has joined #silverstripe
34: [01:40:20] <Hailwood> Oh for the dev stuff with the merging we have a two pass process, our front-end dev goes through and hard codes (or puts in the simple variables e.g. $Content), then a backend dev goes through and adds the more custom parts
35: [01:40:38] <Hailwood> So we're never working on the same parts at the same time anyway
36: [01:43:31] <Hailwood> Anyone know if you can trigger helpful robot to re-evaluate your addon?
37: [01:45:47] * mahfuz has joined #silverstripe
38: [01:45:53] <Hailwood> Heh, anyone have any context around this? https://github.com/unclecheese/silverstripe-module-zero
39: [01:51:49] <Tanger> Hailwood: Lolwut?
40: [02:04:45] * BrewNaked has joined #silverstripe
41: [02:04:53] <adrexia> looks like its a test case
42: [02:08:57] * BrewNaked quit (Ping timeout: 244 seconds)
43: [02:13:29] <Pyromanik> haha, requires framework over 9000 xD
44: [02:28:47] <spronk> noooo
45: [02:54:35] <MichalKleiner> Pyromanik: you know what was the session problem yesterday that I spent whole day troubleshooting? at the end, it was fck*ing domain.local not behaving. When I changed it to domain.dev or basically anything else, it worked. I read some articles at the end and seems to be chrome/mac issue with .local domains
46: [02:54:37] <MichalKleiner> ridiculous
47: [02:57:45] <Pyromanik> maciculous
48: [02:58:09] <Pyromanik> well, at least you got it sorted :>
49: [02:59:20] <MichalKleiner> all the time I thought it was something wrong with my dev vagrant box or php inside or something.. such a waste of time
50: [03:47:00] <MichalKleiner> guys, how do you limit number of records in gridfield? e.g. has_many with 1 required and up to 4 optional records
51: [03:53:41] * BrewNaked has joined #silverstripe
52: [03:54:47] <Stomach> @MichalKleiner - canCreate() on the object
53: [03:55:07] <Stomach> or by checking the list then removing the add / delete buttons
54: [03:58:22] * BrewNaked quit (Ping timeout: 248 seconds)
55: [04:05:20] * shaunhunter has joined #silverstripe
56: [04:06:13] <vitaly_> Can SS somehow escape single quotes? If I want to put variable in '$var' for js.
57: [04:06:57] <shaunhunter> Hi all, just wondering if anyone has had any luck integrating SS with aws cloudsearch? fulltextsearch does some of the solr work, but it looks like cloudsearch might have different apis
58: [04:09:27] * Kingy[a] is now known as Kingy
59: [04:09:46] <Stomach> '{$var}' vitaly_ ?
60: [04:10:05] <MichalKleiner> Stomach: yeah with checking the list I think it only works with page reload, not ajax-way.. might check the canCreate method but need to return sane message
61: [04:10:54] <vitaly_> Stomach: no, I mean what if $var contains string with ' - js will have a syntax error with unclosed single quote
62: [04:11:05] <Stomach> ohhhhh
63: [04:11:19] <Stomach> you'll have to escape it somewhere
64: [04:26:22] * irogue has joined #silverstripe
65: [04:29:03] <irogue> afternoon folks
66: [04:30:30] <spronk> good afterble constanoon
67: [04:33:01] <Pyromanik> oh gawd, I said that to an officer once
68: [04:33:09] <Pyromanik> at a DIC checkpoint too.
69: [04:33:17] <Pyromanik> she... was not impressed.
70: [04:35:28] <spronk> :(
71: [04:35:31] <spronk> i said it once
72: [04:35:37] <spronk> policeman laughed
73: [04:35:50] * Stomach quit (Quit: bye)
74: [04:37:01] * Stomach has joined #silverstripe
75: [04:53:55] * Admonish has joined #silverstripe
76: [04:55:03] <Admonish> Hey yall, I was woundering if anyone knows of a good way to test (on model validate) if a database record already exists with the same name?
77: [04:55:14] <Admonish> wondering*
78: [05:08:21] * guci0 has joined #silverstripe
79: [05:08:24] <guci0> Hi :)
80: [05:08:47] <Admonish> hello
81: [05:09:04] <Admonish> Welcome the the IRC :D
82: [05:18:17] * Hailwood quit (Remote host closed the connection)
83: [05:21:10] <Stomach> Admonish - you can just do a get()->filter('Title', $this->Title)->count == 0
84: [05:22:15] <Admonish> Thanks a ton. I just found something similar online. So that confirms it :D
85: [05:35:16] * mahfuz quit (Ping timeout: 250 seconds)
86: [05:42:30] * BrewNaked has joined #silverstripe
87: [05:45:24] * wmk has joined #silverstripe
88: [05:47:07] * BrewNaked quit (Ping timeout: 260 seconds)
89: [05:48:55] <Pyromanik> Admonish, yes
90: [05:49:09] <Pyromanik> you had the right idea yesterday
91: [05:49:18] <Pyromanik> but left before seeing answer :>
92: [05:49:49] <Pyromanik> So as you wanted to know, do it in validate is best, yes.
93: [05:50:14] <Admonish> wooties :D
94: [05:50:26] <Pyromanik> Admonish, only, also
95: [05:50:36] <Pyromanik> in surplus to Stomach's line
96: [05:50:51] <Pyromanik> ->exclude('ID', $this->ID)
97: [05:50:53] <Stomach> whaaaaat
98: [05:50:58] <Pyromanik> because otherwise it'll always fail :<
99: [05:51:01] <Pyromanik> (on edits)
100: [05:52:31] <Admonish> ohhhhh
101: [05:52:43] <Admonish> ancient chinese secret !! For the win
102: [05:52:44] <Admonish> thank you
103: [05:53:12] <Pyromanik> Yeh I got it from a fortune cookie.
104: [05:58:18] * micmania1 quit (Quit: micmania1)
105: [06:01:09] * adrexia quit (Quit: My Mac has gone to sleep. ZZZzzz…)
106: [06:05:54] * Mike123 has joined #silverstripe
107: [06:09:25] <wmk> Pyromanik, ☺/
108: [06:10:51] <Admonish> ;D
109: [06:11:37] * Stomach quit (Ping timeout: 260 seconds)
110: [06:16:43] <Pyromanik> \o wmk :)
111: [06:19:25] * Firesphere_ has joined #silverstripe
112: [06:29:47] * cheddam quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
113: [06:30:23] * irogue quit (Ping timeout: 244 seconds)
114: [06:31:02] * cheddam has joined #silverstripe
115: [06:31:41] * cheddam quit (Client Quit)
116: [06:40:43] * spronk quit (Quit: I may need a longer sleep timer...)
117: [06:42:13] * Mike123_ has joined #silverstripe
118: [06:44:10] * Mike123 quit (Ping timeout: 250 seconds)
119: [06:53:38] <Admonish> night all
120: [06:53:46] <Admonish> im going to bed now
121: [06:54:49] <Pyromanik> h
122: [06:54:53] <Pyromanik> g'nite *
123: [07:02:58] <Pyromanik> how is the freedom life treating you so far ss23 ?
124: [07:03:10] * Admonish quit (Quit: ThrashIRC v2.9 sic populo comunicated)
125: [07:04:42] * spronk has joined #silverstripe
126: [07:17:58] * swaiba has joined #silverstripe
127: [07:18:27] <wmk> hi swaiba
128: [07:18:35] <swaiba> hey wmk :)
129: [07:22:14] * arnhoe has joined #silverstripe
130: [07:31:25] * BrewNaked has joined #silverstripe
131: [07:33:59] * Firesphere_ quit (Remote host closed the connection)
132: [07:35:33] * BrewNaked quit (Ping timeout: 240 seconds)
133: [07:37:52] * spronk quit (Quit: I may need a longer sleep timer...)
134: [07:46:45] * spronk has joined #silverstripe
135: [07:59:13] * jackoconnor has joined #silverstripe
136: [08:02:43] * kinglozzer has joined #silverstripe
137: [08:11:02] * slievr has joined #silverstripe
138: [08:20:04] * agent44 has joined #silverstripe
139: [08:23:11] <ss23> Pyromanik: Pretty damn good, daytime drinkin n shit
140: [08:23:12] <ss23> o/
141: [08:24:19] <Pyromanik> \o
142: [08:24:27] <Pyromanik> sounds like liv'n the dream
143: [08:24:39] <Pyromanik> but... do you awake in the daytime?
144: [08:24:53] <swaiba> Pyromanik o/
145: [08:24:54] <Pyromanik> I find your statement a little far-fetched :P
146: [08:25:00] <Pyromanik> \o swaiba :>
147: [08:25:13] * Agilix_ has joined #silverstripe
148: [08:25:21] <ss23> lol Pyromanik
149: [08:25:23] <ss23> Sometimes!
150: [08:25:27] <Pyromanik> lies
151: [08:25:30] <ss23> There's that hour of daytime before I go to bed for the night
152: [08:25:30] <ss23> :D
153: [08:25:32] <ss23> 7-8am
154: [08:25:36] <Pyromanik> xD!
155: [08:25:36] <ss23> Technically day
156: [08:25:45] <Pyromanik> like, the hour before I get up!
157: [08:25:46] <Pyromanik> :P
158: [08:25:55] <Pyromanik> ~9am
159: [08:29:18] * spekulatius quit (Ping timeout: 248 seconds)
160: [08:31:58] * spekulatius has joined #silverstripe
161: [08:46:05] <Agilix_> Is there a type of service in silverstripe? Like with Symfony you can write service classes to hold general functions to re-use in different controllers
162: [08:51:47] * ss32noob has joined #silverstripe
163: [08:51:48] <wmk> Agilix_, you can write your own PHP objects and reuse, yes.
164: [08:52:23] <wmk> and you can write (Data)Extensions (aka decorators) you can plug to different DataObjects or Controller
165: [08:53:16] <ss32noob> hi.. can anyone help me in something.. in silverstripe, there is like a part in the admin "Dependent Pages" wherein you can see other [pages that are linking on that page.. if for example that page has 200 dependent pages.. and if i save that page, does it mean that those 200 pages will be re-save too?
166: [08:53:38] <wmk> nope, afaik not.
167: [08:55:21] <ss32noob> hmm.. because the thing is that i am trying to save a page.. and its timing out.. all other pages that is on the same pagetypes that has around 20 dependent pages seems to be fine..
168: [08:56:00] <wmk> you can check SiteTree onAfterWrite()
169: [08:56:35] <wmk> it updates Virtual Pages
170: [08:57:10] <wmk> which is fine... but might timeout if you have 200 virtual pages linking to the original
171: [08:57:33] <wmk> and of couse - other extensions can hook in and make problems.
172: [08:58:46] <ss32noob> is there a way on how to fix it?
173: [09:15:06] * Tanger quit (Quit: Tanger)
174: [09:19:24] <ss32noob> wmk, do you have any idea how to fix my issue?
175: [09:20:17] * BrewNaked has joined #silverstripe
176: [09:24:57] * spronk quit (Quit: I may need a longer sleep timer...)
177: [09:25:04] * BrewNaked quit (Ping timeout: 260 seconds)
178: [09:37:12] * spronk has joined #silverstripe
179: [09:44:42] * swaiba quit (Remote host closed the connection)
180: [10:00:13] * agent44 quit (Quit: zzz)
181: [10:00:20] <Agilix_> ss32noob: what does your error log say?
182: [10:00:33] * agent44 has joined #silverstripe
183: [10:00:50] * cheddam has joined #silverstripe
184: [10:02:49] * lucinderella has joined #silverstripe
185: [10:04:05] <Pyromanik> Agilix_, describe to me a service class?
186: [10:04:29] <Pyromanik> like... connect to some kind of database? or read from some kind of JSON web API?
187: [10:04:41] <Pyromanik> that kind of 'service'?
188: [10:05:19] * agent44 quit (Ping timeout: 260 seconds)
189: [10:05:19] * lucinderella is now known as agent44
190: [10:05:37] <Pyromanik> if so then yeh, just what wmk said :.
191: [10:05:41] <Pyromanik> :> *
192: [10:06:21] <Pyromanik> just write a class. It doesn't have to be part of the framework, or worked in to certain aspects in order for you to be able to use it.
193: [10:07:00] <Pyromanik> The autoloader will find it and pull it in. So you don't need to use require "random/script.php" or anything.
194: [10:07:11] <Pyromanik> other than that, business as usual.
195: [10:07:18] <wmk> autoloader finds it after a flush
196: [10:13:07] * Azure quit (Ping timeout: 244 seconds)
197: [10:18:13] <Pyromanik> ah, true. But still.
198: [10:18:17] <Pyromanik> :>
199: [10:22:14] * x4j5 has joined #silverstripe
200: [10:39:29] * jcwacky has joined #silverstripe
201: [10:42:07] <wmk> jcwacky, ☺/
202: [10:42:16] <wmk> you helped me a lot yesterday ;)
203: [10:42:19] <jcwacky> So I’m trying to import lots of pages from a non-SilverStripe site into a new SilverStripe site. Using SQL, I’ve copied all the pages into the SiteTree table, and they are appearing in the CMS, but as “Archived”. Attempting to Restore a page gives an error “SiteTree #35 not found”. Who do I need to do to fix this?
204: [10:42:31] <jcwacky> Oh, hi wmk. I did!?
205: [10:43:05] <wmk> well, with your "move main site to subsite" snippet. http://www.silverstrip.es/blog/how-to-move-all-pages-and-dataobjects-from-main-site-to-a-subsite/
206: [10:43:22] <jcwacky> Ah, ha! No probs :P
207: [10:43:51] <wmk> jcwacky, why not import from csv and a custom script?
208: [10:44:04] <wmk> then you can do $newPage->doPublish()
209: [10:44:15] <wmk> and it has the right stuff in the version table
210: [10:44:18] <jcwacky> True, thought SQL would be simpler.
211: [10:44:26] <wmk> there is too much magic there
212: [10:44:29] <jcwacky> :(
213: [10:44:35] <wmk> in theory: copy over to SiteTree_Live etc...
214: [10:44:45] <wmk> but the versioned table is tricky to get it right
215: [10:44:58] * Azure has joined #silverstripe
216: [10:45:07] <wmk> i made some simple personal importers from a big php array i exported on the old site.
217: [10:45:23] <wmk> anything else (json, xml..) might work, but it's always a lot of customisation
218: [10:45:29] <jcwacky> I was hoping once a copy was in SiteTree that _Live and _versions would take care of themselves when any action was performed on the page.
219: [10:45:56] <wmk> hope dies last
220: [10:46:11] <jcwacky> Hmm.
221: [10:46:44] * lucinderella has joined #silverstripe
222: [10:47:19] * agent44 quit (Ping timeout: 260 seconds)
223: [10:47:19] * lucinderella is now known as agent44
224: [10:48:14] <jcwacky> Think I might try get a copy of each page into the _versions table first.
225: [10:54:10] <jcwacky> Ooo, looking promising.
226: [10:56:35] <jcwacky> Bingo, that seems to have done the trick. So each record in SiteTree needs at least 1 record in _versions.
227: [11:00:08] * jackoconnor quit (Quit: jackoconnor)
228: [11:07:02] * jackoconnor has joined #silverstripe
229: [11:09:07] * BrewNaked has joined #silverstripe
230: [11:13:34] * BrewNaked quit (Ping timeout: 240 seconds)
231: [11:16:18] * cheddam quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
232: [11:22:30] <Agilix_> oops Pyromanik & wmk forgot to read it, but yes I just made a class and it's working fine :)
233: [11:23:44] <wmk> nice!
234: [11:30:38] <Pyromanik> :)
235: [11:31:21] <Agilix_> Hmmm bummer, still issues with blog 1.0.0 and they won't help me. And I can't upgrade to 2.0.0
236: [11:33:20] <kinglozzer> Agilix_: Why can't you upgrade?
237: [11:33:48] <Agilix_> Because it won't: - silverstripe/blog 2.0.0 requires silverstripe/tagfield ~1.0.0 -> no matching package found.
238: [11:33:57] <Agilix_> also we extended the tagfield
239: [11:34:29] <Agilix_> and wrote custom code for connecting our Tags with the blog tags. Which is giving an issue: [User Error] Uncaught LogicException: Orphaned $belongs_many_many value for BlogHolder.Tag
240: [11:34:41] <Agilix_> And the issue is when we click on a tag (t )
241: [11:34:51] <Agilix_> And the issue is when we click on a tag (to get all posts with that tag )
242: [11:35:25] <Agilix_> We have "silverstripe/tagfield": "^1.2", btw
243: [11:35:34] <Agilix_> So no idea why it won't update
244: [11:36:24] <Agilix_> ideas / suggestions are welcome :p
245: [11:36:29] <kinglozzer> Well 2.0.0 of blog is quite out of date
246: [11:36:30] <wmk> Agilix_, well, composer issues are a pita, but sometimes you have to re-read the error message
247: [11:36:43] <kinglozzer> And silverstripe/tagfield ~1.0.0 and "silverstripe/tagfield": "^1.2" aren't compatible with each other
248: [11:36:51] <kinglozzer> Agilix_: Try the latest blog
249: [11:36:53] <kinglozzer> 2.4.0
250: [11:36:57] <kinglozzer> Or just ^2.4
251: [11:37:16] <kinglozzer> https://github.com/silverstripe/silverstripe-blog/blob/2.4.0/composer.json#L13 that looks compatible with your ^1.2 requirement
252: [11:37:38] <Agilix_> Hah, done. Thx kinglozzer :)
253: [11:37:43] <Agilix_> Let's see if this does it
254: [11:39:40] <Agilix_> Now I have 2 Lumberjack classes. One in public/lumberjack and one in public/silverstripe-lumberjack :p
255: [11:40:20] <wmk> maybe you have to unistall one module in your composer.json ?
256: [11:40:29] <kinglozzer> Yep ^^
257: [11:40:34] <kinglozzer> Blog will install the correct one automatically
258: [11:40:46] <Agilix_> But there is only ine un my composer
259: [11:40:53] <kinglozzer> Agilix_: There shouldn't be one in your composer
260: [11:40:54] <Agilix_> one*
261: [11:40:54] <kinglozzer> :P
262: [11:41:54] <Agilix_> ow k, that's better
263: [11:42:20] <Agilix_> this has been a terrible week, one mistake after the other (wether they are my fault I leave in the middle :p )
264: [11:43:12] <wmk> steep learning courve?
265: [11:43:33] <Agilix_> No, just a bad week, been feeling ill so making a lot of stupid mistakes
266: [11:45:26] <ss-helper> Re: [silverstripe-dev] "Supported modules" and github.com/silverstripe-labs - https://groups.google.com/d/msg/silverstripe-dev/vgQZpUnxrI4/101e8IHLAwAJ
267: [11:52:57] <Agilix_> Their own migration script is broken -_-
268: [11:53:05] <Agilix_> [User Error] Uncaught Exception: Object->__call(): the method 'publish' does not exist on 'BlogHolder'
269: [11:55:15] * jackoconnor quit (Quit: jackoconnor)
270: [11:55:51] <Agilix_> sorry, /rant :p
271: [11:57:54] * slievr quit (Ping timeout: 246 seconds)
272: [12:05:38] * slievr has joined #silverstripe
273: [12:17:53] * ShannonPatterson has joined #silverstripe
274: [12:18:41] * UndefinedOffset has joined #silverstripe
275: [12:37:59] * jackoconnor has joined #silverstripe
276: [12:42:07] * r3v3rb has joined #silverstripe
277: [12:42:22] <r3v3rb> Hello
278: [12:43:51] <r3v3rb> Is it possible to limit a member to only one group or change via a group extension to has_one/has_many instead of belongs many/many many?
279: [12:45:19] <r3v3rb> I'm building an application where a member will only ever be in a single group and going through ->groups()->first() seems silly all the time...
280: [12:46:36] <r3v3rb> Or could i create a function in my group extension that calls ->groups->first each time? What would be your thoughts?
281: [12:47:44] <r3v3rb> Make that member extension.
282: [12:50:20] <r3v3rb> Second question why does adding a new tab to the group lose all the extra fields i have defined...
283: [12:50:48] <r3v3rb> If i remove the extra tab then the fields appear fine
284: [12:52:10] <r3v3rb> I'm using updateCMSfields
285: [12:54:48] <Agilix_> hi r3v3rb for your first question you could build a function to always get the first with a member extension
286: [12:55:00] <Agilix_> For the second: Do you add the fields to the new tab?
287: [12:56:05] <r3v3rb> Agilix_ that's going to be my route for the groups. Second yes i add the fields but nothing gets added just the default fields
288: [12:58:02] * BrewNaked has joined #silverstripe
289: [13:00:23] <Agilix_> r3v3rb: any chance you could paste some code of the fields ? http://pastie.org/ for example
290: [13:01:01] <r3v3rb> Agilix_unfortunately not right now I'm on my phone not my pc :(
291: [13:02:18] * BrewNaked quit (Ping timeout: 246 seconds)
292: [13:04:22] <Agilix_> r3v3rb: then it's hard to say what could be wrong :)
293: [13:06:03] <Pyromanik> r3v3rb, subclassing member leads to a world of hurt from what I've heard.
294: [13:06:48] <Pyromanik> but you could check group assignment, and limit to 1 group iff groupname contains $whatever
295: [13:06:51] <Pyromanik> or something.
296: [13:06:54] <Pyromanik> via extensions
297: [13:07:04] <Pyromanik> and with that, it's bedtime.
298: [13:07:06] <Pyromanik> g'nite!
299: [13:07:13] * Pyromanik quit (Quit: Leaving)
300: [13:24:08] * ss32noob quit (Ping timeout: 250 seconds)
301: [13:24:42] <r3v3rb> Agilix_ yeti it'll have to wait until next week
302: [13:24:52] <r3v3rb> Yes*
303: [13:26:58] <r3v3rb> Time to go out for a bit
304: [13:27:01] <r3v3rb> Bbl
305: [13:59:06] * muskie9 has joined #silverstripe
306: [14:00:08] * spronk quit (Quit: I may need a longer sleep timer...)
307: [14:33:58] <Agilix_> Can anyone help out? I need to get all the BlogPosts matched to the tags I loop. But instead I get them all. http://pastie.org/10787587
308: [14:34:21] <Agilix_> If I do not create the Datalist I get the result for one tag but not multiple
309: [14:34:32] * arnhoe quit ()
310: [14:41:36] <Agilix_> wmk kinglozzer any ideas?
311: [14:43:57] <kinglozzer> Agilix_: I'm a bit confused here... so the tags aren't actually related to the blog posts? You just use tags to partial match the title?
312: [14:44:09] <kinglozzer> Ohhh!
313: [14:44:16] <kinglozzer> Sorry, I misread completely >.<
314: [14:44:55] <kinglozzer> Agilix_: Is BlogTag related to BlogPost via a many_many?
315: [14:45:14] <kinglozzer> If so, you can just do $tags = BlogTag::get()... return $tags->relation('BlogPosts');
316: [14:45:17] <ss-helper> Validation Controller inside CMS in Silverstripe - http://stackoverflow.com/questions/36454362/validation-controller-inside-cms-in-silverstripe
317: [14:46:51] * BrewNaked has joined #silverstripe
318: [14:47:40] <Agilix_> Ah, Ill check that
319: [14:48:39] <Agilix_> Works like charm, thx kinglozzer
320: [14:48:59] <Agilix_> so relation gets all the specified related items in a datalist then?
321: [14:49:16] <kinglozzer> Sweet :) much more efficient that way too as it only has to make one query, instead of one query for each item in the foreach loop
322: [14:49:37] <kinglozzer> Yep, it does one query to get all the IDs in the DataList, then a second query to get all related items based on those IDs
323: [14:50:23] <Agilix_> ah nice
324: [14:51:03] * BrewNaked quit (Ping timeout: 244 seconds)
325: [14:53:09] * agent44 quit (Quit: zzz)
326: [14:53:31] * agent44 has joined #silverstripe
327: [15:10:44] * Mike123_ quit (Ping timeout: 250 seconds)
328: [15:21:47] * slievr_ has joined #silverstripe
329: [15:24:04] * slievr quit (Ping timeout: 240 seconds)
330: [16:12:42] * Agilix_ quit (Ping timeout: 250 seconds)
331: [16:21:19] * kinglozzer quit ()
332: [16:24:43] * jackoconnor quit (Quit: jackoconnor)
333: [16:28:17] * toddv has joined #silverstripe
334: [16:29:27] <toddv> Hi everyone...can anyone help me figure out how to dynamically set the Title of a page? I'd like to set the title of the page to be the current date/time.
335: [16:31:30] <muskie9> public function getTitle(){ return date('m-d-Y h:i', strtotime('now')); } in your model
336: [16:31:39] <muskie9> toddv ^
337: [16:33:40] <toddv> @muskie thanks. would that set the title/Page Name as date in the db as well? IMy goal is to set date as title and have url-segment adjust accordingly to use date. Thanks
338: [16:35:53] <muskie9> no, that's just to present it on page load... you'll want to use something like populateDefaults in your model instead: https://docs.silverstripe.org/en/3.3/developer_guides/model/how_tos/dynamic_default_fields/
339: [16:37:04] <toddv> public function populateDefaults() {
340: [16:37:04] <toddv> $this->Title = date('Y/m/d g:i');
341: [16:37:04] <toddv> parent::populateDefaults();
342: [16:37:06] <toddv> }
343: [16:37:21] <toddv> @muskie9, yeah, tried the above and not working
344: [16:37:41] <muskie9> can you paste your page
345: [16:37:43] <muskie9> !paste
346: [16:37:43] <ss-helper> Please paste your code using something like http://kopy.io/ or http://www.sspaste.com/ or https://gist.github.com/ and then paste the link here.
347: [16:39:24] <toddv> Here ya go: http://kopy.io/nrqQX
348: [16:40:11] <muskie9> try calling the parent::populateDefaults() before your title set line
349: [16:42:31] <muskie9> so switch 67 and 68
350: [16:43:38] * BrewNaked has joined #silverstripe
351: [16:45:16] * wmk quit (Ping timeout: 244 seconds)
352: [16:45:17] <toddv> That didn't work either. Still seeing the SS default 'New Discussion Page' as Title
353: [16:48:51] * slievr_ quit (Ping timeout: 244 seconds)
354: [16:51:16] <muskie9> I'm wondering if you have to put that in a DataExtension and apply it to your page... I feel like I've added it directly to a page before
355: [16:53:18] <toddv> Cool. Thanks for the help. Will try to go that route.
356: [16:55:12] <muskie9> I tried back tracking to find the call that sets the title but haven't had any luck finding it
357: [16:57:15] <toddv> I'm guessing it is in SiteTree's getCMSFields
358: [16:57:47] * agent44 quit (Quit: zzz)
359: [16:58:42] <toddv> maybe an updateCMSFields method on an extension might work?
360: [16:59:14] <muskie9> that would probably work... replace the title field with a new text field with your time stamp
361: [17:00:28] <muskie9> thinking more about that... if you set the value of the field, it'll always update to current date/time on save, rather than just on the initial save
362: [17:03:52] * x4j5 quit (Ping timeout: 244 seconds)
363: [17:03:55] <toddv> could a if(!$this->ID) {... wouldn't break me out of that craziness?
364: [17:04:54] <muskie9> that or if($this->exists()) I think... but when you create a new page, it's automatically written to the db as a draft, so pages will always have an ID... DataObjects aren't written initially
365: [17:07:40] <toddv> yeah, bummer. hhmmm
366: [17:15:19] <toddv> guessing a data-object-as-page set up would work better where an initial title isn't set and I can use $this->exists().
367: [17:30:43] <muskie9> that could work
368: [17:31:15] * arnhoe has joined #silverstripe
369: [17:35:59] * r3v3rb has joined #silverstripe
370: [17:36:13] <r3v3rb> Hi again
371: [17:36:18] <r3v3rb> who's home?
372: [17:42:28] * r3v3rb quit (Quit: Leaving)
373: [17:52:04] * BrewNaked quit (Remote host closed the connection)
374: [17:54:14] * ShannonPatterson quit (Quit: Leaving)
375: [18:04:22] * Kingy is now known as Kingy[a]
376: [18:10:34] * guci0 quit (Ping timeout: 250 seconds)
377: [18:11:55] * BrewNaked has joined #silverstripe
378: [18:18:09] * arnhoe quit ()
379: [18:26:25] * gelignite has joined #silverstripe
380: [18:33:34] * cloph is now known as cloph_away
381: [19:01:39] * Phlunk3 has joined #silverstripe
382: [19:23:58] * x4j5 has joined #silverstripe
383: [19:54:38] * Stomach has joined #silverstripe
384: [19:58:04] * x4j5 quit (Ping timeout: 252 seconds)
385: [20:16:53] * Liquide has joined #silverstripe
386: [20:30:40] <ss-helper> Re: [silverstripe-dev] "Supported modules" and github.com/silverstripe-labs - https://groups.google.com/d/msg/silverstripe-dev/vgQZpUnxrI4/jeGNACzoAwAJ
387: [20:43:01] * helenclarko has joined #silverstripe
388: [20:43:29] <helenclarko> muskie9: Quick one for ya.
389: [20:43:35] <muskie9> what's up
390: [20:44:31] <helenclarko> So I have a dataobject which has a bunch of data in it (added by an admin account). Now if I login to the CMS with a standard user all data is gone from the gridfield
391: [20:45:13] <muskie9> make sure canView on the DataObject managed by the gridfield is set to return true... or implement permission provider for CRUD on that object so you can turn that on/off in the security section of the cms
392: [20:45:39] <helenclarko> I've found a quick perms check. public function canView($member = null) { return Permission::check('ADMIN', 'any'); }
393: [20:47:24] <muskie9> I think the 'any' is the default, but that will only return true if the member is in the ADMIN group... so if you return true; it will allow all to see it... if you need specific groups to have canView permission it's probably easier in the long run to use permission provider
394: [20:48:52] <helenclarko> public function canView($member = null) {Return "True";}
395: [20:48:55] <helenclarko> Thats it?
396: [20:49:17] <muskie9> well, a normal { return true; } but ya
397: [20:49:37] <helenclarko> Opps
398: [20:49:40] <muskie9> DataObjects need the canView to return true for non-admin accounts to be able to view them in a gridfield...
399: [20:49:42] <helenclarko> Yup, I gotcha
400: [20:49:54] <muskie9> at least that's what I've run into in the past
401: [20:50:12] <helenclarko> Guess I've never needed other users.
402: [20:51:46] <muskie9> I usually have our content/QA person message me every project saying their account doesn't have permissions for most grid fields lol
403: [20:55:46] <helenclarko> Haha.
404: [20:55:59] <helenclarko> Guess I'm going to see that more and more now.
405: [20:56:07] <helenclarko> Thats done the trick BTW.
406: [20:56:10] <helenclarko> Thanks again
407: [20:56:21] * UndefinedOffset quit (Quit: Leaving.)
408: [20:57:43] * Hailwood has joined #silverstripe
409: [20:58:40] * adrexia has joined #silverstripe
410: [20:59:23] <helenclarko> Actually muskie9, rather than canview should it not be canedit
411: [20:59:37] <helenclarko> I want them to be able to edit them too
412: [20:59:41] <muskie9> that too... pretty much each of the 'can' methods need to return true
413: [21:00:40] <ss-helper> Re: [silverstripe-dev] "Supported modules" and github.com/silverstripe-labs - https://groups.google.com/d/msg/silverstripe-dev/vgQZpUnxrI4/Z-wtpZrpAwAJ
414: [21:01:19] * MichalKleiner quit (Ping timeout: 252 seconds)
415: [21:02:18] <muskie9> here's what we've started to do... a basic CRUD permission provider that can be applied per group: https://github.com/dynamic/foxystripe/blob/1.2/code/pages/ProductPage.php#L327
416: [21:04:38] * Admonish has joined #silverstripe
417: [21:05:31] * pixelboy has joined #silverstripe
418: [21:06:27] * MichalKleiner has joined #silverstripe
419: [21:07:11] <pixelboy> guys, i have a dataobject inside a proprety page that has image and caption, I have a function in page.php to return all properties and when i loop the properties, i can access the dataobject and all the images inside it but when i try to loop the dataobject inside the actual page itself i get nothing
420: [21:08:10] <pixelboy> anyone got any idea why's that
421: [21:11:42] * shaunhunter quit (Ping timeout: 250 seconds)
422: [21:12:34] * Admonish quit (Quit: ThrashIRC v2.9 sic populo comunicated)
423: [21:12:57] * Admonish has joined #silverstripe
424: [21:13:20] * Admonish has left #silverstripe
425: [21:13:45] * Admonish has joined #silverstripe
426: [21:13:54] <Admonish> Hey yall :D
427: [21:14:38] <Stomach> good morning
428: [21:14:58] <muskie9> o/
429: [21:15:01] <Admonish> same to you :D
430: [21:15:41] <ss-helper> Re: [silverstripe-dev] "Supported modules" and github.com/silverstripe-labs - https://groups.google.com/d/msg/silverstripe-dev/vgQZpUnxrI4/Y2Ub4djqAwAJ
431: [21:15:41] <ss-helper> Re: [silverstripe-dev] "Supported modules" and github.com/silverstripe-labs - https://groups.google.com/d/msg/silverstripe-dev/vgQZpUnxrI4/DMobKTPqAwAJ
432: [21:15:41] <Admonish> I really got to stop using those smilies XD
433: [21:15:53] <muskie9> :D
434: [21:22:01] * camfindlay has joined #silverstripe
435: [21:23:36] * jules0x has joined #silverstripe
436: [21:29:33] * micmania1 has joined #silverstripe
437: [21:29:36] <Admonish> Does anyone know how to check an uploadField in the validator function? Im trying to check if a file was uploaded or not (if($this->File =='' ) but it doesn't seem to work.
438: [21:29:40] * camfindlay quit (Quit: camfindlay)
439: [21:30:09] <muskie9> if($this->FileID == 0) { $this->error() } or what have you
440: [21:30:40] <muskie9> assuming your object/page you're working in has_one File
441: [21:30:53] <Hailwood> Morning folks
442: [21:30:55] <Admonish> Thank you for your help muskie :D
443: [21:31:06] <Admonish> and yes your assumption is correct
444: [21:33:10] <Admonish> darn I used dat smiley face again :(
445: [21:33:16] <muskie9> lol
446: [21:33:18] <Admonish> ARRGGG
447: [21:35:09] * MichalKleiner quit (Remote host closed the connection)
448: [21:36:31] <Admonish> Also what is the Object for files? I want to do a get_by_id on it so I can retrieve the filename and path
449: [21:36:50] <Admonish> I looked in the api docs for File with no avail
450: [21:37:20] <muskie9> Admonish I believe it's just File
451: [21:37:36] <muskie9> File::get()->byID($id);
452: [21:38:19] * nyeholt has joined #silverstripe
453: [21:38:22] <Admonish> I will try that out
454: [21:38:24] <Admonish> Thanks
455: [21:40:15] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
456: [21:40:56] <Admonish> ahh yes i found it. I used a search engine to search for the file object and found it. http://api.silverstripe.org/3.1/class-File.html
457: [21:41:43] * MichalKleiner has joined #silverstripe
458: [21:42:38] * MichalKl_ has joined #silverstripe
459: [21:45:00] * Stomach quit (Quit: zzz)
460: [21:45:58] * MichalKleiner quit (Ping timeout: 244 seconds)
461: [21:52:07] * Admonish quit (Ping timeout: 244 seconds)
462: [21:52:46] * agent44 has joined #silverstripe
463: [21:55:36] * Stomach has joined #silverstripe
464: [21:56:22] * MichalKl_ is now known as MichalKleiner
465: [21:56:51] <MichalKleiner> o/
466: [21:57:45] <muskie9> \o
467: [22:09:54] * micmania1 quit (Quit: micmania1)
468: [22:17:03] * toddv quit ()
469: [22:17:11] * toddv has joined #silverstripe
470: [22:17:16] * toddv quit (Client Quit)
471: [22:21:43] * cheddam has joined #silverstripe
472: [22:21:54] * helenclarko quit (Ping timeout: 250 seconds)
473: [22:21:58] * Kolin has joined #silverstripe
474: [22:22:10] * agent44 quit (Quit: zzz)
475: [22:24:27] * micmania1 has joined #silverstripe
476: [22:24:34] * Admonish has joined #silverstripe
477: [22:25:37] * Stomach quit (Quit: zzz)
478: [22:29:04] * Stomach has joined #silverstripe
479: [22:32:35] * muskie9 quit (Quit: Textual IRC Client: www.textualapp.com)
480: [22:38:05] * pixelboy quit (Remote host closed the connection)
481: [22:39:36] * micmania1 quit (Quit: micmania1)
482: [22:40:11] * nyeholt quit (Ping timeout: 244 seconds)
483: [22:59:01] * spronk has joined #silverstripe
484: [23:31:52] * micmania1 has joined #silverstripe
485: [23:39:12] * Azure|dc has joined #silverstripe
486: [23:40:16] * Azure quit (Ping timeout: 252 seconds)
487: [23:50:35] <Admonish> Hey there yall. I have a php question. I see that php has a built in zip archive class and I was wondering if its possible to get the folder structure without extracting its contents. I ask because I need to be able to test user uploaded zip files to see if they match a spacific folder structure. Ideally I wouldnt want to have to extract the contents every time I do this (as the zip files will be stored as zip files on the server)
488: [23:52:00] <Admonish> Btw I don't necsessarily have to use the zip archive class.
489: [23:59:21] * BrewNaked quit (Remote host closed the connection)

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