#silverstripe IRC Log

IRC log for 16 January 2016

All timestamps are in UTC.

1: [00:02:26] * zlinux has joined #silverstripe
2: [00:04:41] <harry2> if my DataObject has many Images how do i access the first Image in my template without a loop
3: [00:14:24] * Stomach_ has joined #silverstripe
4: [00:15:51] * Stomach_ quit (Client Quit)
5: [00:16:24] * Stomach quit (Ping timeout: 245 seconds)
6: [00:17:04] <harry2> @oddnoc are you still online?
7: [00:19:29] <harry2> How do reference a many_many dataobject in my template without a loop
8: [00:19:44] <harry2> I would have thought it was Blah.0.Image.Name
9: [00:19:55] <harry2> where Blah many_many Image
10: [00:25:11] <harry2> anyone online?
11: [00:31:50] <harry2> i figured it out - off to bed!
12: [00:33:01] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
13: [00:36:22] * harry2 quit (Ping timeout: 252 seconds)
14: [00:48:56] * Azure quit (Ping timeout: 240 seconds)
15: [00:51:54] * Azure has joined #silverstripe
16: [01:19:38] * apuckey has joined #silverstripe
17: [01:19:48] * Stomach has joined #silverstripe
18: [01:20:52] * Azure quit (Ping timeout: 265 seconds)
19: [01:23:31] * Azure has joined #silverstripe
20: [01:28:33] * BrewNaked quit (Remote host closed the connection)
21: [01:35:41] * joelpittet has joined #silverstripe
22: [01:58:25] * joelpittet quit (Remote host closed the connection)
23: [02:05:02] * r_hector has joined #silverstripe
24: [02:40:58] * FrozenFire quit (Ping timeout: 272 seconds)
25: [02:44:10] * FrozenFire has joined #silverstripe
26: [03:17:26] * BrewNaked has joined #silverstripe
27: [03:18:19] * r_hector quit (Remote host closed the connection)
28: [03:22:15] * BrewNaked quit (Ping timeout: 260 seconds)
29: [03:55:32] * pinc has joined #silverstripe
30: [03:56:17] * jmp909 has joined #silverstripe
31: [03:56:17] <ss-helper> jmp909: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
32: [03:56:21] <jmp909> hi
33: [03:57:10] <jmp909> could anybody tell me if i'm doing something wrong here please? http://www.silverstripe.org/community/forums/general-questions/show/20136?start=16#post412656
34: [04:01:20] * pinc quit (Ping timeout: 255 seconds)
35: [04:03:04] <Gfactor> public function getSpeakerPhoto() {
36: [04:03:05] <Gfactor> if ($this->Photo()->exists()) {
37: [04:03:05] <Gfactor> return $this->Photo()->SetWidth(100);
38: [04:03:05] <Gfactor> }
39: [04:03:05] <Gfactor> return '(no image)';
40: [04:03:05] <Gfactor> }
41: [04:05:14] <jmp909> no the thumbnail works but im having to reference the field alias not the field name
42: [04:05:46] <jmp909> so i cant do this in summary_fields: 'Thumbnail' => 'Speaker Photo'
43: [04:06:02] <jmp909> because getThumbnail doesnt work, it's trying to reference the alias
44: [04:06:25] <jmp909> and obviously i can't do function "getSpeaker Photo" or getSpeakerPhoto for that
45: [04:06:34] <jmp909> my alias has to be "SpeakerPhoto"
46: [04:06:42] <jmp909> ie the field header title
47: [04:10:13] <Gfactor> private static $summary_fields = array(
48: [04:10:13] <Gfactor> 'SpeakerPhoto' => 'Speaker Photo(Alias)' );
49: [04:12:24] <jmp909> then the get function wont work
50: [04:12:48] <Gfactor> Then i recommend you use gridfield component to display the summary field
51: [04:13:09] <jmp909> http://oi64.tinypic.com/2cqn19d.jpg
52: [04:13:37] <jmp909> see how it uses the right side of the assignment ie the label for the get function
53: [04:13:42] <jmp909> it should really be getThumbnail
54: [04:14:03] <jmp909> ok i'll look into that, i'm new to SS
55: [04:14:50] <Gfactor> set the function to getGridThumbnail()
56: [04:15:06] <Gfactor> the set the alias to what ever you wanna call it
57: [04:15:57] <Gfactor> but ib the summary field, set the function and assign the Alias
58: [04:18:05] <jmp909> with a gridfield component? i'm just wondering why theyve mapped the field alias to the getter function rather than the field name when the alias might have spaces
59: [04:24:57] <jmp909> it is a gridfield by default isnt it?
60: [04:27:21] <Gfactor> private static $summary_fields = array(
61: [04:27:21] <Gfactor> 'GridThumbnail' => 'Name you Alias' );
62: [04:27:21] <Gfactor> public function getGridThumbnail() {
63: [04:27:21] <Gfactor> if ($this->Photo()->exists()) {
64: [04:27:21] <Gfactor> return $this->Photo()->SetWidth(100);
65: [04:27:22] <Gfactor> }
66: [04:27:23] <Gfactor> return '(no image)';
67: [04:27:25] <Gfactor> }
68: [04:30:16] <jmp909> that doesnt work
69: [04:30:35] <jmp909> if you look at my pic.. the get function refers to the alias
70: [04:30:40] <jmp909> well let me try your code directly
71: [04:31:33] <jmp909> no it doesnt work
72: [04:32:06] <jmp909> it has to be 'GridThumbnail' => 'SomeAlias' , and then getSomeAlias as the function
73: [04:32:18] <jmp909> which is obviously not desirable
74: [04:32:38] <jmp909> it should be getGridThumbnail like you say
75: [04:33:02] <jmp909> this is v3.2.1
76: [04:34:30] <Gfactor> hmmm...just copy & paste the code, it works perfectly...unless if you have other issues that might be affecting it
77: [04:36:16] <jmp909> the code i put on the forum is pretty much all i've added since installation
78: [04:38:22] <jmp909> weird, as a single field it works fine
79: [04:39:09] <jmp909> as soon as i add another summary field it breaks
80: [04:39:15] <jmp909> private static $summary_fields = array( 'Company', 'GridThumbnail' => 'Name you Alias' );
81: [04:39:54] <jmp909> ah.. if one is aliased, they all have to be aliased
82: [04:40:00] <jmp909> private static $summary_fields = array( 'Company' => 'The Company', 'GridThumbnail' => 'Name you Alias' );
83: [04:40:04] <jmp909> works fine
84: [04:41:35] <Gfactor> If you don't wan't alias, set the field to ''
85: [04:42:07] <Gfactor> That is private static $summary_fields = array( 'Company' => '', 'GridThumbnail' => 'Name you Alias' );
86: [04:42:44] <jmp909> that blanks the column title
87: [04:42:50] <Gfactor> yes
88: [04:42:52] <jmp909> it'll have to be 'Company' => 'Company'
89: [04:43:21] <Gfactor> '' will blank any column title
90: [04:47:30] <jmp909> i've updated that now thanks http://www.silverstripe.org/community/forums/general-questions/show/20136?start=24#post412657
91: [04:47:58] <Gfactor> great!
92: [04:48:26] <jmp909> thanks for your help.
93: [04:49:31] * Stomach quit (Quit: zzz)
94: [05:06:17] * BrewNaked has joined #silverstripe
95: [05:08:29] * zlinux quit (Ping timeout: 276 seconds)
96: [05:10:59] * BrewNaked quit (Ping timeout: 260 seconds)
97: [05:13:26] * Gfactor quit (Ping timeout: 240 seconds)
98: [05:27:38] * Stomach has joined #silverstripe
99: [05:42:58] * Stomach quit (Quit: zzz)
100: [05:48:42] * micmania1 has joined #silverstripe
101: [05:58:01] * pinc has joined #silverstripe
102: [06:02:16] * pinc quit (Ping timeout: 250 seconds)
103: [06:55:28] * BrewNaked has joined #silverstripe
104: [06:59:26] * BrewNaked quit (Ping timeout: 240 seconds)
105: [07:08:20] * Stomach has joined #silverstripe
106: [07:24:28] * jmp909 quit (Ping timeout: 252 seconds)
107: [07:59:40] * pinc has joined #silverstripe
108: [08:01:39] * Gfactor has joined #silverstripe
109: [08:04:55] * pinc quit (Ping timeout: 240 seconds)
110: [08:05:34] * micmania1 quit (Quit: micmania1)
111: [08:44:20] * BrewNaked has joined #silverstripe
112: [08:48:29] * BrewNaked quit (Ping timeout: 245 seconds)
113: [09:24:36] * Charles_ has joined #silverstripe
114: [09:24:36] <ss-helper> Charles_: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
115: [09:24:59] * Charles_ is now known as Guest66198
116: [09:25:23] * r_hector has joined #silverstripe
117: [09:26:12] <Guest66198> Hey guys, just wondering if anyone knows how to add an upload field to the ModalAdmin via getEditForm. I want to attach dropzone and not upload files to specific record and instead just allow to be uploaded.
118: [09:26:15] * apuckey quit (Ping timeout: 260 seconds)
119: [09:50:06] * Gfactor quit (Ping timeout: 240 seconds)
120: [10:02:16] * pinc has joined #silverstripe
121: [10:07:06] * pinc quit (Ping timeout: 256 seconds)
122: [10:15:45] * Stomach quit (Quit: zzz)
123: [10:17:18] * Guest66198 quit (Quit: Page closed)
124: [10:19:56] * r_hector quit (Remote host closed the connection)
125: [10:33:17] * BrewNaked has joined #silverstripe
126: [10:37:26] * BrewNaked quit (Ping timeout: 240 seconds)
127: [11:05:26] * arnhoe has joined #silverstripe
128: [11:32:35] * gelignite has joined #silverstripe
129: [11:55:24] <ss-helper> silverstripe slash in url file location - http://stackoverflow.com/questions/34826577/silverstripe-slash-in-url-file-location
130: [12:03:49] * pinc has joined #silverstripe
131: [12:08:01] * Gfactor has joined #silverstripe
132: [12:08:06] * pinc quit (Ping timeout: 240 seconds)
133: [12:21:49] * BrewNaked has joined #silverstripe
134: [12:26:35] * BrewNaked quit (Ping timeout: 276 seconds)
135: [12:50:06] * krofek quit (Ping timeout: 255 seconds)
136: [13:48:58] * krofek has joined #silverstripe
137: [14:02:03] * Gfactor quit (Ping timeout: 260 seconds)
138: [14:05:21] * pinc has joined #silverstripe
139: [14:09:51] * pinc quit (Ping timeout: 265 seconds)
140: [14:10:41] * arnhoe quit (Read error: Connection reset by peer)
141: [14:11:01] * BrewNaked has joined #silverstripe
142: [14:15:39] * BrewNaked quit (Ping timeout: 265 seconds)
143: [14:38:03] * Gfactor has joined #silverstripe
144: [14:42:29] * Gfactor quit (Ping timeout: 246 seconds)
145: [14:43:16] * Gfactor has joined #silverstripe
146: [14:48:46] * Gfactor quit (Ping timeout: 240 seconds)
147: [14:49:27] * Gfactor has joined #silverstripe
148: [15:13:59] * Gfactor quit (Ping timeout: 246 seconds)
149: [15:59:53] * BrewNaked has joined #silverstripe
150: [16:04:59] * BrewNaked quit (Ping timeout: 276 seconds)
151: [16:06:52] * pinc has joined #silverstripe
152: [16:08:05] * jmp909 has joined #silverstripe
153: [16:09:00] <jmp909> hi
154: [16:10:02] <jmp909> does anyone have an example of SortableGridField working in an extension please?
155: [16:11:13] <jmp909> i currently have it setup in my ModelAdmin subclass.. which works fine but i wasn't sure how to move it to an extension as the method requires is different... class PersonAdmin extends ModelAdmin { private static $managed_models = array('Speaker', 'Advisor', 'Expert'); public function getEditForm($id = null, $fields = null) {
156: [16:11:33] <jmp909> whereas extension needs updateEditForm hook i believe
157: [16:11:39] * pinc quit (Ping timeout: 265 seconds)
158: [16:32:21] <jmp909> also, what's the best way to rename a model field please when there's existing data? i went into mySQL, renamed it, updated the name in my Class and then did /dev/build?flush=1 .. it seems to be ok but I don't know if that's the correct method
159: [17:16:59] * Azure quit (Ping timeout: 264 seconds)
160: [17:20:15] * Azure has joined #silverstripe
161: [17:48:47] * BrewNaked has joined #silverstripe
162: [17:53:09] * BrewNaked quit (Ping timeout: 265 seconds)
163: [18:08:29] * pinc has joined #silverstripe
164: [18:12:58] * pinc quit (Ping timeout: 265 seconds)
165: [18:29:51] <jmp909> anyway to debug sql queries used by the ORM currently? in Laravel there's a DebugBar that shows all queries executed.
166: [18:30:05] <jmp909> i couldn't get DeveloperDashboard working with 3.2, not sure if i'm doing anything wrong
167: [19:37:38] * BrewNaked has joined #silverstripe
168: [19:42:11] * BrewNaked quit (Ping timeout: 264 seconds)
169: [20:01:06] * Stomach has joined #silverstripe
170: [20:10:08] * pinc has joined #silverstripe
171: [20:14:46] * pinc quit (Ping timeout: 265 seconds)
172: [21:21:04] * Gfactor has joined #silverstripe
173: [21:26:09] * BrewNaked has joined #silverstripe
174: [21:30:30] * BrewNaked quit (Ping timeout: 256 seconds)
175: [21:33:57] * Gfactor quit (Ping timeout: 250 seconds)
176: [22:08:15] * Gfactor has joined #silverstripe
177: [22:14:40] * Stomach quit (Quit: zzz)
178: [22:21:16] * joelpittet has joined #silverstripe
179: [22:30:50] * Embraden has joined #silverstripe
180: [22:51:51] * r_hector has joined #silverstripe
181: [22:53:54] * r_hector quit (Remote host closed the connection)
182: [23:00:34] * jmp909 quit (Ping timeout: 252 seconds)
183: [23:05:43] * Azure quit (Ping timeout: 260 seconds)
184: [23:07:34] * Azure has joined #silverstripe
185: [23:15:03] * BrewNaked has joined #silverstripe
186: [23:19:52] * BrewNaked quit (Ping timeout: 256 seconds)
187: [23:33:30] * Stomach has joined #silverstripe
188: [23:50:25] * gelignite quit (Quit: http://bit.ly/1kso8Ta)

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