#silverstripe IRC Log

IRC log for 6 June 2016

All timestamps are in UTC.

1: [00:00:02] * ss-helper quit (Remote host closed the connection)
2: [00:00:18] * ss-helper has joined #silverstripe
3: [00:55:53] * Admonish quit (Quit: Going offline, see ya! (www.adiirc.com))
4: [00:58:45] * kerozene has joined #silverstripe
5: [00:59:00] * Admonish has joined #silverstripe
6: [01:15:05] <ss-helper> Supported versions and SS 3.0 end-of-life - https://groups.google.com/d/msg/silverstripe-dev/I5-AMUUZZSc/AB4RXjYhAQAJ
7: [01:43:27] * slievr quit (Ping timeout: 276 seconds)
8: [03:08:20] * phorloop quit (Quit: Byeee...)
9: [03:22:21] * Stomach quit (Quit: zzz)
10: [03:42:11] * Admonish quit (Quit: Going offline, see ya! (www.adiirc.com))
11: [03:50:08] * Kolin_ is now known as Kolin
12: [03:52:35] * Admonish has joined #silverstripe
13: [04:11:40] * Stomach has joined #silverstripe
14: [04:20:07] * Stomach quit (Quit: zzz)
15: [04:25:51] * g-n0m3 quit (Remote host closed the connection)
16: [04:30:45] * Stomach has joined #silverstripe
17: [04:55:26] * TombL has joined #silverstripe
18: [05:03:33] * BackEndCoder quit (Ping timeout: 250 seconds)
19: [05:07:25] * BackEndCoder has joined #silverstripe
20: [05:14:45] * Stomach quit (Quit: zzz)
21: [05:15:24] * g-n0m3 has joined #silverstripe
22: [05:28:19] * Stomach has joined #silverstripe
23: [05:48:25] * Admonish quit (Quit: Going offline, see ya! (www.adiirc.com))
24: [05:54:24] * Agilix_ has joined #silverstripe
25: [06:04:05] * Mike123 has joined #silverstripe
26: [06:04:39] * Agilix_ quit (Ping timeout: 264 seconds)
27: [06:08:48] * Stomach quit (Quit: zzz)
28: [06:11:32] * flowsn has joined #silverstripe
29: [06:15:05] <flowsn> Hey Guys, i have a page. The URL of the Page is for example "/beertypes", can i somehow achieve that the index function will load another template on "/beertypes/some-beer". I know i can do it by creating a new action like "show" or something, but i dont want that. I want the Url "/beertypes" to show all beertypes and the url "/beertypes/{BeerSlug}" to show a specific beer
30: [06:15:05] <flowsn> (data object)
31: [06:17:04] <Mike123> flowsn hi, you need to add url_handler to your page controller
32: [06:19:00] * Stomach has joined #silverstripe
33: [06:20:59] <flowsn> Hey Mike123, yes that would work. But then i cannot use my other Actions anymore because they get parsed as variables
34: [06:22:11] <Mike123> please paste the code of your controller
35: [06:22:21] <flowsn> Got the Solution, but will post anyway.
36: [06:22:37] <flowsn> Any good paste service?
37: [06:25:14] <flowsn> http://www.sspaste.com/paste/show/575517410359b
38: [06:25:24] <flowsn> This will never ever call the info action again
39: [06:25:36] <flowsn> because info will get parsed as "Slug" and sent to the index function
40: [06:27:18] <flowsn> But if i change the order of the routes in the url_handler so that it will find the /info/ID first, it works fine
41: [06:27:21] <flowsn> Thanks Mike123
42: [06:27:54] <Mike123> first of all, why dont you use other function, not inidex ?
43: [06:27:57] <Mike123> index*
44: [06:28:18] <Mike123> and put the $Slug handler at the bottom i guess
45: [06:28:26] <flowsn> let me try
46: [06:28:33] <Mike123> dont forget to flush
47: [06:31:51] * Eliseth has joined #silverstripe
48: [06:32:17] <flowsn> ERR_TOO_MANY_REDIRECTS
49: [06:32:23] <flowsn> strange..
50: [06:33:00] <Mike123> try to Debug your function
51: [06:33:41] <flowsn> http://www.sspaste.com/paste/show/575519412bbc0
52: [06:36:00] <flowsn> Ok got it
53: [06:36:16] <flowsn> We have to add " '' => 'index', " to the url_handler
54: [06:36:49] <flowsn> http://www.sspaste.com/paste/show/575519f81a3bc This works.
55: [06:36:51] * g-n0m3 quit (Remote host closed the connection)
56: [06:37:10] <Mike123> can u paste the whole page ?
57: [06:37:17] <Mike123> it should work withount it
58: [06:38:20] <flowsn> http://www.sspaste.com/paste/show/57551a5792a66
59: [06:39:48] <flowsn> If i delete it, it routes xxxx.com/beertypes/ to the beertype action
60: [06:40:06] <Mike123> try this http://www.sspaste.com/paste/show/57551ab948c3b
61: [06:40:44] <flowsn> Works fine
62: [06:40:55] <Mike123> :) good
63: [06:41:01] * Stomach quit (Quit: zzz)
64: [06:41:13] <flowsn> Any Documentation on this trick? :D
65: [06:42:19] <flowsn> Found the docs for this
66: [06:42:21] <Mike123> well you need to add ! to the end of your $Slug and and $ID
67: [06:42:22] <flowsn> great
68: [06:42:49] <flowsn> so i also do not need to check wether slug really exists
69: [06:44:41] <flowsn> Thank you Mike123
70: [06:45:10] <Mike123> you're welcome flowsn !
71: [06:49:06] * arnhoe has joined #silverstripe
72: [06:54:16] * Stomach has joined #silverstripe
73: [07:24:44] * darianno has joined #silverstripe
74: [07:55:07] * Teddy_ has joined #silverstripe
75: [07:57:47] * Agilix_ has joined #silverstripe
76: [07:58:45] <Agilix_> Mornin o?
77: [07:58:48] <Agilix_> o/
78: [07:59:57] * g-n0m3 has joined #silverstripe
79: [08:02:15] * WebDevB has joined #silverstripe
80: [08:02:48] * kinglozzer has joined #silverstripe
81: [08:03:40] <WebDevB> Hey everyone, i'm using the silverstripe pagination and I was wondering if there is a way I can limit the number of 'page' links that it shows at the bottom? I would like it to show 10 until they get to the 10th page... if that makes sense.
82: [08:05:27] <kinglozzer> WebDevB: <% loop $PaginatedList.Pages(10) %>
83: [08:05:50] <WebDevB> kinglozzer thanks for that... what will it do when it gets to the 10th page.
84: [08:06:28] <kinglozzer> WebDevB: I think when you hit around page 6, it will show pages 2 - 11 instead if that makes sense
85: [08:12:43] * slievr has joined #silverstripe
86: [08:15:20] <WebDevB> Thanks mate!!! kinglozzer
87: [08:18:00] * Teddy_ quit (Read error: Connection reset by peer)
88: [08:19:22] <WebDevB> kinglozzer, sorry last question.
89: [08:20:43] <WebDevB> I have a model with a has_many for images... What's the best way of getting 1 of the images back?
90: [08:20:58] <WebDevB> I've tried $Vehicle->VehicleImage
91: [08:21:44] <kinglozzer> WebDevB: $vehicle->VehicleImages()->first() ?
92: [08:23:24] <WebDevB> kinglozzer, just get server error. :-(
93: [08:23:59] <kinglozzer> WebDevB: What's the has_many relation called?
94: [08:25:08] <WebDevB> kinglozzer, my bad... got it the wrong way round: 'Images' => 'VehicleImage',
95: [08:25:27] <kinglozzer> Ah yeah, $vehicle->Images()->first() should do it then :)
96: [08:26:12] <WebDevB> Running this:
97: [08:26:16] <WebDevB> $vehicleImage = $vehicle->Images()->first();
98: [08:26:16] <WebDevB> echo $vehicleImage;
99: [08:26:27] <WebDevB> I just get VehicleImage...
100: [08:28:29] <WebDevB> kinglozzer, is there anything else that I need to do?
101: [08:29:08] <kinglozzer> WebDevB: Well you've got the image object
102: [08:29:13] <kinglozzer> Depends what you want to do with it
103: [08:29:24] * agent44 has joined #silverstripe
104: [08:29:40] <kinglozzer> Usually you'd just return that, then you can use CroppedImage etc in the template
105: [08:29:58] <WebDevB> Yea I want to get the $Image.URL
106: [08:30:14] <WebDevB> I suppose I could just do $vehicleImage.URL?
107: [08:32:27] <WebDevB> kinglozzer: I have this in the view $Images.URL but that doesn't seem to be working here, sorry totally new to silverstripe as you've probably guessed.
108: [08:32:54] <WebDevB> $vehicleImage->URL doesn't give me anything neither.
109: [08:34:48] * dudinka has joined #silverstripe
110: [08:35:02] <dudinka> hey guys
111: [08:35:14] <dudinka> is it possible to update i18n cache during runtime?
112: [08:37:06] <dudinka> ie to override translations from YAML file in PHP?
113: [08:39:01] <WebDevB> kinglozzer, ok so I can see that within VehicleImages I have an ImageID and that matches up to an ID within the table 'File'.
114: [08:39:25] * swaiba has joined #silverstripe
115: [08:39:44] <WebDevB> The only issue is I don't have a Model called File? Is this built in with SilverStripe?
116: [08:39:53] <kinglozzer> WebDevB: Yep
117: [08:40:00] <kinglozzer> You probably want $Image.AbsoluteURL
118: [08:40:11] <WebDevB> Will it do that automatically?
119: [08:40:19] <kinglozzer> Yeah
120: [08:40:24] <WebDevB> So $vehicleImage.AbsoluteURL
121: [08:40:33] <WebDevB> Can I do that within a model?
122: [08:40:44] <kinglozzer> WebDevB: In a template
123: [08:40:48] <WebDevB> Ok great.
124: [08:41:19] <kinglozzer> Tbh, if you're in a template you may as well just do {$Images.First.URL}, no need to create a function for it
125: [08:42:03] <dudinka> anyone?
126: [08:45:15] <WebDevB> kinglozzer, sorry buddy but it doesn't seem to be working... here is the model: https://codeshare.io/AChNp
127: [08:47:08] <WebDevB> And then in the template i'm doing $Image.First.URL
128: [08:47:40] <WebDevB> kinglozzer line 67 is where I get the image object
129: [08:47:56] <WebDevB> and then I pass that to the function: _addResult
130: [08:49:31] <kinglozzer> WebDevB: $Image.URL should work I think... but only for that first category
131: [08:49:55] <WebDevB> Yea that's fine but it just doesn't print anything out.
132: [08:50:03] <WebDevB> $Image.First.URL
133: [08:53:07] <WebDevB> Rarrrr it's doing my head in.
134: [08:54:11] * Stomach quit (Quit: zzz)
135: [08:55:28] * Stomach has joined #silverstripe
136: [08:56:29] <WebDevB> kinglozzer any other ideas mate?
137: [08:57:54] <kinglozzer> WebDevB: First thing I'd do is var_dump($vehicle->Images()->first()->getURL()); die; in your controller and check that it's finding it
138: [08:58:09] <kinglozzer> If it is finding it correctly, you just need to work out how to get it into your template :P
139: [08:58:37] <WebDevB> kinglozzer ok so i'm just getting a blank screen.
140: [08:58:38] <WebDevB> haha
141: [09:17:09] <Agilix_> Can I use a variable in a translation string? I have different options and on the next page it should show the translation of the option: <% _t('SchoolContactType.{$SchoolRegistration.SchoolContactType}') %>
142: [09:21:46] <Agilix_> I found this one but not a big fan of the solution: https://www.silverstripe.org/community/forums/general-questions/show/24147
143: [09:26:20] <kinglozzer> Agilix_: <%t Some.Entity 'Default string with a {variable} in it' variable="foo" %>
144: [09:26:35] <kinglozzer> Dunno if that will work with {$Something}, never tried it
145: [09:29:01] <dudinka> is it possible to override translations from YAML file in PHP?
146: [09:31:55] <kinglozzer> dudinka: Not easily, no
147: [09:32:09] <kinglozzer> Why do you need to?
148: [09:32:26] <kinglozzer> I think the only way you could do it would be to register your own translator with i18n...
149: [09:34:01] <dudinka> kinglozzer: I have a client who wants to be in charge of translation
150: [09:34:12] <dudinka> and giving FTP access is not an option
151: [09:34:39] <kinglozzer> dudinka: Try this: https://github.com/CPHCloud/silverstripe-dynamictranslations
152: [09:34:44] <kinglozzer> Can be managed in the CMS
153: [09:36:21] <dudinka> that's something like I wanted to build
154: [09:36:40] <dudinka> only issue is that I don't like the fact that I should edit all the templates and classes to make it work
155: [09:38:07] <kinglozzer> dudinka: Well you could build something similar, and register your own translator with i18n::register_translator() instead
156: [09:38:27] <kinglozzer> The reason we did it like that was because we didn't want the client to also see all the CMS translations
157: [09:39:41] <dudinka> oh, no, I'll limit him to only Page namespace for backend translations
158: [09:40:57] <kinglozzer> dudinka: Well there's Zend_Translate_Adapter_Array which should let you load translation data as an array
159: [09:41:46] <kinglozzer> So you should be able to register that with i18n and add all your translations as a regular PHP array
160: [09:43:52] <Agilix_> kinglozzer: but that is putting the variable in the translation value, I need it in the key :p
161: [09:44:57] <kinglozzer> Agilix_: Oh right :P yeah dunno about that then
162: [09:47:36] <Agilix_> hehe np kinglozzer I might go with the solution from the url
163: [09:52:13] * Stomach quit (Quit: zzz)
164: [11:50:02] * slievr quit (Ping timeout: 260 seconds)
165: [11:59:04] * kinglozzer quit (Remote host closed the connection)
166: [11:59:30] * kinglozzer has joined #silverstripe
167: [12:20:01] * slievr has joined #silverstripe
168: [12:43:31] * flowsn quit (Quit: (null))
169: [12:47:09] * kinglozzer quit (Remote host closed the connection)
170: [12:47:15] * kinglozzer has joined #silverstripe
171: [12:58:10] * mbogaert has joined #silverstripe
172: [12:58:10] <ss-helper> mbogaert: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
173: [13:18:51] * swaiba quit (Remote host closed the connection)
174: [13:21:19] * dudinka quit (Quit: Page closed)
175: [13:50:02] * Eliseth quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
176: [14:07:53] * kinglozzer quit (Remote host closed the connection)
177: [14:08:20] * kinglozzer has joined #silverstripe
178: [14:17:31] * muskie9 has joined #silverstripe
179: [15:04:17] * shellbac1pacific quit (Ping timeout: 260 seconds)
180: [15:04:54] * kinglozzer quit (Remote host closed the connection)
181: [15:05:00] * kinglozzer has joined #silverstripe
182: [15:06:08] * shellbackpacific has joined #silverstripe
183: [15:21:16] * Mike123 quit (Ping timeout: 250 seconds)
184: [15:21:25] * arnhoe quit ()
185: [15:29:56] * mbogaert quit (Ping timeout: 250 seconds)
186: [15:46:52] * shellbackpacific quit (Ping timeout: 260 seconds)
187: [15:54:39] * shellbackpacific has joined #silverstripe
188: [15:59:04] <WebDevB> Anyone around... kinglozzer?
189: [15:59:37] <WebDevB> I've just had to move the silverstripe installation onto another server and I'm getting an error when trying to access the pages saying 'Bad Gateway'
190: [15:59:49] <WebDevB> In the logs I can see PHP Warning: is_readable(): open_basedir restriction in effect.
191: [16:06:46] * Agilix_ quit (Ping timeout: 250 seconds)
192: [16:10:57] * XorPush has joined #silverstripe
193: [16:15:52] <kinglozzer> WebDevB: Sorry, busy this afternoon and about to head home
194: [16:15:59] <kinglozzer> Check the forums, I'm sure that has come up many times before
195: [16:20:20] <cloph> a mere warning is unlikely to cause bad gateway error (it may be reason for later fatal error) so double-check webserver's setup/look in other logs re fcgi/whatever you use to run php..
196: [16:21:26] * kinglozzer quit ()
197: [16:24:43] * XorPush quit (Quit: Page closed)
198: [16:28:59] * WebDevB quit ()
199: [17:02:19] * agent44 quit (Quit: zzz)
200: [17:17:05] * darianno quit (Quit: Computer has gone to sleep.)
201: [18:36:47] * Agilix_ has joined #silverstripe
202: [18:50:16] * Agilix_ quit (Ping timeout: 264 seconds)
203: [19:05:33] * ajmitch quit (Ping timeout: 240 seconds)
204: [19:06:38] * ajmitch has joined #silverstripe
205: [19:10:08] * Stomach has joined #silverstripe
206: [19:10:47] * gelignite has joined #silverstripe
207: [19:23:57] * Stomach quit (Quit: zzz)
208: [19:30:39] * UndefinedOffset has joined #silverstripe
209: [19:49:52] * Stomach has joined #silverstripe
210: [20:01:06] * krofek has joined #silverstripe
211: [20:02:13] * Stomach quit (Quit: zzz)
212: [20:03:02] * Stomach has joined #silverstripe
213: [20:13:36] * Stomach quit (Quit: zzz)
214: [20:43:39] * Stomach has joined #silverstripe
215: [20:48:33] * zippy has joined #silverstripe
216: [20:49:58] <zippy> hi
217: [20:50:50] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
218: [20:52:24] * adrexia has joined #silverstripe
219: [21:11:08] * UndefinedOffset quit (Quit: Leaving.)
220: [21:16:40] * UndefinedOffset has joined #silverstripe
221: [21:19:23] * UndefinedOffset quit (Client Quit)
222: [21:39:36] * robbiea has joined #silverstripe
223: [21:41:25] * Azure quit (Ping timeout: 260 seconds)
224: [21:46:21] * Azure has joined #silverstripe
225: [21:47:22] * Stomach quit (Quit: zzz)
226: [21:48:54] * micmania1 has joined #silverstripe
227: [21:49:12] * Stomach has joined #silverstripe
228: [21:52:39] * zippy quit (Quit: Textual IRC Client: www.textualapp.com)
229: [22:00:37] * robjingram has joined #silverstripe
230: [22:00:37] <ss-helper> robjingram: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
231: [22:03:47] <robjingram> Hi. I'm having a problem because I changed the parent class for a number of my Page classes. The original parent class was a direct descendant of Page but I changed them to be descendants, ultimately, of BlogPage.
232: [22:04:28] <robjingram> Now my tests are failing with errors saying that some tables don't exist.
233: [22:05:39] <robjingram> The tables it is looking for relate to the classes that has the change of parent. Is there a way that I can fix up the hierarchy? I assume there is now a problem with the representation in the database.
234: [22:09:18] * muskie9 quit (Quit: Textual IRC Client: www.textualapp.com)
235: [22:22:11] * robbiea quit (Remote host closed the connection)
236: [22:24:36] * robbiea has joined #silverstripe
237: [22:32:17] <Stomach> robjingram - what version of SS are you using?
238: [22:34:18] <robjingram> 3.3
239: [22:34:43] <robjingram> I can create a page of the same type in Admin and the record goes into the sitetree table
240: [22:34:56] <robjingram> But the test seems to think it needs its own table
241: [22:35:15] <robjingram> Which doesn't exist
242: [22:35:54] * muskie9 has joined #silverstripe
243: [22:45:24] <robjingram> DataObject::$cache_has_own_table for the class is set to true
244: [22:46:30] <muskie9> robjingram do you have any $db or $has_one declared in the page?
245: [22:49:59] <robjingram> No, nor its parent class, but its "grandparent" class is BlogPost, which does have $db defined
246: [22:50:43] <muskie9> then I think you're correct... it shouldn't need a table afaik
247: [22:51:28] <robjingram> Just trying to debug to see where that gets set to true in the cache
248: [22:55:36] <robjingram> OK, I have some strange interaction going on between my tests. When I run that test method in isolation the $cache_has_own_table value remains false
249: [22:55:48] <robjingram> Somehow the previous test is setting it to true. Maybe because it is using a fixture
250: [22:56:15] <robjingram> Think I need to dig into what the first test is doing in my debugging
251: [23:00:04] * Azure quit (Quit: My Mac has gone to sleep. ZZZzzz…)
252: [23:00:29] * robbiea has left #silverstripe
253: [23:05:17] * Azure has joined #silverstripe
254: [23:11:12] * cheddam has joined #silverstripe
255: [23:23:16] * robbiea has joined #silverstripe
256: [23:36:39] * spronk has joined #silverstripe

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