#silverstripe IRC Log

IRC log for 25 July 2015

All timestamps are in UTC.

1: [00:04:35] * squarefanatic has joined #silverstripe
2: [00:04:36] * r_hector has joined #silverstripe
3: [00:26:46] * Tanger has joined #silverstripe
4: [00:31:22] * Tanger quit (Ping timeout: 250 seconds)
5: [00:31:53] * Tanger has joined #silverstripe
6: [00:41:42] * Ryan-Toast quit (Quit: Ryan-Toast)
7: [00:42:30] * Azure quit (Read error: Connection reset by peer)
8: [00:47:53] * Ryan-Toast has joined #silverstripe
9: [00:49:35] * Azure has joined #silverstripe
10: [00:50:16] * Azure quit (Client Quit)
11: [00:53:05] * Azure has joined #silverstripe
12: [00:55:51] * Azure quit (Client Quit)
13: [00:55:58] * samlander has joined #silverstripe
14: [00:56:01] <samlander> allo gents
15: [00:58:30] * Azure has joined #silverstripe
16: [00:58:44] * veb has joined #silverstripe
17: [01:06:29] * Azure quit (Quit: Oops.)
18: [01:15:25] * Azure has joined #silverstripe
19: [01:15:49] * joelpittet has joined #silverstripe
20: [01:18:42] * r_hector quit (Remote host closed the connection)
21: [01:24:50] * veb quit (Quit: veb-irc: &)
22: [01:25:36] * Cheddam quit (Ping timeout: 264 seconds)
23: [01:49:24] * UncleCheese has joined #silverstripe
24: [02:17:06] <ss-helper> PHP Upgrade Causes Error: "End of script output before headers: main.php" - http://www.silverstripe.org/community/forums/general-questions/show/102685
25: [02:45:54] <samlander> ffs
26: [02:46:00] <samlander> this is driving me crzy
27: [02:47:33] <samlander> i have a simple function in my controller:
28: [02:47:48] <samlander> function GetMegaWidth($countin = 1) { return $countin * 225; }
29: [02:48:31] <samlander> and in my template: style="width: $GetMegaWidth($MegaMenuSet($MegaMenuSetID).MenuItems.Count) px;" test="$MegaMenuSet($MegaMenuSetID).MenuItems.Count">
30: [02:48:55] <samlander> the result is: <div class="megamenucentered" style="width: px;" test="2">
31: [02:49:14] <samlander> i *KNOW* that im getting the proper item count because of my test
32: [02:49:23] <samlander> but my function isnt returning a value
33: [02:49:25] <samlander> wtf.
34: [02:49:39] <Ryan-Toast> lowercase get
35: [02:49:46] <Ryan-Toast> and them omit it in the template
36: [02:50:41] <samlander> nope
37: [02:50:49] <Ryan-Toast> one sec
38: [02:53:31] <Ryan-Toast> samlander: what;s the code for MegaMenuSet
39: [02:53:43] <Ryan-Toast> samlander !help
40: [02:53:51] <Ryan-Toast> !help samlander
41: [02:53:51] <ss-helper> samlander: Please provide the version, full error message and relevant code. You can put the code in http://kopy.io/ or http://www.sspaste.com/ or https://gist.github.com/ and paste the link here.
42: [02:54:12] <samlander> it returns a MenuSet dataobject
43: [02:54:39] <samlander> public static function MegaMenuSet($MegaMenuSetID)
44: [02:54:39] <samlander> {
45: [02:54:39] <samlander> return MenuSet::get()->filter( array( 'ID' => $MegaMenuSetID))->first();
46: [02:54:39] <samlander> }
47: [02:54:54] <samlander> but either way, the whole point is...
48: [02:54:59] <samlander> my function is dirt efn simple
49: [02:55:13] <Ryan-Toast> you should use get_by_id()
50: [02:55:20] <samlander> and my template code shows that the count is being read
51: [02:55:21] <Ryan-Toast> and that’s returning an id in the test?
52: [02:55:39] <samlander> $MegaMenuSet($MegaMenuSetID).MenuItems.Count <-- returns the number of menuitems in the set
53: [02:55:49] <Ryan-Toast> does that return a number though?
54: [02:55:53] <samlander> yes
55: [02:55:55] <Ryan-Toast> in your test
56: [02:55:56] <Ryan-Toast> kk
57: [02:55:59] <samlander> as shown in the test="" attrib
58: [02:56:34] <samlander> function GetMegaWidth($countin = 1) { return $countin * 225; }
59: [02:57:01] <Ryan-Toast> I don’t think you can nest methods
60: [02:57:20] <Ryan-Toast> put your complexity in the one method, and pass the id to it
61: [02:57:24] * Tanger quit (Quit: sleep())
62: [02:57:26] <samlander> k
63: [03:38:21] * keroberos quit (Ping timeout: 255 seconds)
64: [03:44:17] * keroberos has joined #silverstripe
65: [04:06:15] * benjhocking1 quit (Read error: Connection reset by peer)
66: [04:10:09] * benjhocking has joined #silverstripe
67: [04:26:07] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
68: [04:35:44] * Jakx has joined #silverstripe
69: [04:36:04] <Jakx> can I Count() a DataList, before I limit() it?
70: [04:39:21] <zauberfisch> Jakx: yes
71: [04:40:19] <zauberfisch> Jakx: count() performs a count sql query and does not fetch data
72: [04:40:19] * Jakx quit (Ping timeout: 252 seconds)
73: [04:46:15] * spronka has joined #silverstripe
74: [04:49:28] * mobiusnz quit (Quit: Leaving.)
75: [04:49:49] <samlander> this is absolutely stupid xD
76: [04:49:59] <samlander> is it because im trying to call the function from an included template?
77: [04:57:50] <samlander> weird
78: [04:58:17] <samlander> yeah, it works in the corresponding template, but not the <% include
79: [05:01:22] <samlander> any way to pass a variable to an included ss file?
80: [05:11:53] * Ryan-Toast quit (Quit: Ryan-Toast)
81: [05:19:30] * mobiusnz has joined #silverstripe
82: [05:20:57] * spronka quit (Quit: My Mac has gone to sleep. ZZZzzz…)
83: [05:30:47] * joelpittet quit ()
84: [05:46:32] * mobiusnz quit (Quit: Leaving.)
85: [05:54:26] * spronka has joined #silverstripe
86: [07:28:12] * veb has joined #silverstripe
87: [07:31:20] * veb quit (Client Quit)
88: [07:40:17] * veb has joined #silverstripe
89: [07:41:08] <zauberfisch> samlander: yes
90: [07:41:16] <zauberfisch> <% include Foo Bar=
91: [07:41:24] <zauberfisch> <% include Foo Bar='Ohai' %>
92: [07:41:26] <zauberfisch> or
93: [07:41:30] <zauberfisch> <% include Foo Bar=$blubb %>
94: [07:41:39] <zauberfisch> though there are some bugs with this
95: [07:41:52] <zauberfisch> Bar will be globaly set (for all scopes inside the include)
96: [07:42:40] <zauberfisch> so $Bar and <% loop $Children %>$Bar<% end_loop %> is the same value
97: [08:09:48] * firefox2kx has joined #silverstripe
98: [08:32:38] * veb quit (Quit: veb-irc: &)
99: [08:33:53] * veb has joined #silverstripe
100: [08:42:36] * darjus01 has joined #silverstripe
101: [08:43:00] * veb quit (Quit: veb-irc: &)
102: [08:45:31] <darjus01> Hi all, I need help with logic. I have site on swipe stripe with sells clothers, ant they have service put initials or text segment on clothes price of service depends on world count that you put in service form, so i cannot think way to make this add to swipestripe cart and order, maybe you have some ideas?
103: [09:16:48] * veb has joined #silverstripe
104: [09:16:53] * veb quit (Client Quit)
105: [09:27:22] * veb has joined #silverstripe
106: [09:29:15] * veb quit (Client Quit)
107: [09:31:08] * veb has joined #silverstripe
108: [09:31:37] * veb quit (Read error: Connection reset by peer)
109: [09:49:12] <ss-helper> CMS-Admin: Buttons (Save as Draft, Save & Publish) don't work - http://www.silverstripe.org/community/forums/installing-silverstripe/show/102708
110: [11:07:07] * squarefanatic quit (Remote host closed the connection)
111: [11:35:52] * Jezz4 has joined #silverstripe
112: [11:36:03] <Jezz4> Yo cats, what's up?
113: [11:36:36] <Jezz4> Does anybody have a simple example snippet of a frontend UploadField being used?
114: [11:36:41] <zauberfisch> I am a fish
115: [11:36:47] <Jezz4> My mistake
116: [11:37:29] * KUTTEN has joined #silverstripe
117: [11:40:11] <zauberfisch> Jezz4: well, basically the UploadField *should* work in frontend
118: [11:40:18] <zauberfisch> though you certainly need to change styles
119: [11:40:45] <zauberfisch> and you might want to dissallow attach and file listing
120: [11:42:05] <Jezz4> It's the controller giving me strife
121: [11:42:13] <Jezz4> Anyway, I'm sure I can muddle my way through it :)
122: [11:43:06] <zauberfisch> I have recently hacked something together for frontend file upload: http://paste2.org/v2AnW0j5 http://paste2.org/tj9tp9zd
123: [11:43:16] <zauberfisch> not sure how well it works yet, but perhaps that helps
124: [11:43:41] <zauberfisch> I simply put that into a silverstripe form
125: [11:44:23] <Jezz4> Cheers :D
126: [11:44:39] <Jezz4> I managed to save it all fine, I just have to set up the IDs now. :D
127: [11:46:34] <zauberfisch> oh
128: [11:46:50] <zauberfisch> handling the file save should be easy
129: [11:46:56] <zauberfisch> I did that only after submitting the form
130: [11:47:34] <zauberfisch> when the user uploads the files I do nothing but save the file. the upload field itself has a hidden input that stores the IDs of all the files
131: [11:47:50] <Jezz4> Yo
132: [11:47:57] <Jezz4> So I've got something which extends Image
133: [11:48:01] <zauberfisch> so after submitting the form, you should have an array like $data['MyUploadField']['Files'] containing the IDs of all files
134: [11:48:06] <Jezz4> Yeah
135: [11:48:09] <Jezz4> I do
136: [11:48:18] <Jezz4> How do I link those up with my has_many?
137: [11:48:42] <Jezz4> $object->Images()->add($id); ?
138: [11:49:00] <zauberfisch> $object->Images()->addMany($data['MyUploadField']['Files'])
139: [11:49:06] <zauberfisch> or something along those lines
140: [11:49:21] <zauberfisch> you should check that the data is correct and is set before though
141: [11:50:00] <Jezz4> Hmm
142: [11:50:04] <Jezz4> It's not liking that
143: [11:50:14] <Jezz4> "Creating default object from empty value"
144: [11:50:21] <Jezz4> Specifically "$item->$fk = $foreignID;"
145: [11:50:42] <zauberfisch> hmm?
146: [11:50:46] <zauberfisch> not sure what you mean
147: [11:50:56] <Jezz4> That's ok :D
148: [11:51:40] <zauberfisch> also, I would recommend using many_many relations only for files. extending files and making it a has_one<>has_many relation usually hurts more than it helps
149: [11:52:10] <Jezz4> Sure
150: [11:52:25] <Jezz4> So, what's happening is my ExtendedImage isn't being created.
151: [11:52:34] <Jezz4> I'm just having a File created with the upload
152: [11:54:17] <zauberfisch> ah, so you want the upload field to create an ExtendedImage instead of file?
153: [11:54:58] <Jezz4> Yeah
154: [11:55:10] <Jezz4> I'm pretty sure I can take it from there if that's the issue :D
155: [11:56:04] <Jezz4> It's creating a File with class Image instead of class ExtendedImage
156: [12:01:51] <Jezz4> Okay, I've managed to work it out
157: [12:02:04] <Jezz4> Not even a solution that will actually help anybody else
158: [12:02:13] <zauberfisch> you probably have to overwrite the wholle saveTemporaryFile
159: [12:02:19] <zauberfisch> something like this: http://paste2.org/GCgYFbeH
160: [12:02:21] <Jezz4> Just moved ExtendedImage to a DataExtension
161: [12:02:33] <zauberfisch> oh, that works too I guess
162: [12:02:37] <Jezz4> Means I can just roll with an Image being uploaded. :P
163: [12:02:43] <Jezz4> Cheers for your help though :)
164: [12:02:48] <zauberfisch> though the code I just pasted might work
165: [12:02:51] <zauberfisch> haven't tested it
166: [12:02:58] <zauberfisch> but should work
167: [12:05:24] <Jezz4> :D
168: [12:05:25] <Jezz4> Cheers
169: [12:17:18] * KUTTEN quit (Ping timeout: 246 seconds)
170: [12:20:06] * Jezz4 quit (Ping timeout: 246 seconds)
171: [12:35:01] <ss-helper> Member Profile Module Order of Verification Emails - http://www.silverstripe.org/community/forums/all-other-modules/show/102709
172: [13:21:58] * keroberos quit (Ping timeout: 240 seconds)
173: [13:23:47] * keroberos has joined #silverstripe
174: [13:25:51] * jamesbrowne has joined #silverstripe
175: [13:29:53] <jamesbrowne> Anyone able to get Translatable working with the blog module? Posts created under a translated Blog page just disappear, ie. they don't appear in the list of posts.
176: [13:35:57] <jamesbrowne> BlogPosts are getting saved with the default locale, not the one that is currently selected.
177: [13:51:21] * spronka quit (Quit: My Mac has gone to sleep. ZZZzzz…)
178: [14:20:18] <darjus01> Hi all, I need help with logic. I have site on swipe stripe with sells clothers, ant they have service put initials or text segment on clothes price of service depends on world count that you put in service form, so i cannot think way to make this add to swipestripe cart and order, maybe you have some ideas?
179: [14:25:08] * gelignite has joined #silverstripe
180: [14:54:43] * Azure quit (Quit: Oops.)
181: [14:55:08] * Azure has joined #silverstripe
182: [15:27:59] * jamesbrowne quit (Read error: Connection reset by peer)
183: [15:45:44] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
184: [15:53:06] <darjus01> Hi all, I need help with logic. I have site on swipe stripe with sells clothers, ant they have service put initials or text segment on clothes price of service depends on world count that you put in service form, so i cannot think way to make this add to swipestripe cart and order, maybe you have some ideas?
185: [16:34:11] * DimiStripe has joined #silverstripe
186: [17:03:22] <darjus01> Hi all, I need help with logic. I have site on swipe stripe with sells clothers, ant they have service put initials or text segment on clothes price of service depends on world count that you put in service form, so i cannot think way to make this add to swipestripe cart and order, maybe you have some ideas?
187: [18:43:34] * nontgor quit (Ping timeout: 265 seconds)
188: [18:55:32] * nontgor has joined #silverstripe
189: [20:19:43] * mobiusnz has joined #silverstripe
190: [20:23:40] * gelignite has joined #silverstripe
191: [20:33:52] * darjus01 quit (Read error: Connection reset by peer)
192: [20:46:33] * Stomach has joined #silverstripe
193: [20:49:58] * Stomach quit (Client Quit)
194: [21:14:31] * veb has joined #silverstripe
195: [21:16:30] * veb quit (Client Quit)
196: [21:17:36] * veb has joined #silverstripe
197: [21:22:48] * UncleCheese has joined #silverstripe
198: [21:27:42] * veb quit (Quit: veb-irc: &)
199: [21:34:36] * cloph quit (Ping timeout: 264 seconds)
200: [21:43:53] * Ryan-Toast has joined #silverstripe
201: [21:57:20] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
202: [22:21:13] * cloph_away has joined #silverstripe
203: [22:28:20] * veb has joined #silverstripe
204: [22:30:24] * veb quit (Client Quit)
205: [22:33:59] * veb has joined #silverstripe
206: [22:42:59] <Firesphere> \o
207: [22:43:10] <Firesphere> Good very late night folks.
208: [23:13:56] * squarefanatic has joined #silverstripe
209: [23:22:23] * squarefanatic quit (Remote host closed the connection)
210: [23:23:54] * squarefanatic has joined #silverstripe
211: [23:25:03] * squarefanatic quit (Remote host closed the connection)
212: [23:45:14] * UncleCheese has joined #silverstripe

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