#silverstripe IRC Log

IRC log for 4 November 2016

All timestamps are in UTC.

1: [00:22:34] * DanaeNZ quit (Remote host closed the connection)
2: [00:23:08] * DanaeNZ has joined #silverstripe
3: [00:27:44] * DanaeNZ quit (Ping timeout: 260 seconds)
4: [00:37:24] * slievr1 has joined #silverstripe
5: [00:39:14] * Stomach_ quit (Quit: zzz)
6: [00:39:41] * slievr quit (Ping timeout: 260 seconds)
7: [00:42:47] * Stomach has joined #silverstripe
8: [00:47:40] * micmania1 quit (Quit: micmania1)
9: [00:49:35] * bubaphex has joined #silverstripe
10: [00:54:40] * micmania1 has joined #silverstripe
11: [00:59:57] * DanaeNZ has joined #silverstripe
12: [01:06:17] * micmania1 quit (Quit: micmania1)
13: [01:08:38] * micmania1 has joined #silverstripe
14: [01:13:18] * irogue has joined #silverstripe
15: [01:13:35] <irogue> IT ME
16: [01:14:07] * irogue licks ss23 violently
17: [01:19:40] <DanaeNZ> oh myyyyy5
18: [01:20:10] <DanaeNZ> how's tricks
19: [01:20:52] <irogue> pretty good
20: [01:20:56] <DanaeNZ> _b
21: [01:21:21] <irogue> I got an updated job description, and it includes this line:
22: [01:21:27] <irogue> "Participate in the continued improvement of our open source software portfolio and the community that surrounds it."
23: [01:21:33] <irogue> so I've decided to interpret that as "hang out in IRC"
24: [01:22:14] * bubaphex quit (Quit: bubaphex)
25: [01:22:31] <DanaeNZ> sounds about right
26: [01:23:51] <irogue> we have a henna artist in the office at the mo and I'm trying to decide what to get
27: [01:24:05] <irogue> if we get an SS logo the company pays for it but I'm not quite that much of a company man :P
28: [01:27:36] * neilf__ has joined #silverstripe
29: [01:29:20] <DanaeNZ> get
30: [01:29:21] <DanaeNZ> dickbutt
31: [01:29:25] <DanaeNZ> or Nippy's
32: [01:32:09] * UncleCheese has joined #silverstripe
33: [01:37:54] * bubaphex has joined #silverstripe
34: [01:39:36] <Stomach> get a nippys
35: [01:39:40] <Stomach> definitely need a nippys
36: [01:39:45] <Stomach> hi irogue
37: [01:44:14] <Stomach> and a wild UncleCheese appears
38: [01:44:20] <Stomach> the whole family is back together
39: [01:44:34] <Stomach> I've been playing way too much pokemon
40: [01:48:22] * irogue quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
41: [01:49:49] * janneklouman-- has joined #silverstripe
42: [01:53:45] * bubaphex quit (Quit: bubaphex)
43: [01:54:26] * janneklouman-- quit (Ping timeout: 250 seconds)
44: [01:55:43] <Firesphere> Hey UncleCheese
45: [01:55:46] <Firesphere> Long time no seen
46: [01:59:56] * irogue has joined #silverstripe
47: [02:03:01] <DanaeNZ> weooo
48: [02:03:06] <DanaeNZ> tis Friday afternoon
49: [02:03:16] <DanaeNZ> I should have a wine
50: [02:04:53] <irogue> https://www.instagram.com/p/BMXukdnBxoi/
51: [02:05:41] <UncleCheese> hi
52: [02:08:50] <Stomach> We have a party in the office this afternoon. Everyones currently getting their faces painted and a big client came in
53: [02:08:51] <Stomach> lols
54: [02:10:20] <Firesphere> Heh, that's okay :P
55: [02:11:21] * Hailwood quit (Quit: Konversation terminated!)
56: [02:12:55] * Phlunk3 quit (Remote host closed the connection)
57: [02:13:33] <Stomach> yeah :D
58: [02:13:42] <Stomach> always makes me laugh at the initial reaction to that though
59: [02:14:44] <DanaeNZ> Omg jealous
60: [02:14:48] <DanaeNZ> Face painting
61: [02:15:09] <DanaeNZ> I'm currently messing around with warehouses and zone based shipping
62: [02:15:14] <irogue> i guess technically we have face painting
63: [02:15:15] <DanaeNZ> not as fun as face painting
64: [02:15:23] <DanaeNZ> only it's on your hand
65: [02:15:27] <DanaeNZ> and more permanentish?
66: [02:15:33] <irogue> could get it on your face :P
67: [02:16:18] <Stomach> warehouses and zone based shipping
68: [02:16:38] <Stomach> Danae you got to the bit where you cuss loudly yet?
69: [02:17:08] * bubaphex has joined #silverstripe
70: [02:44:54] <Nightjar> 'hand' irogue says, with it on his forearm ;D
71: [02:47:08] * cheddam quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
72: [02:59:43] * bubaphex quit (Quit: bubaphex)
73: [03:12:44] <DanaeNZ> Stomach: well past that point
74: [03:12:49] <DanaeNZ> Everyday is full of loud swearing
75: [03:12:53] <DanaeNZ> my life is swears
76: [03:17:35] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
77: [03:20:48] * DanaeNZ quit (Quit: TIME TO FEED)
78: [03:22:49] * bubaphex has joined #silverstripe
79: [03:33:16] * bubaphex quit (Quit: bubaphex)
80: [03:53:47] <Nightjar> gg folks
81: [03:53:49] * Nightjar quit (Quit: Leaving)
82: [04:06:08] * Stomach quit (Quit: zzz)
83: [04:09:31] * bubaphex has joined #silverstripe
84: [04:11:04] * cheddam has joined #silverstripe
85: [04:21:47] * DorsaiNZ has joined #silverstripe
86: [04:22:24] <DorsaiNZ> hey anyone here able to help with RewriteCond issue I am having?
87: [04:29:17] * irogue quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
88: [04:29:28] * bubaphex quit (Quit: bubaphex)
89: [04:30:46] * DorsaiNZ has left #silverstripe
90: [04:42:26] * micmania1 quit (Quit: micmania1)
91: [05:00:11] <ss-helper> Development web: Silverstripe Framework in Benin (Africa) - https://groups.google.com/d/msg/silverstripe-dev/yV0GpNQO8_s/zmALE9zEAQAJ
92: [05:27:52] * cheddam quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
93: [06:11:48] * cheddam has joined #silverstripe
94: [06:14:14] * cheddam quit (Client Quit)
95: [06:23:39] * spronk quit (Quit: I may need a longer sleep timer...)
96: [07:23:56] * bubaphex has joined #silverstripe
97: [07:31:54] * darianno has joined #silverstripe
98: [07:33:41] * bubaphex quit (Quit: bubaphex)
99: [07:41:16] <Firesphere> \o
100: [08:00:47] * neilf__ quit (Quit: Connection closed for inactivity)
101: [08:05:16] * pweh has joined #silverstripe
102: [08:19:54] * janneklouman-- has joined #silverstripe
103: [08:24:29] * janneklouman-- quit (Ping timeout: 260 seconds)
104: [08:57:08] * wmk has joined #silverstripe
105: [09:00:19] <kinglozzer> o/
106: [09:02:52] * samsam has joined #silverstripe
107: [09:03:35] <samsam> so, how do you unset an uploadfield? This works for TextFields: $this->MyField = '';
108: [09:03:49] * janneklouman-- has joined #silverstripe
109: [09:23:36] <slievr1> $this->UploadID = 0; ?
110: [09:23:42] * slievr1 is now known as slievr
111: [09:42:56] * agent44 has joined #silverstripe
112: [09:49:02] <samsam> this->slievr = 1
113: [09:50:05] <samsam> actually no, that doesnt work :p
114: [09:50:33] <samsam> wait, it does
115: [09:51:38] <slievr> so good or bad>
116: [09:51:39] <slievr> ?
117: [09:52:38] <samsam> good!
118: [09:53:47] <slievr> Yay!
119: [10:09:54] * janneklouman-- quit (Ping timeout: 250 seconds)
120: [10:11:35] * janneklouman-- has joined #silverstripe
121: [10:43:34] * saiyan quit (Ping timeout: 260 seconds)
122: [10:44:45] * pweh quit (Read error: Connection reset by peer)
123: [10:52:06] <samsam> here's another one
124: [10:52:49] <samsam> when no file is set to an uploadfield, what's the FIELD value of that UploadField?
125: [10:53:01] * saiyan has joined #silverstripe
126: [11:07:28] * zippy has joined #silverstripe
127: [11:25:48] * zippy quit (Quit: Textual IRC Client: www.textualapp.com)
128: [11:33:08] * janneklouman-- quit (Ping timeout: 260 seconds)
129: [12:01:59] * wmk quit (Ping timeout: 250 seconds)
130: [12:23:38] * UndefinedOffset has joined #silverstripe
131: [12:39:00] * cheddam has joined #silverstripe
132: [12:43:29] * cheddam quit (Ping timeout: 260 seconds)
133: [12:43:31] * cheddam_ has joined #silverstripe
134: [12:44:06] * wmk has joined #silverstripe
135: [12:45:01] * cheddam_ quit (Client Quit)
136: [12:47:44] * digitall-it has joined #silverstripe
137: [12:47:44] <ss-helper> digitall-it: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
138: [12:47:50] <digitall-it> Hello to all
139: [12:48:12] <digitall-it> I've got two technical questions about Silverstripe
140: [12:48:45] <digitall-it> I would appreciate much any help you could give me, so I can contribute back to referring modules
141: [12:49:14] <digitall-it> My objective is to add block content functionality to Silverstripe via modules, I tried the two main ones, Blocks and Elemental
142: [12:51:07] <digitall-it> Elemental works fine, but when I try to create nested blocks I encounter a problem. It has a ListBlockElement that can contain other elements. This is achieved by a has_many relation with BaseElement, that is reciprocated on BaseElement with a has_one.
143: [12:52:08] <digitall-it> As I wanted to create my custom nesting blocks (formally, Row and Column, to use my CSS framework grid system) I created two elements called RowElement and ColumnElement, that both extend not from BaseElement but from ListElement
144: [12:52:36] <digitall-it> This works like a charm, but now I cannot traverse back the parent object from a child of one of these objects
145: [12:53:35] <digitall-it> For example, If I add a ContentElement to ColumnElement, then from there I try to access List (his has_one relation) I get an error, because the parent is not a ElementList object, but a ColumnElement
146: [12:54:01] <digitall-it> (sorry if I swap back and forth between *Element and Element*, the modules does so and I can't remember when is where)
147: [12:55:02] <digitall-it> To generalize the question, if I got two classes, A and B, A has many B, B has one A, then I extend class B to create class C, how can I maintain their database relationship?
148: [12:55:21] * janneklouman-- has joined #silverstripe
149: [12:55:48] <digitall-it> The second question is with the Blocks module: it simply doesn't work for me. I installed it four times trying to pinpoint the problem. Simply the ADD button doesn't show up. What do I do wrong? I install it by manual.
150: [12:57:37] <digitall-it> My suppositions are: 1. the UpdateCMSFields routine of the Page extender has a bug somewhere. 2. The module relies on other modules that have been upgraded. 3. There is a problem with the Italian translation of the module, so the button simply doesn't show up. 4. The button doesn't show up if there are no Block types defined.
151: [12:57:47] <digitall-it> I think the problem is number 2.
152: [13:03:58] <digitall-it> I am also sure the configuration options get picked up
153: [13:09:07] <digitall-it> dammit can't get this to work! :)
154: [13:09:47] <digitall-it> Ok, so other questions coming up, just for sake of knowing
155: [13:10:41] <digitall-it> I know you can set relations via YAML files on existing classes that you can't change directly, but how to UNSET a relation to set a new one?
156: [13:11:37] <digitall-it> Other question, I am not sure how the injector works in Silverstripe (ok that is a broad one)
157: [13:22:41] <digitall-it> Ok I have to go for 60 minutes tops, I will be back. Please save your answers for me!!
158: [13:27:36] * digitall-it quit (Ping timeout: 260 seconds)
159: [13:37:14] * kinglozz_ has joined #silverstripe
160: [13:39:29] * kinglozzer quit (Ping timeout: 250 seconds)
161: [14:41:49] * kinglozz_ is now known as kinglozzer
162: [14:58:30] * digitall-it has joined #silverstripe
163: [14:59:52] * darianno quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
164: [15:00:15] <digitall-it> hello to everyone again.
165: [15:01:32] <kinglozzer> o/ digitall-it
166: [15:03:52] <samsam> digitall-it: 'how can I maintain their database relationship'
167: [15:03:56] <samsam> what do you mean by that?
168: [15:04:03] <samsam> in what context
169: [15:05:25] <digitall-it> Hello @samsam, @kinglozzer
170: [15:05:29] <digitall-it> Let me rephrase
171: [15:07:02] <digitall-it> A has_many B, B has_one A, C extends A. In the module Elemental i extended A because code for A is part of the module. However, if I call the parent relationship in an instance of C, it fails.
172: [15:07:30] <kinglozzer> "parent relationship" ?
173: [15:07:49] <digitall-it> let me explain in code
174: [15:07:58] <digitall-it> actual code. just a second
175: [15:08:29] <digitall-it> meanwhile, thank you for taking the time to actually look at my question.
176: [15:09:58] <samsam> sspaste.com
177: [15:10:55] <digitall-it> I deleted the code and I am now trying Silverstripe Blocks (which I have another, different issue, with) so I have to look back at the commit. It will take a few seconds
178: [15:12:29] <digitall-it> First and foremost: take a look at this module. https://github.com/dnadesign/silverstripe-elemental
179: [15:13:11] <digitall-it> This is a block style editing module. It has many Elements. One of them, provides Nesting functionality
180: [15:13:14] <digitall-it> It is called ElementList
181: [15:13:15] <digitall-it> https://github.com/dnadesign/silverstripe-elemental/blob/master/code/models/ElementList.php
182: [15:13:49] <digitall-it> class ElementList extends BaseElement, private static $has_many = array('Elements' => 'BaseElement');
183: [15:14:13] <digitall-it> The BaseElement class, https://github.com/dnadesign/silverstripe-elemental/blob/master/code/models/BaseElement.php
184: [15:14:40] <digitall-it> class BaseElement extends Widget, private static $has_one = array('List' => 'ElementList');
185: [15:15:16] <digitall-it> you create Elements by creating new classes that extend BaseElement
186: [15:16:28] <digitall-it> The module then provides by some internal wiring to extend the Page class to build the "add elements" CMS fields. You loop over some sort of ArrayList (i suppose) interface in the template to render them, instead of a big lump of text.
187: [15:16:35] <digitall-it> Sort of Silverstripe Blocks
188: [15:17:19] <digitall-it> What I did is create a ColumnElement that does not extend BaseElement, but instead extends ElementList, to have nested elements like the functionality of ElementList
189: [15:18:05] <digitall-it> an entirely new element called Block. This means now we have a List element and a block element, the latter has all the functionality of the list and more.
190: [15:18:27] <digitall-it> ops sorry i meant a Column, not a Block (sorry for that)
191: [15:18:33] <kinglozzer> So now BaseElement's has_one points back to the wrong class?
192: [15:18:39] <digitall-it> YES
193: [15:18:59] <digitall-it> when I call from an istance of BaseElement the List
194: [15:19:03] <kinglozzer> digitall-it: Did you try overwriting it in yml?
195: [15:19:18] <digitall-it> I could, but then I would cut out the relationship with Element List
196: [15:19:24] <digitall-it> I want them both, I'm greedy
197: [15:19:48] <kinglozzer> Hmm, you'll need to add a second has_one then
198: [15:20:08] <kinglozzer> And a second has_many I think
199: [15:20:27] <digitall-it> my Column element already uses the List has_many
200: [15:20:42] <digitall-it> as Column extends Lists, it already has_many BaseElements
201: [15:21:17] <kinglozzer> You might need a polymorphic has_one...
202: [15:21:29] <digitall-it> yes I tought so, a polymorphic dot has_one?
203: [15:21:44] <kinglozzer> https://docs.silverstripe.org/en/3.4/developer_guides/model/relations/#polymorphic-has-one
204: [15:21:45] <digitall-it> sorry I'm new to the framework, I come from Symfony
205: [15:22:17] <kinglozzer> You'll need to overwrite the has_one on BaseElement to point to DataObject
206: [15:23:05] <digitall-it> I would have liked to investigate that subject, it expands on many use cases regarding other functionalities
207: [15:23:37] <kinglozzer> Hmm, now I think about it again, I'm not sure why it doesn't work without doing that change
208: [15:23:52] <kinglozzer> Do you get an error digitall-it?
209: [15:24:17] <digitall-it> Yes, I am rolling back the commit to try it live
210: [15:24:42] <digitall-it> (meanwhile, anyone knows why Sea Dawson module Blocks doesn't show an Add button? other users have reported that)
211: [15:24:48] <digitall-it> *Shea
212: [15:28:11] <digitall-it> ok rolled back, dev/building?flush=1
213: [15:29:30] * UndefinedOffset quit (Quit: Leaving.)
214: [15:29:52] <digitall-it> Ok, I'm now recreating the use case in the CMS
215: [15:34:01] <digitall-it> I screwed something up, the frontend doesn't load anymore.Getting Started To get started with the SilverStripe framework: Create a Controller subclass (doc.silverstripe.org/framework/en/topics/controller) Setup the routes.yml to your Controller (doc.silverstripe.org/framework/en/reference/director#routing). Create a template for your Controller (doc.silverstripe.org/framework/en/reference/templates)
216: [15:34:16] * UndefinedOffset has joined #silverstripe
217: [15:38:17] <digitall-it> I'm trying to figure things out
218: [15:40:36] <digitall-it> Please hold on. Oh, the tension! ;)
219: [15:42:19] <digitall-it> ok I figured that out, very funny. Wait a second
220: [15:43:18] <kinglozzer> No worries, I'm busy debugging a broken Solr installation :P
221: [15:46:38] <digitall-it> a missing class that was referenced in database ;)
222: [15:47:03] <digitall-it> ok still producing the use case..
223: [15:58:09] <digitall-it> ok I produced the use case, it didn't work (as expected) so I am now simplifying it.
224: [15:58:48] <digitall-it> I now produced a simpler use case, that should work almost right off the bat. I created an ElementList with an ElementImage into it.
225: [15:59:30] <digitall-it> as ElementImage extends BaseElement, and BaseElement has_one ElementList relationship called List, I tried calling $List from the ElementImage.ss and got an error
226: [15:59:38] <digitall-it> [04-Nov-2016 16:57:29] Warning at framework/view/GenericTemplateGlobalProvider.php line 48: Missing argument 1 for GenericTemplateGlobalProvider::getDataList() (http://dev.enersolar.it/nuova-pagina/) [04-Nov-2016 16:57:29] Error at framework/model/DataQuery.php line 142: DataList::create Can't find data classes (classes linked to tables) for . Please ensure you run dev/build after creating a new DataObject. (http://dev.ene
227: [15:59:52] <kinglozzer> Ah, $List is a protected name
228: [15:59:58] <digitall-it> ahahahah really?
229: [16:00:07] <digitall-it> ahahahah that is funny!!!
230: [16:00:08] <kinglozzer> Yes :P
231: [16:00:18] <kinglozzer> Only in template-land
232: [16:00:33] <kinglozzer> $List('MyDataObject') is equivalent to MyDataObject::get()
233: [16:01:00] <kinglozzer> digitall-it: If you apply an extension to BaseElement, you can add a method to do it
234: [16:01:13] <digitall-it> I already have that extension in place
235: [16:01:14] <kinglozzer> public function ElementList() { return $this->owner->List(); }
236: [16:01:19] <kinglozzer> Then use $ElementList in the template
237: [16:01:24] <digitall-it> and already have that function
238: [16:01:28] <digitall-it> also tried that
239: [16:01:34] <digitall-it> just a moment while I go on
240: [16:01:48] <digitall-it> I called it getParent()
241: [16:01:59] <digitall-it> is this protected?
242: [16:02:04] <digitall-it> getParentElement seems better
243: [16:02:16] <kinglozzer> Possibly... I'd name it something else just in case
244: [16:02:22] <kinglozzer> Yeah, try that :)
245: [16:02:44] <digitall-it> ok I think I've done that and solved the simplified use case
246: [16:03:00] <digitall-it> but then the more complex one failed, let me try to create the complete use case
247: [16:03:37] <digitall-it> That means, I could access the parent List from the Image object when called from getParentElement DataExtension,
248: [16:04:07] <digitall-it> but only if the ElementImage was inside an ElementList object
249: [16:04:13] <digitall-it> let me try again it will take a few minutes
250: [16:04:27] <kinglozzer> Okay :)
251: [16:08:26] <digitall-it> Ok I'm pretty sure that the this works if the image is inside the ElementList, just another few seconds...
252: [16:11:15] <digitall-it> Impressive, that worked! The strangest of the things is that I tried all of that. The missing piece is that as List is (doh!) a framework protected class name, I was changing more than one thing at a time.
253: [16:11:56] <digitall-it> So the Silverstripe ORM can traverse back and forth betweeen objects relationships even when you create extended objects.
254: [16:12:31] <kinglozzer> Yes, database fields and relations will be inherited
255: [16:12:50] <digitall-it> This actually solves my problem, but I discovered that one of the most popular modules, Shea Dawson's Blocks, is not working.
256: [16:13:17] <digitall-it> I don't know why it doesn't put an Add button in the page, he says he couldn't reproduce the problem.
257: [16:14:00] <digitall-it> I think it can be solved in a not difficult way, but I would like to contribute to his module by mimicking the Elemental functionality that makes the elements searchable
258: [16:14:22] <digitall-it> as the Silverstripe framework natively implements a Fulltext search for mysql,
259: [16:14:54] <digitall-it> Elemental simply makes a copy of all the element blocks inside of the $Content (as effectively it hides it from the view).
260: [16:15:07] <digitall-it> Shea Dawson's doesn't do that, and $Content is used.
261: [16:15:16] <digitall-it> So I can not overwrite the $Content variable
262: [16:15:34] <digitall-it> I would like to create a $SearchableContent variable and add an onBeforeWrite handler for that
263: [16:16:06] <digitall-it> can I add this field on the SearchableFields on the Page class in the searchable config of the Fulltext functionalty of Silverstripe?
264: [16:16:52] <digitall-it> I read the docs and the API, it wasn't sure if you could do that. I am pretty sure you can create new classes and tell which fields you would like to search into, but don't know if you can overwrite the base Page fields
265: [16:16:58] <digitall-it> let me point you to the API page
266: [16:19:21] <digitall-it> http://api.silverstripe.org/3.4/source-class-FulltextSearchable.html#30-69
267: [16:19:41] <kinglozzer> digitall-it: Yep, it's hardcoded to those fields
268: [16:19:49] <kinglozzer> But you can still do it if you do it manually
269: [16:20:07] <digitall-it> as you can see, the $defaultColumns are hardcoded.
270: [16:20:10] <kinglozzer> i.e. Config::inst()->update('MyClass', 'create_table_options'...) etc
271: [16:20:37] <digitall-it> ok I could extend FulltextSearchable
272: [16:20:47] <digitall-it> add a new function called EnableOverridePage
273: [16:20:55] <digitall-it> and rewrite this Enable function, right?
274: [16:20:58] <kinglozzer> digitall-it: No, you don't need to do that
275: [16:21:13] <samsam> damn it how do you use HTML in dataobject title? I thought it was Convert::raw2html('&nbsp;')
276: [16:21:26] <kinglozzer> All that FulltextSearchable::enable() does is adds some extensions. You just need to do it manually instead of calling FulltextSearchable::enable()
277: [16:22:05] <digitall-it> so, you mean by copying and pasting all the code in the Enable function in the Config.php?
278: [16:22:09] <digitall-it> then changing as needed?
279: [16:22:25] <kinglozzer> digitall-it: Not exactly, no. Do you have a config.yml?
280: [16:22:33] <digitall-it> yes
281: [16:22:38] <kinglozzer> 1 sec
282: [16:22:55] <digitall-it> ah I now start to understand
283: [16:22:57] <digitall-it> you can do a
284: [16:23:42] <digitall-it> Config::inst()->update('SiteTree', ....) in config.php
285: [16:24:18] <kinglozzer> digitall-it: Or in yaml: https://gist.github.com/kinglozzer/26877551d43ce94caf66634ec2fc82c2
286: [16:24:19] <digitall-it> SiteTree::add_extension("FulltextSearchable('BLAH BLAH');
287: [16:24:28] <kinglozzer> Yep, exactly
288: [16:24:44] <kinglozzer> Yaml is slightly more efficient, but either way should work :(
289: [16:24:45] <kinglozzer> :)*
290: [16:25:14] <kinglozzer> samsam: private static $casting = array('Title' => 'HTMLText');
291: [16:25:27] <digitall-it> I knew that but I tought that it wouldn't work on sitetree
292: [16:25:39] <digitall-it> I updated your gist with a question and an example
293: [16:26:00] <kinglozzer> digitall-it: Yes, that should still work fine
294: [16:26:13] <digitall-it> ok, that was my main concern.
295: [16:26:31] <digitall-it> that the SiteTree fields weren't configurable
296: [16:26:42] * NETim_ has joined #silverstripe
297: [16:26:55] <kinglozzer> samsam: Or if it's a method, you can do return DBField::create_field('HTMLText', '<h1>some html</h1>');
298: [16:27:17] <NETim_> Morning. Any pointers on removing the save button from a modeladmin editform?
299: [16:27:26] <kinglozzer> NETim_: canEdit? :D
300: [16:27:55] <NETim_> kinglozzer, unfortunately canEdit doesn't play nice with the gridfields in other tabs.
301: [16:28:17] <NETim_> If i set the canEdit to false, the grids are replaced with the DO title and '(none)'
302: [16:29:35] <kinglozzer> NETim_: https://gist.github.com/kinglozzer/d67de55b86b9cbd7bc39a669772cf1a9
303: [16:30:01] <samsam> kinglozzer: +1 for multitasking. I want to use it when returning the title for getTitle()
304: [16:30:20] <NETim_> Ok, that was quick.
305: [16:30:23] <kinglozzer> samsam: In the CMS?
306: [16:30:29] <NETim_> Expecially for this time on a friday...
307: [16:30:32] <samsam> Well, in the source code
308: [16:30:36] <samsam> in the CMS yes
309: [16:31:02] <kinglozzer> samsam: Hmm, I'm not 100% sure if it will be possible in the CMS :/
310: [16:31:09] <samsam> I see!
311: [16:31:11] <kinglozzer> Have you got a function getTitle() ?
312: [16:31:20] <samsam> one sec, i'll paste
313: [16:31:44] <kinglozzer> samsam: Have you tried static $casting yet?
314: [16:32:01] <kinglozzer> NETim_: I'm running entirely on caffeine :P
315: [16:32:20] <NETim_> Aren't most of us?
316: [16:33:23] <samsam> http://www.sspaste.com/paste/show/581cb84d3ae43
317: [16:33:58] <samsam> the whitespaces are printed on page, literally
318: [16:34:02] <samsam> need html whitespaces tho
319: [16:34:19] <kinglozzer> samsam: Have you tried private static $casting?
320: [16:34:21] <kinglozzer> Or return DBField::create_field('HTMLText', "this is a string" . str_repeat('&nbsp', 5) . "with 5 html whitespaces"); ?
321: [16:34:48] <samsam> haven't..
322: [16:35:02] <samsam> i'll try that second one now
323: [16:35:21] <samsam> DBField::create_field
324: [16:36:08] <samsam> doesnt owkr
325: [16:36:10] <kinglozzer> I think $casting is the "best" way to do it - docs recommend it: https://docs.silverstripe.org/en/3.4/developer_guides/templates/casting/#casting
326: [16:36:20] <samsam> cool, going to look into it, cheers
327: [16:37:38] <samsam> lol that's pretty hardcore to add some whitespaces
328: [16:37:49] <samsam> I like the feature though, haven't seen it before
329: [16:38:11] <kinglozzer> samsam: You won't be saying that when someone adds a title of <script>alert('hello');</script>
330: [16:38:13] <kinglozzer> ;0
331: [16:38:15] <kinglozzer> ;)
332: [16:39:02] <kinglozzer> That's why it's like that by default anyway - XSS protection
333: [16:39:18] <NETim_> Next question, how do i check the ID of the current record in getEditForm?
334: [16:39:19] <samsam> the day I let my client's access the source code is the day that WordPress announced CMS of the century
335: [16:40:01] <kinglozzer> NETim_: in getEditForm()? Or in the "edit form callback"?
336: [16:40:18] <NETim_> Either will do. There are some cases where I'll need to show the save button.
337: [16:40:29] <kinglozzer> The latter is $form->getRecord()->ID;
338: [16:42:33] <NETim_> Cheers. Been banging my head against that one for a while.
339: [16:42:58] * janneklouman-- quit (Ping timeout: 268 seconds)
340: [16:43:41] <NETim_> Just for my own reference, is there a way to get the related (has_many) objects to show if the parent canEdit is false?
341: [16:44:36] <kinglozzer> NETim_: I don't think so - https://github.com/silverstripe/silverstripe-framework/issues/3357
342: [16:47:29] <NETim_> hm... at least i haven't wasted the time I've spent working around it.
343: [17:00:10] * kinglozzer quit ()
344: [17:07:31] * samsam quit (Ping timeout: 260 seconds)
345: [17:09:00] * agent44 quit (Ping timeout: 244 seconds)
346: [17:13:28] * Kingy quit (Ping timeout: 252 seconds)
347: [17:13:54] * Kingy has joined #silverstripe
348: [17:19:10] * agent44 has joined #silverstripe
349: [17:28:32] <digitall-it> Thank you very much for the time spent together.
350: [17:28:48] <digitall-it> Have a nice evening (i don't know the time there).
351: [17:28:51] <digitall-it> goodbye.
352: [17:31:47] * NETim_ quit (Quit: Leaving)
353: [17:33:46] * digitall-it quit (Ping timeout: 260 seconds)
354: [18:02:40] * agent44 quit (Quit: zzz)
355: [18:19:05] * janneklouman-- has joined #silverstripe
356: [18:32:23] * Stomach has joined #silverstripe
357: [18:32:36] * Kolin quit (Read error: Connection reset by peer)
358: [18:44:30] * janneklouman-- quit (Ping timeout: 265 seconds)
359: [18:45:08] * janneklouman-- has joined #silverstripe
360: [18:55:25] * janneklouman-- quit (Ping timeout: 260 seconds)
361: [19:02:18] * Stomach quit (Quit: zzz)
362: [19:06:50] * janneklouman-- has joined #silverstripe
363: [19:11:45] * janneklouman-- quit (Ping timeout: 260 seconds)
364: [19:17:11] * DimiStripe quit (Quit: DimiStripe)
365: [20:38:16] * UndefinedOffset quit (Read error: Connection reset by peer)
366: [21:18:49] * micmania1 has joined #silverstripe
367: [21:36:38] * wmk quit (Quit: Leaving)
368: [21:51:05] * Stomach has joined #silverstripe
369: [22:29:24] * vitaly has joined #silverstripe
370: [22:31:57] * vitaly__ quit (Ping timeout: 260 seconds)
371: [23:00:02] * ss-helper quit (Remote host closed the connection)
372: [23:00:16] * ss-helper has joined #silverstripe
373: [23:13:09] * bubaphex has joined #silverstripe
374: [23:16:06] * micmania1 quit (Quit: micmania1)
375: [23:20:39] * bubaphex quit (Quit: bubaphex)
376: [23:32:58] * Stomach quit (Quit: zzz)
377: [23:38:56] * bubaphex has joined #silverstripe
378: [23:43:38] * bubaphex quit (Client Quit)

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