#silverstripe IRC Log

IRC log for 11 November 2016

All timestamps are in UTC.

1: [00:04:46] * UncleCheese has joined #silverstripe
2: [00:07:46] <Admonish> I have two issues that I could use some assistance with. 1. Does anyone know how to use the AjaxUniqueTextField? 2. I have a custom UploadField class with its own custom Upload class and validator. How would I make the field automatically save the current object on upload?
3: [00:13:23] <darjusit> Admonish: whitch ss? is AjaxUniqueTextField module?
4: [00:22:35] * bubaphex quit (Quit: bubaphex)
5: [00:23:52] * janneklouman-- quit (Ping timeout: 265 seconds)
6: [00:28:23] * DanaeNZ quit (Remote host closed the connection)
7: [00:28:59] * DanaeNZ has joined #silverstripe
8: [00:31:22] * DanaeNZ quit (Remote host closed the connection)
9: [00:31:35] * DanaeNZ has joined #silverstripe
10: [00:40:31] * Admonish quit (Ping timeout: 260 seconds)
11: [00:55:44] * pweh has joined #silverstripe
12: [00:57:53] <pippy> alpha3: Uncaught exception 'ReflectionException' with message 'Class ErrorHandler does not exist'
13: [00:58:00] <pippy> I wonder what i did wrong
14: [01:30:28] * UncleCheese quit (Ping timeout: 245 seconds)
15: [01:30:43] * bubaphex has joined #silverstripe
16: [01:31:34] * DanaeNZ quit (Remote host closed the connection)
17: [01:32:07] * DanaeNZ has joined #silverstripe
18: [01:32:08] * bubaphex quit (Client Quit)
19: [01:36:36] * DanaeNZ quit (Ping timeout: 250 seconds)
20: [01:42:41] * DanaeNZ has joined #silverstripe
21: [01:49:12] * digitall_it has joined #silverstripe
22: [01:51:06] <digitall_it> hello, can you help me? http://www.sspaste.com/paste/show/582523d789aa8 why the function News called from a template returns Object->__call(): the method 'pos' does not exist on 'ElementNews' ? I changed the attribute name but no luck
23: [01:54:21] <pippy> it should be $this->Pos not $this->Pos()
24: [01:55:20] <digitall_it> you are right, thank you! I knew I had to ask from the first moment!
25: [01:55:26] <digitall_it> thank you again!
26: [01:58:26] * Phlunk3 quit (Read error: Connection reset by peer)
27: [02:07:58] <digitall_it> have a nice bug free day! goodbye!
28: [02:08:11] * digitall_it o/
29: [02:28:15] * Admonish has joined #silverstripe
30: [02:28:30] * digitall_it quit (Quit: digitall_it)
31: [02:28:58] <Admonish> darjusit: Im using S 3.4 and as far as I know the field is built into silverstripe.
32: [02:29:06] <Admonish> SS 3.4
33: [02:45:16] * bubaphex has joined #silverstripe
34: [02:58:32] * bubaphex quit (Quit: bubaphex)
35: [03:02:48] * bubaphex has joined #silverstripe
36: [03:03:01] * bubaphex quit (Client Quit)
37: [03:17:17] * micmania1 quit (Quit: micmania1)
38: [03:18:50] <Hailwood> Hmm `Product` has_many `Variant` has_many `ProductVariantAttributeValueLink` has_one `Attribute`(as `ColorAttribute` or `SizeAttribute` which are subclasses of `Attribute`) - How can I get all the `ColorAttribute`s that are linked to the given `Product` through that relation train?
39: [03:35:24] <Admonish> *Shrugs* I never was good with trains
40: [03:35:30] <Admonish> ;D
41: [03:58:51] * Admonish quit (Ping timeout: 260 seconds)
42: [04:03:34] * Hailwood quit (Quit: Konversation terminated!)
43: [04:07:57] <DanaeNZ> oh he is gone
44: [04:08:03] <DanaeNZ> was gonna say
45: [04:08:05] <DanaeNZ> left join
46: [04:08:07] <DanaeNZ> for days
47: [04:12:19] * helenclarko has joined #silverstripe
48: [04:12:39] <helenclarko> hey all
49: [04:13:16] <helenclarko> Has anyone here used Adobe's Business Catalyst?
50: [04:14:39] * helenclark0 has joined #silverstripe
51: [04:16:19] <helenclark0> Ive got a client who wants to be able to control email address setup from within Silverstripes CMS. Similar to how Business Catalyst does it.
52: [04:18:04] * helenclarko quit (Ping timeout: 268 seconds)
53: [04:18:19] * helenclark0 is now known as helenclarko
54: [04:20:04] * micmania1 has joined #silverstripe
55: [04:34:45] * micmania1 quit (Quit: micmania1)
56: [04:43:12] * janneklouman-- has joined #silverstripe
57: [04:47:45] * janneklouman-- quit (Ping timeout: 244 seconds)
58: [04:49:28] * helenclarko quit (Quit: Leaving)
59: [05:00:08] <ss-helper> Silverstripe: dev/build works on local, but not on external domain - http://stackoverflow.com/questions/40541370/silverstripe-dev-build-works-on-local-but-not-on-external-domain
60: [05:08:47] * DanaeNZ quit (Quit: TIME TO FEED)
61: [05:42:12] * pweh quit (Ping timeout: 260 seconds)
62: [06:17:00] <Firesphere> Hello world
63: [06:28:33] * wmk quit (Ping timeout: 246 seconds)
64: [06:50:51] * wmk has joined #silverstripe
65: [08:07:16] * darianno has joined #silverstripe
66: [08:45:23] * openbees has joined #silverstripe
67: [08:53:57] <openbees> Heya SilverStripe
68: [08:57:42] <wmk> hey openbees long time not seen
69: [08:58:48] * lerni has joined #silverstripe
70: [09:02:28] * lck has joined #silverstripe
71: [09:03:06] * kinglozzer has joined #silverstripe
72: [09:04:35] <lck> Hi guys, i am creating multiple forms on 1 page, some of which have some similar fields. This is causing an issue with DateField->setconfig('showcalendar',true).. When choosing a date in the calendar, the date will be parsed to the first instance of the datefield on the page. Does anybody know a fix for this?
73: [09:08:30] <openbees> wmk was lost in "not writing silverstripe code"
74: [09:09:02] <openbees> wmk today ended up here https://gist.github.com/Seldaek/2befec26e1231b6c280f/revisions while reading for composer and felt like IRC calling :D
75: [09:10:22] * janneklouman-- has joined #silverstripe
76: [09:11:28] <openbees> lck any code I can see to replicate this ?
77: [09:16:45] <lck> Here you go: https://gist.github.com/hoodweb/a3b7eb09e381558544307298ac8e22c1
78: [09:17:35] <lck> its 5 forms, with a few different fields based on the form. All of which has datefield with a calendar.
79: [09:18:52] <lck> when i try to fill out form 3, the datefield calendar will put the selected date in the first instance of <input name="FromDate">
80: [09:19:57] <kinglozzer> lck: I wonder if it's because they have the same HTML IDs...
81: [09:20:42] <openbees> yaah we need to think about some ways to differentiate between field IDs
82: [09:21:39] <lck> i agree. this would probably be the thing
83: [09:21:46] <kinglozzer> lck: What I usually do is create a "counter" that appends a number to the form's HTML ID, I think that then gets carried down to the form fields
84: [09:21:54] <lck> do you know weather the javascript selector takes name or classname?
85: [09:22:15] <kinglozzer> static $counter = 0; $counter++; $form->setHTMLID('Form_MyFormName_' . $counter)
86: [09:22:17] <kinglozzer> Something like that
87: [09:22:59] * DimiStripe has joined #silverstripe
88: [09:24:19] <lck> hmm. If it uses the ID, i could probably do something the likes of DateField->setAttribute('id','Form_C' . __FUNCTION__ . '_FromDate'.$ClientType) ?
89: [09:25:03] <lck> Oops typo: ->setAttribute('id','Form_' . __FUNCTION__ . '_FromDate'.$ClientType)
90: [09:27:53] <kinglozzer> lck: I don't know if you can adjust the field ID like that, I think that attribute will be overridden
91: [09:28:03] <kinglozzer> But you could do $form->setHTMLID('Form_MyFormName_' . $ClientType)
92: [09:30:42] <lck> Hmm it does seem to work. However i am getting an error on submit. It cannot convert the __FUNCTION__ constant to a string for some reason
93: [09:30:56] <lck> Do you think putting an ID on the form element itself would fix it?
94: [09:31:05] <openbees> yes why to fix each and every field when you can change it for form. You never you may need to style each form with different styles then having different ID's for each set of form fields will be much easier to manage.
95: [09:31:08] <kinglozzer> I'd try that first
96: [09:33:10] <lck> That is the better solution. It does work. However this also returns an error on submit "Object of class SS_HTTPRequest could not be converted to string"
97: [09:35:59] * openbees quit (Quit: Have a good Day !)
98: [09:36:20] <lck> It appears that the post request is having issues with the ClientType variable. ->setHTMLID('Form_ClientForm_' . 'test') works. but ->setHTMLID('Form_ClientForm_' . $ClientType) doesn't
99: [09:37:02] <kinglozzer> lck: Ah, that variable won't be set when you submit the form... as it won't be called from the template
100: [09:37:10] <lck> public function ClientForm($ClientType='other')
101: [09:37:20] <lck> Wouldn't the default value fix that?
102: [09:37:24] <kinglozzer> Probably
103: [09:37:38] <lck> It doesn't though :/
104: [09:38:12] <kinglozzer> Oh, it's because when you submit the form, the first argument is an SS_HTTPRequest object
105: [09:38:19] <lck> oh
106: [09:38:22] <lck> considering doing something on the likes of if($ClientType){ $form->setHTMLID() }
107: [09:38:33] <lck> Does seem abit hack-ish
108: [09:38:43] <kinglozzer> lck: Tbh I'd just switch to using a numeric counter
109: [09:38:56] <kinglozzer> static $counter = 0; $counter++; $form->setHTMLID('Form_MyFormName_' . $counter);
110: [09:39:13] <kinglozzer> The ID isn't really important, as long as it's unique
111: [09:39:44] * guci0 has joined #silverstripe
112: [09:39:45] <guci0> Morning!
113: [09:40:24] <lck> You would have a private static variable on the class, which increments? Are you sure it will increment when the form is called from the template?
114: [09:40:46] <kinglozzer> lck: No, not private static
115: [09:40:57] <kinglozzer> Just put "static $counter = 0;" inside your form function
116: [09:41:27] <lck> Oh never used static variables before
117: [09:41:33] <kinglozzer> https://www.tutorialspoint.com/php/php_static_variables.htm
118: [09:41:50] <kinglozzer> They work the same, they just can't be accessed outside that function :)
119: [09:42:45] * pweh has joined #silverstripe
120: [09:45:00] <lck> Works gj king
121: [09:47:12] <lck> i will use that alot in the future
122: [09:57:12] * Copperis has joined #silverstripe
123: [09:57:13] * wmk quit (Quit: Leaving)
124: [10:14:31] * agent44 has joined #silverstripe
125: [10:29:19] <gamma> Hello. We've got a form which has a date field on it that works properly on our development site, but the date picker doesn't show up in production. Does anyone know what might cause this? For some reason when ti'it's created in PRD, the class doesn't include "hasDatePicker" in it.
126: [10:54:29] * swaiba has joined #silverstripe
127: [11:11:50] * swaiba quit (Remote host closed the connection)
128: [11:32:06] * lck quit (Ping timeout: 260 seconds)
129: [11:37:47] * Azure quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
130: [11:39:31] * pweh has left #silverstripe
131: [12:28:10] <darianno> hey guys! I would like to extend search on SS 3.4 (want to be able to search dataobjects and custom fields...) what do you recommend? Solr or something else ?
132: [14:05:58] * wmk has joined #silverstripe
133: [14:12:38] <Copperis> Is it possible to add a custom WHERE clause to a datalist? I am adding it with ->where('...sql...'), but it seems to disappear when printing out the query with ->sql()
134: [14:38:50] * agent44 quit (Quit: zzz)
135: [14:44:46] * agent44 has joined #silverstripe
136: [14:58:38] * kerozene quit (Ping timeout: 256 seconds)
137: [14:59:33] * wmk quit (Ping timeout: 246 seconds)
138: [15:05:58] * muskie9 has joined #silverstripe
139: [15:12:14] * agent44 quit (Quit: zzz)
140: [15:13:30] * digitall_it has joined #silverstripe
141: [15:22:43] <digitall_it> o/ hi to everyone
142: [15:32:01] * agent44 has joined #silverstripe
143: [15:35:02] <slievr> o/ digitall_it
144: [15:35:36] <digitall_it> I found a bug in GD, seems it doesn’t respect exif orientation on some iphone photos
145: [15:36:02] <kinglozzer> digitall_it: Yep! https://github.com/silverstripe/silverstripe-framework/issues/3061
146: [15:36:05] <digitall_it> tried to open a bug in Silverstripe, then noted that Github also had the same problem because it uses GD or Imagemagick too
147: [15:36:11] <kinglozzer> No one has got around to fixing it
148: [15:37:33] <digitall_it> I am
149: [15:37:37] <digitall_it> doing a fix for that
150: [15:37:41] <digitall_it> meanwhile, use this program
151: [15:37:41] <digitall_it> http://savolai.net/software/JPEG-EXIF_autorotate
152: [15:37:49] <digitall_it> it is a bug with GD, it doesn’t respect EXIF tags
153: [15:38:02] <digitall_it> we simply need to check manually for this tags on upload+
154: [15:38:27] <digitall_it> and “autorotate” the image, destroying the tag
155: [15:39:03] <digitall_it> I think it will be fixed in future versions of the library, but other websites like Github are affected
156: [15:45:13] <digitall_it> ok posted a solution
157: [15:45:26] <digitall_it> it just needs for some tests and a PR
158: [15:45:47] <slievr> for silverstripe or GD?
159: [15:45:53] <digitall_it> For silverstripe
160: [15:46:01] <digitall_it> in the #3061
161: [15:47:11] <digitall_it> GD simply does not have EXIF support into rotation functions but can read tags. We simply need to pass the filename trough a function
162: [15:48:08] <digitall_it> As any function that reads and writes files, it needs sanitation. But it checks for support of exif_read_data
163: [15:48:25] <digitall_it> (PHP 4 >= 4.2.0, PHP 5, PHP 7)
164: [15:49:58] <slievr> surely no one uses 4 any more
165: [15:50:30] <digitall_it> However, on a better reading of the github fix
166: [15:50:44] <digitall_it> https://github.com/dljoseph/silverstripe-fixjpeg-orientation
167: [15:50:50] <digitall_it> is a composer ready module
168: [15:51:08] <digitall_it> just add water and works, we should incorporate his code instead
169: [15:58:31] * muskie9 quit (Read error: No route to host)
170: [16:04:51] * samsam has joined #silverstripe
171: [16:07:40] <samsam> I'm trying to read the value of the selected item of a DropdownField: http://sspaste.com/paste/show/5825ec4995c3d
172: [16:07:48] <samsam> it's not really working :/ any ideas?
173: [16:08:52] <kinglozzer> samsam: If you're using chosen, do you have jQuery available too?
174: [16:13:57] <samsam> kinglozzer: whats 'chosen'?
175: [16:14:20] <digitall_it> the Id ends with _chzn
176: [16:14:27] <digitall_it> it implies you’re using jQuery
177: [16:14:32] <kinglozzer> A JavaScript library for <select>
178: [16:14:37] <kinglozzer> Your ID of Form_ItemEditForm_Zoomlevel_chzn
179: [16:14:45] <kinglozzer> _chzn means you're using that library
180: [16:14:57] <kinglozzer> https://harvesthq.github.io/chosen/
181: [16:16:42] <samsam> _chzn is attached to every dropdownfield id name
182: [16:17:41] * janneklouman-- quit (Ping timeout: 248 seconds)
183: [16:20:52] <kinglozzer> samsam: I'm going to guess that you're talking about a field inside the CMS if you've never heard of a library that you're apparently using :P
184: [16:20:59] <kinglozzer> Use jQuery to get the value
185: [16:21:07] <samsam> yup :p
186: [16:21:24] <digitall_it> goodbye!
187: [16:21:25] <samsam> was afraid of that..
188: [16:21:29] * digitall_it quit (Quit: digitall_it)
189: [16:21:30] <kinglozzer> $('#Form_ItemEditForm_Zoomlevel').val() is probably what you need
190: [16:22:14] <kinglozzer> Writing JavaScript for the CMS is hard if you've never done it before
191: [16:23:50] <samsam> yup, that's what I thought
192: [16:24:05] * lerni quit ()
193: [16:24:06] <samsam> so when do you need Entwine?
194: [16:24:17] <samsam> when manipulating fields or smth?
195: [16:25:11] * janneklouman-- has joined #silverstripe
196: [16:25:32] <kinglozzer> Yep, when doing pretty much anything tbh
197: [16:26:13] <kinglozzer> https://www.bigfork.co.uk/takeaway/a-beginners-introduction-to-using-entwine-in-silverstripe
198: [16:26:22] <kinglozzer> I keep sharing my own article :P but it's the only one I'm aware of
199: [16:27:22] <samsam> haha yes I remember that one, but I should learn jquery first
200: [16:54:13] * Copperis quit (Ping timeout: 265 seconds)
201: [16:54:28] * muskie9 has joined #silverstripe
202: [17:06:59] * kinglozzer quit ()
203: [17:57:12] * janneklouman-- quit (Ping timeout: 260 seconds)
204: [18:03:31] * guci0 quit (Ping timeout: 260 seconds)
205: [18:14:23] * leomeloxp has joined #silverstripe
206: [18:19:19] * agent44 quit (Quit: zzz)
207: [18:39:26] * helenclarko has joined #silverstripe
208: [18:43:35] * helenclark0 has joined #silverstripe
209: [18:46:57] * helenclarko quit (Ping timeout: 268 seconds)
210: [18:48:29] * helenclarko has joined #silverstripe
211: [18:50:03] * helenclark0 quit (Ping timeout: 245 seconds)
212: [18:50:27] * darianno quit (Quit: ...)
213: [19:28:25] <samsam> are there known issues with HiddenField values not being generated by the CMS?
214: [19:42:35] * gelignite has joined #silverstripe
215: [20:14:36] * muskie9 quit (Quit: Textual IRC Client: www.textualapp.com)
216: [20:15:48] * darjusit quit (Ping timeout: 260 seconds)
217: [21:27:07] * darjusit has joined #silverstripe
218: [21:30:58] <darjusit> Hi all if I am using only framework without SS CMS, modules like better buttons bulk edit will work?
219: [21:42:47] <samsam> anyone know how to call a JS function using entwine? :/ when I enter gridfield edit view, I want it to call myFunc();
220: [21:43:15] <samsam> I tried: LiteralField::create("test", "<script type='text/javascript'>myFunc();</script>")
221: [22:13:16] <darjusit> how to download and framework without cms?
222: [22:18:25] <samsam> https://github.com/silverstripe/silverstripe-framework
223: [22:22:28] <helenclarko> What is the recommended Gallery module?
224: [22:24:10] <helenclarko> frankmullenger / gallery Looks good, but I think he gave up on maintaining modules
225: [22:25:31] <darjusit> make yourself gallery is easy to make :)
226: [22:26:21] <helenclarko> Yeah, I could do that too.
227: [22:33:12] * kerozene has joined #silverstripe
228: [22:39:16] * darjusit quit (Quit: Konversation terminated!)
229: [23:00:01] * ss-helper quit (Remote host closed the connection)
230: [23:00:15] * ss-helper has joined #silverstripe
231: [23:32:08] * micmania1 has joined #silverstripe
232: [23:43:41] <helenclarko> What is the recommended Gallery module?
233: [23:47:06] * samsam quit (Ping timeout: 260 seconds)
234: [23:48:44] * gelignite quit (Quit: http://bit.ly/1kso8Ta)

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