#silverstripe IRC Log

IRC log for 24 April 2013

All timestamps are in UTC.

1: [00:05:00] * SticksM has joined #silverstripe
2: [00:13:00] * nickmolhoek quit (Remote host closed the connection)
3: [00:13:00] * nickmolhoek has joined #silverstripe
4: [00:19:00] * tari quit (Remote host closed the connection)
5: [00:22:00] * clodeindustrie quit (Quit: Textual IRC Client: www.textualapp.com)
6: [00:46:00] * Bollig|DesignCty has joined #silverstripe
7: [00:50:00] * nickmolhoek has joined #silverstripe
8: [00:50:00] * nickmolhoek has joined #silverstripe
9: [00:50:00] * nickmolhoek quit (Remote host closed the connection)
10: [00:56:00] * aatch has joined #silverstripe
11: [00:57:00] <Bollig|DesignCty> hey, is there any way to easily set different templates for RSS feeds?
12: [01:00:00] * Motoservo has joined #silverstripe
13: [01:07:00] <Bollig|DesignCty> I was thinking it might be easiest to subclass it, anyone have an easier solution?
14: [01:08:00] <FrozenFire> Isn't RSS just one format?
15: [01:08:00] <FrozenFire> I mean, yeah, you can add different namespaces and whatnot
16: [01:08:00] <FrozenFire> Different templates for... RSS feeds?
17: [01:09:00] <FrozenFire> But... just do that in one.
18: [01:15:00] * Marvanni quit ()
19: [01:18:00] * Motoservo quit (Quit: Shhh. I'm trying to get some sleep here.)
20: [01:18:00] <Colin[pi]> yeah RSS really needs just one template, right?
21: [01:24:00] * Motoservo has joined #silverstripe
22: [01:42:00] * Motoservo quit (Quit: Shhh. I'm trying to get some sleep here.)
23: [01:46:00] <Bollig|DesignCty> yes, different templates for RSS feeds.
24: [01:47:00] <Bollig|DesignCty> different data might need different formatting depending on the type, so an event might have multiple dates, or specific items might have images, etc, that need to be included on the feed.
25: [01:48:00] <Bollig|DesignCty> These feeds will be used to fill an external system with something other than 'title', 'content'.
26: [01:51:00] * robert_ has joined #silverstripe
27: [01:55:00] <Bollig|DesignCty> lol
28: [01:55:00] <FrozenFire> Bollig|DesignCty, I think you're doing it wrong
29: [01:55:00] <FrozenFire> You probably just want... XML
30: [01:56:00] <FrozenFire> You don't need a standardized format if you're also the one consuming it elsewhere
31: [01:56:00] <simon_w> Because it's really simple, stupid
32: [01:56:00] <Colin[pi]> RSS is XML!
33: [01:56:00] <Bollig|DesignCty> except it's a standard that the external system reads?
34: [01:56:00] <Bollig|DesignCty> no, I want RSS??? If I wanted XML I'd use it :p
35: [01:56:00] <FrozenFire> Just sounds like there's no reason to use RSS
36: [01:56:00] <Bollig|DesignCty> that's okay, Subclassing should do fine.
37: [01:57:00] <Bollig|DesignCty> still a separate standard
38: [01:57:00] <Bollig|DesignCty> html is xml, but you know...
39: [01:57:00] <FrozenFire> SGML
40: [01:57:00] <FrozenFire> Not XML
41: [01:57:00] <simon_w> html is in no way xml :p
42: [01:57:00] <FrozenFire> XML and HTML are SGML
43: [01:58:00] <FrozenFire> My point is that, you're obviously packing complex data into this transmission format
44: [01:58:00] <Bollig|DesignCty> so I'm using RSS.
45: [01:58:00] <Bollig|DesignCty> again, the external system reads RSS???
46: [01:58:00] <FrozenFire> If you just use XML, without the RSS hackery, then it'll be much easier
47: [01:58:00] <FrozenFire> So restricting yourself to RSS is *adding* complexity.
48: [01:59:00] <Bollig|DesignCty> And it's not complex data, adding images to RSS is will within spec. All I want is to be able to specify things like the format of dates, amount of content to include etc for different data objects :)
49: [01:59:00] <FrozenFire> Alright. Wasn't sure if you were also writing the consumer code.
50: [01:59:00] <EasyCo> WHen I create seed data in requireDefaultRecords() everything is sweet except the records are created as drafts. How do you publish them programatically? http://api.silverstripe.org/3.0/source-class-CMSMain.html#_publish isn't' very descriptive.
51: [02:00:00] <FrozenFire> And even having used SS in the most complex of ways for almost a year now, I don't know.
52: [02:00:00] <FrozenFire> EasyCo, Common problem.
53: [02:00:00] <EasyCo> I think I may have a solutions actually
54: [02:01:00] * FrozenFire goes back to eating his Cocoa Pebbles
55: [02:01:00] <FrozenFire> simon_w probably knows
56: [02:01:00] <EasyCo> I'll let you know ;)
57: [02:05:00] <unsigned_> Quick question: Within a template, how can you generate a URL to another page?
58: [02:05:00] <unsigned_> suitable for the href attribute of an <a> tag
59: [02:06:00] <unsigned_> Any page in the tree? In this particular case I need to link to a page that isnt in the current pages hierarchy
60: [02:06:00] <FrozenFire> To which page?
61: [02:06:00] <FrozenFire> (An intentional question)
62: [02:07:00] <EasyCo> jjjj60G
63: [02:07:00] <EasyCo> FrozenFire: Woohoo, got it. I'll gist it for you :)
64: [02:07:00] <Bollig|DesignCty> unsigned_: yeah, pass the links through from php. that allows you to get specific page types and send the link (or entire page object) through to the template
65: [02:07:00] <simon_w> EasyCo, ->publish('Stage', 'Live')
66: [02:07:00] <EasyCo> Oops, that's not vim
67: [02:07:00] <FrozenFire> I usually have a SiteConfig extension which contains important page links
68: [02:08:00] <unsigned_> understood
69: [02:09:00] <simon_w> Versioned
70: [02:09:00] <EasyCo> simon_w: What class is that public method from?
71: [02:09:00] <EasyCo> Ahh, got it. you beauty.
72: [02:10:00] <EasyCo> You're way is just a tad shorter :)
73: [02:10:00] <EasyCo> I was doing $cms = new CMSMain(); $test = $cms->getRecord($id); $cms->performPublish($test);
74: [02:10:00] <FrozenFire> Wowsa
75: [02:10:00] <FrozenFire> :P
76: [02:11:00] <EasyCo> Ahh common, it's not THAT bad!
77: [02:11:00] <FrozenFire> That's far and away the worst possible method of doing it I could imagine
78: [02:11:00] <simon_w> Yes, yes it is
79: [02:12:00] <simon_w> It won't work when you're not logged in as an admin for one
80: [02:12:00] <EasyCo> That's no buggy, cause it's only used when seeding between branches
81: [02:12:00] <EasyCo> *biggy
82: [02:19:00] <EasyCo> simon_w: Can you do that on the record before you ->write()?
83: [02:19:00] <simon_w> EasyCo, no
84: [02:20:00] <EasyCo> oktx
85: [02:22:00] * gelignite quit (Quit: http://bit.ly/nkczDT)
86: [02:35:00] * nicolaas quit (Quit: ChatZilla 0.9.90 [Firefox 20.0/20130329030352])
87: [02:54:00] <Colin[pi]> is there a field for SS that will show a dropdown of options, but offer free text if the desired option doesn't exist?
88: [03:08:00] * Zauberfisch has joined #silverstripe
89: [03:09:00] <Colin[pi]> k I'll just do the old fashioned dropdown + textfield
90: [03:09:00] <FrozenFire> Sounds like maybe ListboxField, except with no actual settings
91: [03:09:00] <FrozenFire> Probably not
92: [03:17:00] <Zauberfisch> good morning
93: [03:31:00] <FrozenFire> http://6.asset.soup.io/asset/2278/9062_9daa.gif
94: [03:32:00] <EasyCo> Hah, that's cool
95: [03:49:00] * nickmolhoek quit (Quit: nickmolhoek)
96: [03:53:00] * cloph_away1 has joined #silverstripe
97: [03:54:00] * cloph_away quit (Ping timeout: 252 seconds)
98: [03:59:00] <EasyCo> Is there a method for setting the sort order in the Page menu?
99: [04:04:00] * SightUnseen has joined #silverstripe
100: [04:06:00] * SightUnseen has left #silverstripe
101: [04:15:00] <Zauberfisch> EasyCo in the CMS or frontend?
102: [04:15:00] <EasyCo> CMS. Programmatically.
103: [04:15:00] <Zauberfisch> well, you can overwrite the stageChildren method and sort it there
104: [04:16:00] <Zauberfisch> stageChildren is used by the cms to display the children
105: [04:16:00] <Zauberfisch> but is also used by the normal Children method you use in template
106: [04:16:00] <Zauberfisch> in 2.4 stageChildren works with DataObjectSet, in 3.0 with ArrayList
107: [04:17:00] <Zauberfisch> and as of 3.1 beta 2 with DataList
108: [04:17:00] <Zauberfisch> so if you run 3.1 you can just overwrite it, and then call ->sort() on the list
109: [04:18:00] <EasyCo> Gotcha, I don't think I'll bother. It's just seeded data. I'll chuck that in the "not worth it yet" basket.
110: [04:19:00] <Zauberfisch> well, it really is just 5 lines
111: [04:36:00] * Zauberfisch quit (Remote host closed the connection)
112: [04:36:00] * Pyromanik quit (Quit: leaving)
113: [04:37:00] * joelpittet has joined #silverstripe
114: [04:54:00] * mobiusnz quit (Quit: Leaving.)
115: [04:58:00] * Shrike_Finland1 quit (Quit: Leaving.)
116: [05:16:00] * joelpittet quit (Remote host closed the connection)
117: [05:28:00] * Zauberfisch has joined #silverstripe
118: [05:39:00] <EasyCo> The weirdest thing is happening. I don't know if its related to SilverStripe but my CSS file is just partially loading
119: [05:40:00] <Zauberfisch> define partially loaded
120: [05:41:00] <EasyCo> As in when I view source, the css file just stops mid-line.
121: [05:42:00] <EasyCo> I use guard with Compass and when I save my sass file, it compiles fine in app.css where it looks fine.
122: [05:42:00] <EasyCo> I refresh the page, and I can see just a part of the newly added css.
123: [05:43:00] <EasyCo> fine in the browser that is
124: [05:43:00] <EasyCo> If I delete the app.css and force guard to re-compile everything is fine
125: [05:44:00] <EasyCo> If I go back and modify a line in the sass file, guard runs and recompiles. app.css looks fine. But if I refresh I just get a partially loaded css file again
126: [05:45:00] * wmk has joined #silverstripe
127: [05:46:00] <EasyCo> Browser independent.
128: [05:48:00] <EasyCo> I'm wondering if there's an encoding issue cause I sometimes get ???
129: [05:52:00] <FrozenFire> Likely
130: [05:53:00] <FrozenFire> Though possibly just your SASS compiler breaking
131: [05:53:00] <FrozenFire> I've never used SASS, but surely there's a log for its errors?
132: [05:54:00] <EasyCo> I thought that but my output file looks fine.
133: [05:55:00] <FrozenFire> Hrmm
134: [05:55:00] <FrozenFire> What browser are you using?
135: [05:55:00] <FrozenFire> You could look at the network panel in Chromium's inspector
136: [05:55:00] <EasyCo> I'm running the file through a validator to see if it catches anything
137: [05:55:00] <FrozenFire> It'll tell you if you're getting a shorted Content-Length or something
138: [05:55:00] <EasyCo> I tried in a few browsers all with the same result
139: [05:55:00] <EasyCo> I'll have a look
140: [06:02:00] * Shrike_Finland has joined #silverstripe
141: [06:04:00] * Error404NotFound has joined #silverstripe
142: [06:08:00] * osterlaus has joined #silverstripe
143: [06:20:00] <Zauberfisch> EasyCo have you compared file size?
144: [06:20:00] <Zauberfisch> and when it fails in the browser, is the file ok when you open it in a text editor?
145: [06:21:00] <EasyCo> but yah, I'm also using Zurb Foudation 4
146: [06:21:00] <EasyCo> dev VM, a vagrant setup on CentOS
147: [06:21:00] <Zauberfisch> real localhost or dev VM?
148: [06:21:00] <EasyCo> I think i've isolated the issue
149: [06:21:00] <EasyCo> localhost
150: [06:21:00] <EasyCo> Yep and yep
151: [06:21:00] <Zauberfisch> are you working on localhost or a remote
152: [06:22:00] <EasyCo> If I commented out Zurb Foundation includes it shows up fine in the browser
153: [06:25:00] <EasyCo> Farkk, so weird. I erase everything in my sass file. And just put a simple css statement and compile the file out to .css. I open the CSS file in VIM and it looks fine.
154: [06:26:00] <EasyCo> I refresh the browser and the one line of css loads fine
155: [06:28:00] <EasyCo> However!
156: [06:29:00] <EasyCo> If I uncomment all the Zurb Foundation @imports and recompile CSS, the CSS file in VIM looks fine but when I refresh the browser I get a css version about 4 refreshes back.
157: [06:31:00] <Zauberfisch> EasyCo do you work on the dev vm or do you work localhost and auto upload to dev vm?
158: [06:31:00] <EasyCo> When all else fails??? reboot I guess!
159: [06:32:00] <EasyCo> Zauberfisch: I work locally in a folder that's shared/linked to the public_html in the dev VM
160: [06:33:00] <EasyCo> I restarted the VM as well just to make sure.
161: [06:33:00] <Zauberfisch> maybe that shared folder is the issue?
162: [06:34:00] <EasyCo> i never had an issue before, but yah, that's my next path to check
163: [06:34:00] <EasyCo> Gonna reboot my entry machine first
164: [06:34:00] <EasyCo> locally
165: [06:34:00] <Zauberfisch> I had an issue like that, I also work and compile locally, and auto upload via sftp to the dev vm
166: [06:34:00] <EasyCo> Everything is local, the CentOS VM is purely used to serve
167: [06:34:00] <Zauberfisch> that is always 1 version behinde because I can't get the auto uploader to wait for the compile to finish
168: [06:34:00] <Zauberfisch> do you compile localy or in the VM?
169: [06:35:00] <EasyCo> anyways, reboot, brb
170: [06:35:00] <EasyCo> Ah right, nah my setup is instant
171: [06:36:00] * EasyCo quit (Quit: EasyCo)
172: [06:37:00] * Colin[pi] quit (Ping timeout: 252 seconds)
173: [06:41:00] * zfmf has joined #silverstripe
174: [06:41:00] * zfmf quit (Read error: Connection reset by peer)
175: [06:42:00] * zfmf has joined #silverstripe
176: [06:42:00] * zfmf has joined #silverstripe
177: [06:42:00] * zfmf quit (Remote host closed the connection)
178: [06:45:00] * simon_w quit (Quit: This computer has gone to sleep)
179: [06:48:00] * EasyCo has joined #silverstripe
180: [06:48:00] <EasyCo> No go. This is driving me up the fucking wall.
181: [06:52:00] * Motoservo has joined #silverstripe
182: [06:52:00] <EasyCo> Hrmm, if I open the compile app.css in directly in my VM and just re-save it, everything works.
183: [06:54:00] * osterlaus quit (Quit: Leaving.)
184: [06:55:00] <Zauberfisch> EasyCo hmmm, sounds like some encoding problem
185: [06:58:00] * priithansen has joined #silverstripe
186: [06:58:00] <elgrodo> EasyCo: Maybe download the css file in question using wget before and after your resave trick above, and look at the diff?
187: [07:05:00] * ss-log has joined #silverstripe
188: [07:13:00] <EasyCo> GOT IT
189: [07:14:00] <EasyCo> Well that was a good 3 hours wasted
190: [07:15:00] <EasyCo> Man that was a mission
191: [07:15:00] <EasyCo> FYI: I had to set EnableSendFile to Off in httpd.conf
192: [07:15:00] <EasyCo> Has to do with NFS-mounted fileystems
193: [07:15:00] * Error404NotFound quit (Ping timeout: 245 seconds)
194: [07:22:00] <EasyCo> Thanks for the help and suggestions fellahs
195: [07:23:00] * EasyCo quit (Quit: EasyCo)
196: [07:24:00] * Motoservo quit (Quit: Shhh. I'm trying to get some sleep here.)
197: [07:25:00] * SightUnseen has joined #silverstripe
198: [07:27:00] * osterlaus has joined #silverstripe
199: [07:32:00] <ss23> haha "If the designers got off their asses and helped with advertising Reiser style, maybe people would actually have heard of ZFS ;)"
200: [07:32:00] * SticksM quit (Read error: Connection reset by peer)
201: [07:37:00] * Motoservo has joined #silverstripe
202: [07:45:00] * SightUnseen has left #silverstripe
203: [07:47:00] * mobiusnz quit (Quit: Leaving.)
204: [07:47:00] <osterlaus> hi there. could any core developer restart the travis build at https://travis-ci.org/silverstripe/sapphire/builds/6574402 -- it should go fine, i think, but got a timeout yesterday
205: [07:50:00] <simon_w|air> I suppose so
206: [07:51:00] <osterlaus> thanks simon!
207: [07:52:00] * qlex has joined #silverstripe
208: [07:52:00] * qlex says hi
209: [07:54:00] <qlex> im still in search for a gallery module for ss3 which has albums and allows to upload images through Pages rather than using Files too (like cwsoft gallery module)
210: [07:54:00] <qlex> ss3Gallery by Opticblaze i guess only supports one page=one gallery
211: [07:56:00] * mobiusnz has joined #silverstripe
212: [07:56:00] * unsigned_ quit (Read error: Connection reset by peer)
213: [07:57:00] * unsignedint has joined #silverstripe
214: [07:59:00] * kinglozzer has joined #silverstripe
215: [08:06:00] * popeshoe has joined #silverstripe
216: [08:07:00] * Liquide quit ()
217: [08:24:00] * waveydave has joined #silverstripe
218: [08:24:00] <qlex> anyone ?
219: [08:26:00] <qlex> this causes the albums in Pages to be populated with images taken from appropriate albyms in Files seection - however this seems to problematic for a regular user
220: [08:26:00] <qlex> cws-soft folder gallery seems good from features, but requires a user (who might not be an advanced user) to: create pagetype of gallery folder, then go to Files section and create albuyms, upload images, head back to Pages and re-create albums there too
221: [08:26:00] <qlex> in ss2.4 i had a stock gallery that had albums and images all managed from PAges section
222: [08:43:00] <qlex> anyone ?
223: [08:43:00] * guci0 has joined #silverstripe
224: [08:45:00] <wmk> need it also some day for upgrading some sites to ss3
225: [08:45:00] <wmk> qlex, i designed the db-layout like old unclecheese gallery some time ago, but didn't implement frontend work yet
226: [08:46:00] <qlex> link ?
227: [08:46:00] <wmk> have to leave now, iM
228: [08:46:00] <wmk> back in some hours...
229: [08:50:00] <simon_w|air> qlex, isn't that hard to make yourself. Page has_many GalleryImage has_one Image, stick the has_many in a GridField
230: [08:52:00] <qlex> simon_w|air: problem is we need to deploy to site that's to go live tomorrow
231: [09:03:00] <ec8or> gallery is super quick to implement
232: [09:04:00] * xyphoid quit (Ping timeout: 255 seconds)
233: [09:04:00] * lx-berlin_ has joined #silverstripe
234: [09:05:00] * zfmf quit (Remote host closed the connection)
235: [09:06:00] * zfmf has joined #silverstripe
236: [09:07:00] <g4b0> hi all
237: [09:07:00] * Jakx has joined #silverstripe
238: [09:07:00] <Jakx> yo
239: [09:07:00] * g4b0 has joined #silverstripe
240: [09:11:00] <simon_w|air> qlex, better get started then? :p
241: [09:19:00] <Zauberfisch> qlex I think lx-berlin_ made a gallery module
242: [09:20:00] <Zauberfisch> btw, lx-berlin_ spoke with the designer yesterday, he is satisfied. good job
243: [09:22:00] <lx-berlin_> we have been using cwsoft gallery for this website
244: [09:22:00] <lx-berlin_> no, i made no gallery module. we built the slider
245: [09:22:00] <lx-berlin_> cool
246: [09:24:00] * lx-berlin_ is now known as lx-berlin
247: [09:25:00] <qlex> suits us good, but too hard to let the user use it
248: [09:25:00] <qlex> we got started, however ISP is having big issues in poland now, and we cant open github :)
249: [09:25:00] <qlex> yep, been talking with lx-berlin_ about that gallery
250: [09:26:00] * Colin[pi] has joined #silverstripe
251: [09:28:00] * Jakx has left #silverstripe
252: [09:33:00] * mobiusnz quit (Quit: Leaving.)
253: [09:34:00] * xyphoid has joined #silverstripe
254: [09:36:00] * osterlaus quit (Quit: Leaving.)
255: [09:37:00] <Zauberfisch> lx-berlin I changed it
256: [09:37:00] <lx-berlin> ??hm Zauberfisch, could you give me the links to your compass settings in phpstorm again ?
257: [09:37:00] <lx-berlin> aha
258: [09:38:00] * Green__ is now known as Guest51428
259: [09:38:00] <lx-berlin> i just need to add a custom watcher
260: [09:38:00] <lx-berlin> it is preinstalled in PhpStorm 6
261: [09:38:00] <Zauberfisch> lx-berlin have you just installed the file watcher plugin?
262: [09:38:00] * Green__ has joined #silverstripe
263: [09:38:00] <Zauberfisch> lx-berlin hold on
264: [09:39:00] <Guest51428> Anyway, I need to have Children of Children in descending order, is there an easy way to achieve this?
265: [09:39:00] <Guest51428> Hello, I seem to have an issue that doesn't seem to have an easy workaround, I'll appreciate some help!
266: [09:39:00] * xyphoid quit (Ping timeout: 256 seconds)
267: [09:39:00] <Guest51428> ..hey, Nick took my nick..
268: [09:41:00] <Zauberfisch> in ss3.1 you can do <% loop $Children.Sort('Sort', 'DESC') %><% loop $Children.Sort('Sort', 'DESC') %>$Title<% end_loop %><% end_loop %>
269: [09:41:00] * gelignite has joined #silverstripe
270: [09:41:00] <Zauberfisch> Guest51428 depends on your silverstripe vversion
271: [09:41:00] <Guest51428> 3.0
272: [09:42:00] <MrGray> y*
273: [09:42:00] <Zauberfisch> in 3.0 I am not sure if that is already possible
274: [09:42:00] <Zauberfisch> but it should work in 3.1
275: [09:42:00] <Zauberfisch> but go ahead and try it
276: [09:42:00] <MrGray> Aye, give me a moment.
277: [09:42:00] <MrGray> It's a deploted site, I can't have them on a beta.
278: [09:42:00] <MrGray> Aw, I'm not 3.1 yet.
279: [09:42:00] * priithansen quit (Quit: priithansen)
280: [09:42:00] * Guest51428 is now known as MrGray
281: [09:44:00] <MrGray> "[User Error] Uncaught SSTemplateParseException: Parse error in template on line 12. Error was: Unknown open block "loop" encountered. Perhaps you missed the closing tag or have mis-spelled it?"
282: [09:44:00] <MrGray> Bummer.
283: [09:45:00] <MrGray> Considering the site's unlikely to be updated, could I possibly change the core Children function?
284: [09:45:00] <MrGray> Or create another one?
285: [09:46:00] <Shrike_Finland> hello guys. A question about <% loop %>, dataobjects and function. I want to be able to use function, what checks if dataobject is published or not in multilingual site. Dataobjects are created with has_one relation, so every language has own dataobjects. Loopin in template works fine, it manages to filter dataobjects only ment to be seen on selected language. But function gets all languages without checking right objects based on language. I'l
286: [09:46:00] <lewellyn> "I'l" was the end
287: [09:46:00] <simon_w|air> MrGray, try <% loop $Children.Reverse %>, though it sounds more like you typo-ed your template
288: [09:46:00] <lewellyn> Shrike_Finland: too long. it got truncated.
289: [09:46:00] <MrGray> I couldn't seem to track it down.
290: [09:46:00] <simon_w|air> Zauberfischm you and making things more complicated than needed :p
291: [09:47:00] <Shrike_Finland> Damn
292: [09:47:00] <Shrike_Finland> http://pastebin.com/WH7kcYnj
293: [09:47:00] <Shrike_Finland> But function gets all languages without checking right objects based on language. I'll paste the function shortly. Question is: how to filter out other dataobjects from other languages?
294: [09:47:00] <Shrike_Finland> Loopin in template works fine, it manages to filter dataobjects only ment to be seen on selected language.
295: [09:47:00] <Shrike_Finland> hello guys. A question about <% loop %>, dataobjects and function. I want to be able to use function, what checks if dataobject is published or not in multilingual site. Dataobjects are created with has_one relation, so every language has own dataobjects.
296: [09:47:00] <MrGray> I'll test both, moment.
297: [09:49:00] <MrGray> Awesome!
298: [09:49:00] <Shrike_Finland> Dataobjects are not using Translatable in any form, just plain new objects
299: [09:50:00] <MrGray> I found at least 15-20 threads with really complicated methods of trying to implement this.
300: [09:50:00] <Shrike_Finland> But site, of coz, is using Translatable module (SS3.1 beta3)
301: [09:50:00] <MrGray> Could someone please document this in the documentation?
302: [09:50:00] <MrGray> Zauber's method worked.
303: [09:50:00] <MrGray> I'd do it if I could.
304: [09:51:00] <MrGray> ..mostly because everyone was trying to call the controller of the Children from a parent page.
305: [09:52:00] <MrGray> Nonetheless, thank you for the very quick resolution! Cost me 4 hours. :\
306: [09:53:00] <MrGray> Ha, I know that feel.
307: [09:53:00] <Shrike_Finland> Right people on right channel. MrGray :)
308: [09:54:00] <Shrike_Finland> It would be awesome to have a good way of handling all those nice details and solutions, in modern way, for all ss-developers/designers.
309: [09:55:00] <MrGray> The documentation is amazingly formatted, it's a pity it doesn't get as many updates.
310: [09:55:00] <MrGray> Could someone write a tutorial for pushing updates to the documentation? I'd push changes if it was simple enough.
311: [09:55:00] <Shrike_Finland> Documentating would be the first step, and some way of extending it with real life examples
312: [09:58:00] <simon_w|air> http://doc.silverstripe.org/framework/en/trunk/misc/contributing/documentation
313: [09:58:00] <simon_w|air> MrGray, click the edit button at the bottom of the page, save changes, wait for it to be reviewed and merged
314: [10:00:00] <lx-berlin> Zauberfisch: i think i got compass compilation working in PhpStorm
315: [10:00:00] <MrGray> Aw, cool, I thought I needed git for all changes, noted.
316: [10:02:00] <Shrike_Finland> Any tips, how to filter dataobjects based on locale?
317: [10:03:00] <simon_w|air> Shrike_Finland, ->filter('locale', $locale)
318: [10:03:00] * xyphoid has joined #silverstripe
319: [10:05:00] <travis-ci> [travis-ci] silverstripe/sapphire#2067 (master - 5a2b765 : Ingo Schommer): The build was fixed.
320: [10:05:00] * travis-ci has left #silverstripe
321: [10:05:00] <travis-ci> [travis-ci] Build details : http://travis-ci.org/silverstripe/sapphire/builds/6594349
322: [10:05:00] <travis-ci> [travis-ci] Change view : https://github.com/silverstripe/sapphire/compare/f8ee3e1b7372...5a2b765025ad
323: [10:05:00] * travis-ci has joined #silverstripe
324: [10:06:00] * SightUnseen has joined #silverstripe
325: [10:06:00] <kinglozzer> How can I cache a DataObject::get() call in my controller, with a cache key of last updated?
326: [10:07:00] <Zauberfisch> was afk
327: [10:07:00] * SightUnseen has left #silverstripe
328: [10:07:00] <Zauberfisch> lx-berlin sorry
329: [10:08:00] <Zauberfisch> but that is to complicated, because you have to add a new custom watcher for every new project
330: [10:08:00] <Zauberfisch> lx-berlin I started using custom watchers
331: [10:08:00] <Zauberfisch> which is anoying
332: [10:09:00] <Zauberfisch> on windows thats scss.bat
333: [10:09:00] <lx-berlin> no problem. i got compass working in the IDE. It was just a little bit scarry. I added a single line to the scss file and the compilation has made lots of changes to the css file
334: [10:09:00] <lx-berlin> hmm, its not that big problem i think
335: [10:09:00] <Zauberfisch> lx-berlin the default scss file watcher calls a scss file
336: [10:10:00] <lx-berlin> i added a custom watcher. it just removed for example all "-o-box-shadow: 0 0 2px #ababab;"
337: [10:10:00] <Zauberfisch> I opened that file in a text editor and changed it to just a single line: "compass compile ../"
338: [10:10:00] <lx-berlin> i guess -o-box-shadow is no more needed ?!
339: [10:10:00] <Zauberfisch> without file extension
340: [10:10:00] <Zauberfisch> in linux thats probably /path/to/ruby/scss
341: [10:11:00] <lx-berlin> aha
342: [10:11:00] <lx-berlin> i see
343: [10:11:00] <Zauberfisch> and the scss.bat file then runs compass
344: [10:11:00] <Shrike_Finland> simon_w|air: as there is no actual locale on dataobject, it gives error (locale not found, or similar). Could sitetree help anything in this case?
345: [10:11:00] <Zauberfisch> so I can now just press add scss watcher, which calls the scss.bat file
346: [10:11:00] <MrGray> Pushed.
347: [10:11:00] <lx-berlin> anyway, this is ok for me. Happy that this works now
348: [10:12:00] <Zauberfisch> in any case I have a backup of the scss.bat file
349: [10:12:00] <Zauberfisch> I am pretty sure that will never happen
350: [10:12:00] <lx-berlin> but what if you want an sass inspector without compass ? :)
351: [10:13:00] <Zauberfisch> lx-berlin but I noticed there is 1 problem: the file watcher runs compass, but uploads right away (because I work on a dev VM) and that means the VM is always 1 saved version behind
352: [10:13:00] <Zauberfisch> but if you work on localhost, then you are fine
353: [10:13:00] <Zauberfisch> to ensure its uploaded
354: [10:13:00] <Zauberfisch> so if I want latest css to be on the VM, I have to save twice
355: [10:14:00] <lx-berlin> yes, ubuntu only now :)
356: [10:15:00] <Zauberfisch> ^^
357: [10:15:00] <lx-berlin> and i am very happy with it. (until i have to install an update and my ati driver doesnt work anymore and i have to reinstall the driver again :)
358: [10:15:00] * Bollig|DesignCty quit (Quit: Connection Reset by Mexicans with wirecutters)
359: [10:21:00] * cloph_away1 is now known as cloph
360: [10:24:00] * simon_w has joined #silverstripe
361: [10:25:00] * Motoservo quit (Read error: Connection reset by peer)
362: [10:25:00] <Shrike_Finland> I do not get it??? How does basic <% loop FeaturedItems %> differ from this http://pastebin.com/WH7kcYnj
363: [10:26:00] <simon_w> Shrike_Finland, it's a HasManyList instead of a DataList and has a foreignID filter?
364: [10:26:00] <Shrike_Finland> Loop has to check sitetree/locale somehow, what example function does not do...
365: [10:26:00] * Motoservo has joined #silverstripe
366: [10:26:00] <simon_w> So FeaturedItems is a has_one?
367: [10:26:00] <Shrike_Finland> has_one
368: [10:27:00] <Shrike_Finland> I'll paste the code: http://pastebin.com/EievaSmv
369: [10:28:00] <simon_w> So, like I said, FeaturedItems is a HasManyList, instead of a DataList, and has a foreignID filter
370: [10:31:00] <Shrike_Finland> So, should it be changed to has_one and it works directly? Or should the function be different?
371: [10:33:00] <simon_w> Should a FeaturedItemsPage only have one FeaturedItem?
372: [10:35:00] <Shrike_Finland> FeaturedItemsPage should have many FeaturedItems, but there are multiple pages using FeaturedItemsPage with different FeaturedItems, also in different locales.
373: [10:36:00] <simon_w> And is the locale derived from the page's?
374: [10:36:00] <Shrike_Finland> complicated
375: [10:36:00] <Shrike_Finland> yes
376: [10:37:00] <kinglozzer> Anyone know if it's possible to cache DataObject::get() calls in a controller with a cache key?
377: [10:37:00] <simon_w> So just use $this->FeaturedItems()
378: [10:38:00] <simon_w> kinglozzer, yes.
379: [10:38:00] <kinglozzer> simon_w: How might I do it?
380: [10:39:00] <simon_w> Though, with the lazy loading in the ORM, I don't see why you need to
381: [10:39:00] <simon_w> if(empty(self::$_cache[$key])) self::$_cache[$key] = $Class::get()->...;
382: [10:39:00] <simon_w> return self::$_cache[$key];
383: [10:39:00] <kinglozzer> Awesome, thanks
384: [10:40:00] <simon_w> Oh, if you're on 3.0, you want return clone self::$_cache...
385: [10:40:00] <kinglozzer> 3.1?
386: [10:41:00] <kinglozzer> Okay, cheers
387: [10:41:00] <simon_w> DataList is immutable in 3.1, so you won't run into weird side effects without the clone
388: [10:45:00] * simon_w|air quit (Quit: This computer has gone to sleep)
389: [10:52:00] * Nyger has joined #silverstripe
390: [10:52:00] * Nyger quit (Client Quit)
391: [11:06:00] * priithansen has joined #silverstripe
392: [11:14:00] * ARNHOE has joined #silverstripe
393: [11:26:00] * ARNHOE quit (Remote host closed the connection)
394: [11:58:00] * qlex has left #silverstripe
395: [12:02:00] * UndefinedOffset has joined #silverstripe
396: [12:05:00] * zfmf has left #silverstripe
397: [12:08:00] * MrGray quit (Quit: Page closed)
398: [12:08:00] * Marvanni has joined #silverstripe
399: [12:12:00] <Marvanni> Hm, I have some DO's that have pretty long titles..
400: [12:13:00] <Marvanni> This more or less mess up the CMS Breadcrumbs... A copied the CMSBreadcrumbs.ss template to my site, so I can limit the lenght, but SS is not picking up the template
401: [12:13:00] <Marvanni> any suggestions to cut off the BreadCrumbs Titles in the CMS?
402: [12:24:00] * osterlaus has joined #silverstripe
403: [12:24:00] <osterlaus> hi there!
404: [12:25:00] <osterlaus> just a really stupid question: i have a database field, type text, and want to output it on a website. currently, single line feeds are not displayed correctly :(
405: [12:26:00] <UndefinedOffset> and make sure its in the templates folder in your theme
406: [12:26:00] <UndefinedOffset> Marvanni: have you flushed the template cache? add "?flush=all" to the end of the url
407: [12:28:00] <Marvanni> yes... but no joy
408: [12:29:00] <UndefinedOffset> hey chillu any chance of debug_manifest comming back for 3.1?
409: [12:29:00] <UndefinedOffset> strange, still makes me wish that the debug_manifest still existed in 3.x
410: [12:32:00] <chillu> you mean 'showtemplate'?
411: [12:32:00] <chillu> debug_manifest was never there?
412: [12:36:00] <UndefinedOffset> ya that would help in Marvanni's case, but to see if the template finder even found it seeing the manifest would help looks like it was debugmanifest=1
413: [12:36:00] * SphereSilver has joined #silverstripe
414: [12:40:00] <Marvanni> its not loaded... but it is there...
415: [12:42:00] <Marvanni> What about add the method BreadcrumbsTitle() to DataObject so we can overload it?
416: [12:43:00] * priithansen quit (Read error: Operation timed out)
417: [12:43:00] <UndefinedOffset> or the cms?
418: [12:43:00] <UndefinedOffset> oh... crap Marvanni, i know the issue your having :P, are you trying to change the breadcrumbs template for the front end?
419: [12:43:00] * priithansen_ has joined #silverstripe
420: [12:44:00] <UndefinedOffset> try putting it in your mysite/templates, theme isn't loaded in the cms :)
421: [12:44:00] <Marvanni> just
422: [12:44:00] <Marvanni> frontend works jsut fine
423: [12:44:00] <Marvanni> cms
424: [12:45:00] <UndefinedOffset> chillu I could cobble something together for /dev if having a debugmanifest in 3.x makes sense?
425: [12:45:00] <Marvanni> no joy
426: [12:47:00] <UndefinedOffset> Marvanni hmm... it maybe something to do with the admin/cms being a sub module of framework. but I'm not sure, haven't tried to override that particuallar template I've played with overriding leftandmain
427: [12:47:00] <chillu> What would it contain?
428: [12:50:00] <UndefinedOffset> chillu Something like what 2.4 did, the mapping of paths to classes, templates, themes etc. Though I suppose now that I think about it maybe a very niche thing, probably why it was removed in 3.0
429: [12:51:00] <chillu> I think we need more robust and transparent cache/manifest *clearing* (incl stuff like partial caches), but not sure how much sense it makes to expose those internals, beyond just knowing which TMP folder is used
430: [12:52:00] * osterlaus quit (Quit: Leaving.)
431: [12:53:00] <UndefinedOffset> it is more of a core dev thing, or when your mucking with the manifest build process :P
432: [12:53:00] <UndefinedOffset> mm ya true
433: [13:06:00] <MrGray> Hello again.
434: [13:06:00] <MrGray> I seem to have run into another wall.
435: [13:06:00] * MrGray has joined #silverstripe
436: [13:07:00] <MrGray> The Children seem to be getting cached which results in the breakdown of three galaries.
437: [13:07:00] <MrGray> How do I use partial caching to completely disable caching for the said blocks?
438: [13:07:00] * sewid has joined #silverstripe
439: [13:08:00] <sewid> Hi there
440: [13:08:00] <sewid> I have a left sidebar where Menu(2) is displayed
441: [13:08:00] <sewid> Now I want a function for my Page class, to return the content area class
442: [13:08:00] <sewid> If Menu(2) is empty, "span9" should be returned
443: [13:08:00] <sewid> If Menu(2) contains pages, "span6" should be returned
444: [13:09:00] <sewid> Can somebody please help me how to realize that?
445: [13:09:00] <MrGray> Do you have a Page type for span9 and span6?
446: [13:10:00] <sewid> So that I can call <div class="$ContentWidth"> (or something like this)
447: [13:10:00] <sewid> No, I want to return only the string
448: [13:10:00] <MrGray> How about <% if Children %>?
449: [13:11:00] <MrGray> How so?
450: [13:11:00] <sewid> I also have a right sidebar and if this sidebar is also empty, it is "span12" :-)
451: [13:11:00] <sewid> So I want to extract that logic to my page class
452: [13:11:00] <MrGray> <% if Children %> span9 <% else %> span6 <% end_if %>
453: [13:11:00] <sewid> Yes, but it is a litte bit more comlicated
454: [13:11:00] <wmk> sewid, you can make a method in your controller which returns the classname
455: [13:11:00] <MrGray> Of course, invert that, think I got it the other way around.
456: [13:12:00] <MrGray> i.e. what does it contain?
457: [13:12:00] <sewid> It contains additional links (DataObjects)
458: [13:12:00] <sewid> It's an SQL statement
459: [13:12:00] <MrGray> How do you check the right sidebar?
460: [13:12:00] <sewid> I want a function ContentWidth() that should return "span6", "span9" or "span12"
461: [13:13:00] <sewid> I only want to know how to check, if Menu(2) is empty or not from my controller
462: [13:13:00] <MrGray> $children = $this->Children(); if (!$children) return "span9";
463: [13:13:00] <MrGray> Put that in the function.
464: [13:13:00] <MrGray> Use relative condition statements?
465: [13:14:00] <sewid> That would work if I only have 2 page levels
466: [13:14:00] <sewid> but if I have 4 page levels, that won't work
467: [13:14:00] <sewid> and $this->Menu() does not work :-(
468: [13:14:00] * obbo has joined #silverstripe
469: [13:15:00] <obbo> hello
470: [13:15:00] <MrGray> 4 levels, ouch.
471: [13:15:00] <wmk> sewid, afaik in Controller it should be $this->getMenu(2)
472: [13:16:00] <MrGray> Well, could you show me some code?
473: [13:16:00] <wmk> see ContentController
474: [13:17:00] <MrGray> Wmk, any idea how to implement partial caching?
475: [13:18:00] <wmk> all i know is in the docs ;)
476: [13:18:00] <MrGray> Sewid, why won't it worth with 4 levels?
477: [13:18:00] <MrGray> Ha, documentation's not very helpful here.
478: [13:18:00] <wmk> MrGray, i run partial caching on a 2.4 site
479: [13:18:00] <MrGray> Ok, let's see if you can help, here's hoping you can.
480: [13:18:00] * howardgrigg quit (Read error: Connection reset by peer)
481: [13:19:00] <MrGray> I have a Children inside of Children.
482: [13:19:00] * howardgrigg has joined #silverstripe
483: [13:19:00] * obbo quit (Ping timeout: 245 seconds)
484: [13:19:00] <MrGray> Now I need to call the inner children loop twice on a page load for the gallery's images and descriptions.
485: [13:19:00] <MrGray> The first loop works perfectly.
486: [13:20:00] <MrGray> The second call however displays the cached content from the first gallery.
487: [13:20:00] <wmk> MrGray, i also ran in problems, so i don't cache the whole page, but e.g. header...
488: [13:20:00] <MrGray> How do you disable caching for the whole page?
489: [13:20:00] <sewid> Just give me a second
490: [13:20:00] <wmk> <% uncached %>....
491: [13:20:00] <MrGray> I could work with that.
492: [13:20:00] <MrGray> ..that's not documented for 3.0?
493: [13:21:00] <MrGray> Drats.
494: [13:21:00] <MrGray> Let's try it now.
495: [13:21:00] <MrGray> <% uncached %>
496: [13:21:00] <MrGray> It's ONE line in a whole bunch of text.
497: [13:23:00] <sewid> Ok, got it working, $this->getMenu(2) is working if used correctly :-)
498: [13:23:00] <sewid> Is there a better way to check if the Menu(2) is empty than if (count($this->getMenu(2)) {
499: [13:23:00] <wmk> MrGray, it is documented, see http://doc.silverstripe.org/framework/en/reference/partial-caching
500: [13:29:00] <MrGray> Ah, I found it in the documentation, it was just a very short mention.
501: [13:29:00] <MrGray> Oddly, doesn't work.
502: [13:29:00] <MrGray> It seems to pull in the first set of children even if the entire page/section is uncached.
503: [13:31:00] * osterlaus has joined #silverstripe
504: [13:37:00] <wmk> MrGray, i wonder if you can call the same twice.
505: [13:38:00] <wmk> maybe you need a legacy method in controller that returns the same but has another name, e.g. getGalleryTitles()
506: [13:40:00] <MrGray> Can't do that, Children's controller functions aren't accessible in the parent class's page.
507: [13:52:00] * Shrike_Finland quit (Quit: Leaving.)
508: [14:09:00] * SphereSilver quit (Remote host closed the connection)
509: [14:10:00] * Colin[pi] quit (Ping timeout: 252 seconds)
510: [14:10:00] * Nivery has joined #silverstripe
511: [14:12:00] * houleness has joined #silverstripe
512: [14:13:00] * sewid quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz???)
513: [14:13:00] <houleness> I'm trying to basically do the same thing as this - http://www.silverstripe.org/data-model-questions/show/21517 Is there any way to get the parent relation ID before the object is written to db?
514: [14:13:00] * sewid has joined #silverstripe
515: [14:14:00] * MrGray quit (Ping timeout: 245 seconds)
516: [14:26:00] <osterlaus> houleness, have you seen the answer from zenmonkey?
517: [14:27:00] <osterlaus> what do you mean by "basically do the same thing"? the description of thi3r is already confusing me....
518: [14:33:00] <houleness> Yeah, just looking at the answer now
519: [14:36:00] <houleness> Yeah, I don't think that's what I need. I need to get an object in the getCMSFields function that's associated with a certain page, but the page ID only gets saved after it's written. So this doesn't work properly - $categories = ListCategory::get()->sort("Name ASC")->filter("ListPageID","$this->getComponent('ListPage")->ID; until the object is already written.
520: [14:43:00] * dangerdan has joined #silverstripe
521: [14:44:00] <dangerdan> rather than the SearchForm action on a per page basis
522: [14:44:00] <dangerdan> is there any way to make silverstripe search actually just go to its own page?
523: [14:52:00] * sewid quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz???)
524: [15:10:00] * houleness has left #silverstripe
525: [15:11:00] * lx-berlin has left #silverstripe
526: [15:15:00] * DigNZ quit (Quit: DigNZ)
527: [15:20:00] * dangerdan quit (Quit: Page closed)
528: [15:23:00] * elgrodo quit (Remote host closed the connection)
529: [15:27:00] * joelpittet has joined #silverstripe
530: [15:29:00] * sewid has joined #silverstripe
531: [15:37:00] <wmk> hmm, i can run a task in the browser but not in command line
532: [15:38:00] <wmk> The build task "GeoImportTask" could not be found
533: [15:39:00] <wmk> ah, had to do a dev/build in commandline first
534: [15:39:00] <wmk> did this change somewhere between 2.4 and 3.1?
535: [15:44:00] * catcher has joined #silverstripe
536: [15:46:00] * sewid quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz???)
537: [15:55:00] * g4b0 quit (Quit: Sto andando via)
538: [15:59:00] * kinglozzer quit (Remote host closed the connection)
539: [16:04:00] * chillu quit (Quit: chillu)
540: [16:06:00] <FrozenFire> wmk, Did what change?
541: [16:06:00] <FrozenFire> If so, no.
542: [16:06:00] <FrozenFire> Having to build the manifest to find new files?
543: [16:07:00] * webguest has joined #silverstripe
544: [16:08:00] <wmk> FrozenFire, i ran dev/build in the browser only
545: [16:09:00] <FrozenFire> wmk, Yes. The cli-script.php only simulates an HTTP request. The rest of the framework still works the exact same way.
546: [16:09:00] <FrozenFire> That would be a cache permissions issue
547: [16:09:00] <wmk> had to run dev/build in cli, too
548: [16:09:00] <wmk> the task worked in browser right before trying on cli
549: [16:09:00] <webguest> readonly Multi language question: http://paste2.org/kVvDUZ79 .. i have a dropdown where i select my gender.. e.g. Male. the user sees this value translated... it is saved in the database as Male. I want to use a readonly field, but it must translate this value, how do i do this?
550: [16:10:00] <wmk> hmm
551: [16:10:00] <FrozenFire> SS will store its cache files there
552: [16:10:00] <FrozenFire> I recommend creating a folder called silverstripe-cache in your webroot
553: [16:10:00] <wmk> aaah
554: [16:10:00] <FrozenFire> But your CLI user cannot read it
555: [16:10:00] <FrozenFire> Your webserver user can write its cache folder
556: [16:29:00] * osterlaus quit (Quit: Leaving.)
557: [16:46:00] * webguest quit (Ping timeout: 245 seconds)
558: [16:48:00] * waveydave has left #silverstripe
559: [17:00:00] * Colin[pi] has joined #silverstripe
560: [17:02:00] * Zauberfisch quit (Remote host closed the connection)
561: [17:04:00] * popeshoe quit (Quit: This computer has gone to sleep)
562: [17:07:00] * Nivery has left #silverstripe
563: [17:07:00] <FrozenFire> Translatable is bloody frustrating
564: [17:16:00] <priithansen_> Any way to make the gridfields link existing dropdown show < > signs instead of &gt; &lt;
565: [17:22:00] * Shrike_Finland has joined #silverstripe
566: [17:30:00] <priithansen_> and got it working
567: [17:37:00] * Zauberfisch has joined #silverstripe
568: [17:48:00] <FrozenFire> Not to self: Translatable::disable_locale_filter()
569: [17:48:00] <FrozenFire> Is the solution to more than half of my problems with this extension
570: [18:05:00] * Shrike_Finland quit (Quit: Leaving.)
571: [18:08:00] * guci0 quit (Ping timeout: 245 seconds)
572: [18:23:00] * sewid has joined #silverstripe
573: [18:35:00] * chillu has joined #silverstripe
574: [18:57:00] * sewid quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz???)
575: [19:02:00] * popeshoe has joined #silverstripe
576: [19:19:00] <FrozenFire> Blegh. I wish it were easier to hulk smash entire segments of the SiteTree straight from SQL
577: [19:19:00] <FrozenFire> Doing my development testing, I need to keep deleting whole translations (including all pages) so that I can automatically create them again
578: [19:22:00] <FrozenFire> You know, I've been told this at least a dozen times now, and I even remarked yesterday that I keep forgetting, and simon_w reiterated the process, but I can *never* remember how to create and publish new SiteTree items
579: [19:26:00] <FrozenFire> Aha, $page->publish("Live", "Stage");
580: [19:26:00] <FrozenFire> Which is odd
581: [19:26:00] <FrozenFire> But whatever
582: [19:39:00] * FrozenFire rages at Translatable
583: [19:39:00] <FrozenFire> Getting an arseload of issues due to my trying to redirect certain SiteConfig fields to the default translation, since they don't make sense being translated.
584: [19:39:00] <FrozenFire> So goddamn complicated.
585: [19:44:00] <catcher> FrozenFire, just put a link to learnenglish.com on all the pages. Problem solved in 1 line of code.
586: [19:52:00] * nimeso has joined #silverstripe
587: [19:52:00] <nimeso> morning all!
588: [19:53:00] <catcher> 'afternoon
589: [19:56:00] <nimeso> hey catcher! where are you bro? I've been up all night with a stupid GroupedBy issue... I'm so desperate I figured I would try and find help on irc
590: [19:58:00] <FrozenFire> catcher, :P Except that the first language they'll be translating to is French
591: [19:58:00] <catcher> nimeso, hey hey, do you have the Q up on the forum?
592: [19:58:00] <FrozenFire> Good luck getting the French to admit they know English
593: [19:59:00] <catcher> FrozenFire, $string = "le ".$string;
594: [19:59:00] * SightUnseen has joined #silverstripe
595: [20:00:00] <FrozenFire> preg_replace("/[\w ]+/", "Omelet du fromage", $this->Content);
596: [20:00:00] * SightUnseen has left #silverstripe
597: [20:00:00] <nimeso> http://sspaste.com/paste/show/517839bcd857d
598: [20:01:00] * wmk quit (Quit: nice to meet you ;))
599: [20:01:00] <FrozenFire> nimeso, https://github.com/MediaDevils/silverstripe-regionaldata If you want overkill
600: [20:01:00] <FrozenFire> :P
601: [20:02:00] <catcher> haha
602: [20:02:00] <FrozenFire> nimeso, Are you on 2.4?
603: [20:02:00] <nimeso> nope 3.1
604: [20:03:00] <nimeso> thanks for the link Frozen... but I'm rather keen to find out why this does not work... I need to use GroupedBy on a heap of jobs I have to upgrade
605: [20:03:00] <FrozenFire> nimeso, Why are you using DataObject::get()
606: [20:03:00] <FrozenFire> Much less concatenating strings for queries
607: [20:04:00] <FrozenFire> I can't fathom how you can be on 3.1 and be using DataObject::get()
608: [20:04:00] <nimeso> opps... didnt upgrade that bit yet... but should still work fine yer?
609: [20:04:00] <FrozenFire> If by fine you mean really poorly, and by really poorly you mean just barely.
610: [20:05:00] <nimeso> lol... ok, ok,,, bad nimeso... will change it now
611: [20:06:00] <nimeso> Frozen... yip done but still not working
612: [20:06:00] <catcher> nimeso, will you paste the new code, hopefully with filters?
613: [20:06:00] <nimeso> $items = AddressableItem::get("State = '".$this->State."' AND IsHeadOffice = 0","SortOrder ASC") Is this correct with 3.1 Frozen
614: [20:07:00] <FrozenFire> noooo
615: [20:07:00] <catcher> AddressableItem::get()->filter(array('State' => $this->State,
616: [20:07:00] <FrozenFire> AddressableItem::get()->filter(array("State" => $this->State, "IsHeadoffice" => false))
617: [20:07:00] <FrozenFire> NOOOOO
618: [20:08:00] <catcher> ->sort('SortOrder ASC');
619: [20:08:00] <catcher> ^
620: [20:08:00] <nimeso> ohhhhh... of course! duh
621: [20:08:00] <FrozenFire> If you're ever doing anything that involves SQL, *never* use string concatenation
622: [20:08:00] <FrozenFire> Ever.
623: [20:09:00] <simon_w> nope. ->sort('SortOrder', 'ASC')
624: [20:10:00] <nimeso> ok... even If I just have AddressableItem::get(); it still does not work
625: [20:10:00] <catcher> interesting.
626: [20:11:00] <nimeso> Yes
627: [20:11:00] <catcher> do they have a Title field?
628: [20:11:00] <nimeso> as soon as I use GroupedList::create(... it stops
629: [20:12:00] <FrozenFire> By the by, normally for a list getter, you don't put getFoo
630: [20:12:00] <FrozenFire> You just do Foo
631: [20:13:00] <FrozenFire> You're creating a GroupedList, then you're calling GroupBy
632: [20:13:00] <FrozenFire> Since when you want to add a parameter, you'll have to change it from Foo to getFoo(param)
633: [20:13:00] <FrozenFire> Also, you're double grouping
634: [20:14:00] <nimeso> :) ok cool Frozen... I'll just clean up my filters etc etc... give me 2 mins
635: [20:14:00] <nimeso> Frozen... not following... I followed the docs on groupby
636: [20:14:00] <FrozenFire> GroupedBy, even
637: [20:15:00] <FrozenFire> Line 20 in your paste
638: [20:15:00] <FrozenFire> Basically, here's the entirety of your logic
639: [20:15:00] <FrozenFire> Get a list of AddressableItem
640: [20:15:00] <FrozenFire> Line 4 in your paste
641: [20:15:00] <FrozenFire> Also, you're seemingly looping in very weird ways
642: [20:16:00] <FrozenFire> Transform the grouped list
643: [20:16:00] <FrozenFire> Loop that
644: [20:16:00] <FrozenFire> Put it in a grouped list
645: [20:16:00] <FrozenFire> Get a list of AddressableItem from each AddressableItem
646: [20:17:00] <nimeso> yes.... I have lots of addresses with a 'State' eg: new south wales etc... I have to get the names of the State but only once... then find the addresses for each State
647: [20:18:00] <nimeso> eg:
648: [20:18:00] <nimeso> NSW
649: [20:18:00] <FrozenFire> That's really not what you're doing
650: [20:18:00] <nimeso> ok :/
651: [20:18:00] <nimeso> how should I do this?
652: [20:18:00] <FrozenFire> Sensibly
653: [20:18:00] <nimeso> LOL
654: [20:18:00] <FrozenFire> Get a list of states.
655: [20:19:00] <FrozenFire> In your getStatesByCountry you seem to be getting all AddressableItem from a country
656: [20:19:00] <nimeso> why?
657: [20:19:00] <FrozenFire> Which seems odd
658: [20:20:00] <nimeso> 1. get addresses in country 2. group them by state
659: [20:20:00] <FrozenFire> A GroupedList is not a GROUP BY statement
660: [20:20:00] <FrozenFire> What does AddressableItem have to do with states?
661: [20:20:00] <nimeso> AddressableItem has a State attribute
662: [20:21:00] <nimeso> it used to be if( $states = DataObject::get('AddressableItem',"Country = '".$country."' AND IsHeadOffice = 0","SortOrder ASC")->groupedBy('State') ){
663: [20:21:00] <nimeso> worked fine
664: [20:21:00] <nimeso> yes... my 2.4 code used Group by
665: [20:21:00] <FrozenFire> A GroupedList is a helper which loops through each record and sorts them off into groups based on that field
666: [20:21:00] <nimeso> but that did not work in 3.1
667: [20:22:00] <UndefinedOffset> nimeso DataObject::get() was depricated in 3.0 likely in 3.1 you need to replace the code with the new format.
668: [20:22:00] <nimeso> How else would you do it? thanks for your time BTW Frozen :)
669: [20:22:00] <FrozenFire> UndefinedOffset, We've been over it. :P
670: [20:22:00] <FrozenFire> That's a very weird way of doing it.
671: [20:22:00] <FrozenFire> You're creating a DataObjectSet of DataObjectSets
672: [20:22:00] <FrozenFire> Each sub-set contains all of the items that are in each state
673: [20:23:00] <UndefinedOffset> lol
674: [20:23:00] <FrozenFire> nimeso, Well, this really seems like an X => Y question.
675: [20:23:00] <FrozenFire> What is your goal?
676: [20:23:00] <UndefinedOffset> FrozenFire :) ya i just saw the tail end :P
677: [20:23:00] <FrozenFire> Like, actual goal
678: [20:23:00] <nimeso> 2 ticks frozen... best if I paste
679: [20:23:00] <FrozenFire> You want to group the items by state?
680: [20:24:00] * UndefinedOffset quit (Quit: Leaving.)
681: [20:25:00] <nimeso> YES! http://sspaste.com/paste/show/51783fb720238
682: [20:26:00] * eikonos quit (Read error: Connection reset by peer)
683: [20:27:00] * eikonos has joined #silverstripe
684: [20:27:00] * eikonos quit (Changing host)
685: [20:27:00] * eikonos has joined #silverstripe
686: [20:27:00] <FrozenFire> Yes. So, do return GroupedList::create(AddressableItem::get()->filter(whatevs));
687: [20:28:00] <FrozenFire> return GroupedList::create(AddressableItem::get()->filter(whatevs))->GroupedBy("State");
688: [20:28:00] <FrozenFire> Then in your template you can do <% loop ItemsByState %> $State: <% loop Children %> $Title <% end_loop %> <% end_loop %>
689: [20:28:00] <FrozenFire> Err, you'll want ->GroupedBy("State") on the new GroupedList
690: [20:29:00] * simon_w|air has joined #silverstripe
691: [20:31:00] <nimeso> ok! Awesome! will try that out frozen
692: [20:33:00] <FrozenFire> Yes. You don't need the GroupedBy in your template.
693: [20:33:00] <nimeso> Hey Frozen.... If i have filter(whatevs))->GroupedBy("State") .... why would I still need <% loop StatesByCountry.GroupedBy(State) %> or can I get rid of the template GroupedBy bit?
694: [20:34:00] <FrozenFire> And then <% loop ItemsByState %>
695: [20:34:00] <FrozenFire> Just do public function ItemsByState() { ... }
696: [20:34:00] * oskarholo_ is now known as oskarholo
697: [20:34:00] * oskarholo_ has joined #silverstripe
698: [20:34:00] * oskarholo quit (Ping timeout: 252 seconds)
699: [20:35:00] <FrozenFire> You have have a $country parameter if you need, and then you can <% loop ItemsByState("US") %>
700: [20:35:00] * terryapodaca has joined #silverstripe
701: [20:35:00] <nimeso> yip, yip... cheers man... give me 5 mins to clean up code.
702: [20:36:00] <nimeso> Cool
703: [20:40:00] <nimeso> Frozen! wooo hooo! I had one to many functions really
704: [20:40:00] * oskarholo_ has joined #silverstripe
705: [20:41:00] * oskarholo quit (Ping timeout: 255 seconds)
706: [20:41:00] * oskarholo_ is now known as oskarholo
707: [20:41:00] <nimeso> I owe you a beer... send me your address to nimeso@gmail.com if ya waant... will flick you something nice bro!
708: [20:42:00] <FrozenFire> Hehe. Happy to help.
709: [20:49:00] <FrozenFire> http://www.sspaste.com/paste/show/5178456f76706
710: [20:49:00] * FrozenFire tugs his hair out over this infinite loop
711: [20:50:00] <FrozenFire> But only when I try to create a new translation
712: [20:50:00] <FrozenFire> For some reason it keeps recursing
713: [21:00:00] <FrozenFire> Hrmm, seems to have been a result of the page creation process I was doing
714: [21:00:00] <FrozenFire> Whatevs.
715: [21:12:00] * zfmf has joined #silverstripe
716: [21:14:00] * zfmf has joined #silverstripe
717: [21:14:00] * zfmf quit (Remote host closed the connection)
718: [21:17:00] <FrozenFire> Getting the current URL. Howto?
719: [21:17:00] <FrozenFire> In a template, that is
720: [21:19:00] <simon_w> $CurrentPage.Link's the closest
721: [21:20:00] * sewid has joined #silverstripe
722: [21:20:00] <FrozenFire> Not really close enough
723: [21:20:00] <FrozenFire> I have a global set of links I need to have point to the current URL, with a URL param
724: [21:21:00] <simon_w> Add a TemplateGlobalProvider that returns $_SERVER['whatever it is']?
725: [21:22:00] <FrozenFire> Blegh. Decided to just overload Link in the render. :P
726: [21:22:00] <FrozenFire> By the by... there was something screwy when I tried switching to using customise instead of rendering with overlaid params
727: [21:23:00] * sewid quit (Client Quit)
728: [21:23:00] * Zauberfisch quit (Read error: Connection reset by peer)
729: [21:23:00] <FrozenFire> Oh wait, nevermind.
730: [21:23:00] <FrozenFire> That was my silliness
731: [21:26:00] <travis-ci> [travis-ci] silverstripe/sapphire#2071 (3.1 - 1b4d7fa : Ingo Schommer): The build passed.
732: [21:26:00] <travis-ci> [travis-ci] Build details : http://travis-ci.org/silverstripe/sapphire/builds/6612549
733: [21:26:00] * travis-ci has left #silverstripe
734: [21:26:00] * travis-ci has joined #silverstripe
735: [21:26:00] <travis-ci> [travis-ci] Change view : https://github.com/silverstripe/sapphire/compare/59dbdcfc55c0...1b4d7fae2417
736: [21:42:00] * priithansen_ quit (Quit: priithansen_)
737: [21:45:00] * Motoservo quit (Quit: Shhh. I'm trying to get some sleep here.)
738: [22:08:00] * spronk quit (Ping timeout: 246 seconds)
739: [22:30:00] * chillu23 quit (Changing host)
740: [22:30:00] * chillu23 has joined #silverstripe
741: [22:30:00] * chillu23 has joined #silverstripe
742: [22:31:00] * chillu quit (Read error: Connection reset by peer)
743: [22:31:00] * chillu23 is now known as chillu
744: [22:37:00] * cloph quit (Ping timeout: 252 seconds)
745: [22:39:00] * cloph_away has joined #silverstripe
746: [22:40:00] * SightUnseen has joined #silverstripe
747: [22:40:00] * SightUnseen quit (Client Quit)
748: [22:52:00] * chillu quit (Quit: chillu)
749: [22:54:00] * simon_w|air quit (Quit: This computer has gone to sleep)
750: [23:09:00] * willr_ has joined #silverstripe
751: [23:09:00] * willr_ has joined #silverstripe
752: [23:09:00] * willr_ quit (Changing host)
753: [23:14:00] * nimeso quit (Quit: Page closed)
754: [23:18:00] * zfmf has left #silverstripe
755: [23:19:00] <catcher> Need to add 1 minute to a DateTime ("Y-m-d H:i:s"). Anything slicker than converting to strtotime, adding, and converting back?
756: [23:21:00] <terryapodaca> is a has_many relation being returned as a list?
757: [23:23:00] <simon_w> terryapodaca, yes
758: [23:23:00] <terryapodaca> catcher: isn't there date_add() or similar function?
759: [23:23:00] <terryapodaca> or am i thinking of SQL
760: [23:25:00] <terryapodaca> $time->add(new DateInterval());
761: [23:25:00] <terryapodaca> $time = new DateTime();
762: [23:25:00] <terryapodaca> simon_w: so I can us the new PaginatedList() like so:
763: [23:26:00] <travis-ci> [travis-ci] Change view : https://github.com/silverstripe/sapphire/compare/1b4d7fae2417...a6b0807b9fdb
764: [23:26:00] * travis-ci has left #silverstripe
765: [23:26:00] <travis-ci> [travis-ci] Build details : http://travis-ci.org/silverstripe/sapphire/builds/6615315
766: [23:26:00] <simon_w> catcher, assuming you've got a string, nope
767: [23:26:00] <simon_w> Well, you should be passing in the request object too
768: [23:26:00] <terryapodaca> public function getImages() {
769: [23:26:00] <terryapodaca> return new PaginatedList($this->GalleryImages()->sort('SortOrder'));
770: [23:26:00] <terryapodaca> }
771: [23:26:00] * travis-ci has joined #silverstripe
772: [23:26:00] <travis-ci> [travis-ci] silverstripe/sapphire#2072 (3.1 - a6b0807 : Will Rossiter): The build passed.
773: [23:28:00] <simon_w> terryapodaca, yup
774: [23:28:00] <terryapodaca> return new PaginatedList($this->GalleryImages()->sort('SortOrder'), $this->request);
775: [23:28:00] <terryapodaca> like that simon_w?
776: [23:31:00] <terryapodaca> the Allow Drag and Drop
777: [23:31:00] <simon_w> You've added two sortable components to it
778: [23:31:00] <terryapodaca> has anyone seen this on the new gridfield? http://tinypic.com/r/wwnn9y/4
779: [23:33:00] <terryapodaca> ahhh dayum!
780: [23:33:00] <terryapodaca> thanks
781: [23:45:00] <catcher> are there Less/GreatThanEqualTo filters?
782: [23:47:00] <simon_w> Well, in 3.1 you can exclude the opposite, which has the same effect
783: [23:51:00] * catcher quit (Quit: Leaving)

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