#silverstripe IRC Log

IRC log for 10 November 2016

All timestamps are in UTC.

1: [00:04:25] * muskie9 has joined #silverstripe
2: [00:07:48] * micmania1 quit (Quit: micmania1)
3: [00:18:31] * bubaphex has joined #silverstripe
4: [00:32:28] * pippy has joined #silverstripe
5: [00:32:33] * muskie9 quit (Quit: Textual IRC Client: www.textualapp.com)
6: [00:37:00] * spronk quit (Quit: I may need a longer sleep timer...)
7: [00:38:54] <zippy> command line deffo faster
8: [00:39:46] * bubaphex quit (Quit: bubaphex)
9: [00:41:06] <DanaeNZ> all hail command line
10: [00:43:55] * bubaphex has joined #silverstripe
11: [00:54:27] * bubaphex quit (Quit: bubaphex)
12: [00:55:56] <zippy> huzzaahh!
13: [01:05:30] * janneklouman-- has joined #silverstripe
14: [01:15:05] <ss-helper> How to log page generation time and number of MySQL queries for Silverstripe - http://stackoverflow.com/questions/40518549/how-to-log-page-generation-time-and-number-of-mysql-queries-for-silverstripe
15: [01:15:55] * janneklouman-- quit (Read error: Connection reset by peer)
16: [01:21:40] * janneklouman-- has joined #silverstripe
17: [01:26:24] * micmania1 has joined #silverstripe
18: [01:44:17] * zippy quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19: [01:45:10] * pweh has joined #silverstripe
20: [01:45:30] * janneklouman-- quit (Ping timeout: 246 seconds)
21: [01:50:57] * helenclarko has joined #silverstripe
22: [01:57:51] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23: [02:07:54] * bubaphex has joined #silverstripe
24: [02:10:25] * janneklouman-- has joined #silverstripe
25: [02:10:31] * bubaphex quit (Client Quit)
26: [02:10:52] * bubaphex has joined #silverstripe
27: [02:27:40] * UncleCheese has joined #silverstripe
28: [02:30:54] * zippy has joined #silverstripe
29: [02:39:51] * Hailwood has joined #silverstripe
30: [02:39:56] <Hailwood> Hey folks
31: [02:41:36] <Hailwood> Has anyone here worked with the campaign monitor API?
32: [02:42:22] * bubaphex quit (Quit: bubaphex)
33: [02:43:16] <zippy> yea just used that php package, only to add people and move people on mailing lists.
34: [02:44:34] * janneklouman-- quit (Read error: Connection reset by peer)
35: [02:47:42] * irogue has joined #silverstripe
36: [02:53:19] <Hailwood> zippy: Hmm I'm wanting to bulk update/add people which there seems to be the function, but I can't find anything about updating the email addresses in bulk
37: [02:53:51] <Hailwood> New question also - can you use filter to say where column a = column b (and also the reverse - where column a != column b)
38: [02:54:06] <zippy> where
39: [02:54:08] <zippy> *sure
40: [02:54:25] <zippy> $foo = Foo::get()->where('"Column1" <> "Column2");
41: [02:54:43] <zippy> be careful with the WHERE because that wont be sql escaped
42: [02:55:12] <zippy> so $foo = Foo::get()->where('"Column1" <> ' . $someUserContent);
43: [02:55:14] <zippy> is very bad
44: [02:56:37] * bubaphex has joined #silverstripe
45: [03:02:41] * bubaphex quit (Quit: bubaphex)
46: [03:06:52] * janneklouman-- has joined #silverstripe
47: [03:13:29] * micmania1 quit (Quit: micmania1)
48: [03:21:00] * micmania1 has joined #silverstripe
49: [03:21:08] * bubaphex has joined #silverstripe
50: [03:33:36] * bubaphex quit (Quit: bubaphex)
51: [03:36:11] <Hailwood> How rude of me! Thanks zippy
52: [03:37:48] * bubaphex has joined #silverstripe
53: [03:39:13] * zippy quit (Ping timeout: 245 seconds)
54: [03:42:07] * bubaphex quit (Client Quit)
55: [03:42:25] * bubaphex has joined #silverstripe
56: [03:45:31] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
57: [03:48:08] * bubaphex quit (Quit: bubaphex)
58: [03:52:46] * bubaphex has joined #silverstripe
59: [04:00:26] * bubaphex quit (Quit: bubaphex)
60: [04:00:57] * bubaphex has joined #silverstripe
61: [04:02:58] * micmania1 quit (Quit: micmania1)
62: [04:14:37] * janneklouman-- quit (Read error: Connection reset by peer)
63: [04:18:37] * bubaphex quit (Quit: bubaphex)
64: [04:18:57] * bubaphex has joined #silverstripe
65: [04:25:50] * janneklouman-- has joined #silverstripe
66: [04:27:19] * bubaphex quit (Quit: bubaphex)
67: [04:32:31] * DanaeNZ quit (Remote host closed the connection)
68: [04:33:04] * DanaeNZ has joined #silverstripe
69: [04:37:28] * DanaeNZ quit (Ping timeout: 244 seconds)
70: [04:39:01] * irogue quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
71: [04:42:03] <Hailwood> Anyone know of a good package for outputting nicely to either the browser or the CLI?
72: [04:49:07] * adrexia quit (Quit: My Mac has gone to sleep. ZZZzzz…)
73: [04:53:51] * Quatrepee quit (Quit: leaving)
74: [05:19:21] * helenclarko quit (Read error: Connection reset by peer)
75: [05:44:55] * janneklouman-- quit (Read error: Connection reset by peer)
76: [06:07:09] * janneklouman-- has joined #silverstripe
77: [06:16:08] * pweh quit (Ping timeout: 260 seconds)
78: [06:42:46] * wmk has joined #silverstripe
79: [06:57:09] * wmk_ has joined #silverstripe
80: [06:58:21] * wmk_ quit (Read error: Connection reset by peer)
81: [07:00:20] * wmk_ has joined #silverstripe
82: [07:00:57] * wmk quit (Ping timeout: 268 seconds)
83: [07:04:40] * wmk_ is now known as wmk
84: [07:08:11] * irogue has joined #silverstripe
85: [07:14:05] * micmania1 has joined #silverstripe
86: [07:14:51] * janneklouman-- quit (Read error: Connection reset by peer)
87: [07:25:44] * pweh has joined #silverstripe
88: [07:26:07] * janneklouman-- has joined #silverstripe
89: [07:48:38] * wmk quit (Ping timeout: 256 seconds)
90: [07:52:58] * irogue quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
91: [07:54:03] * wmk has joined #silverstripe
92: [07:56:13] * micmania1 quit (Quit: micmania1)
93: [08:03:14] * micmania1 has joined #silverstripe
94: [08:08:15] * irogue has joined #silverstripe
95: [08:12:46] * irogue quit (Client Quit)
96: [08:17:02] * UncleCheese has joined #silverstripe
97: [08:18:12] * Mike123 has joined #silverstripe
98: [08:18:19] <Mike123> Hey
99: [08:20:05] * micmania1 quit (Quit: micmania1)
100: [08:27:35] <wmk> sspak is so cool...
101: [08:34:26] * DanaeNZ has joined #silverstripe
102: [08:37:08] * lerni has joined #silverstripe
103: [08:39:01] * DanaeNZ quit (Ping timeout: 260 seconds)
104: [08:45:01] * janneklouman-- quit (Read error: Connection reset by peer)
105: [08:45:13] <ss-helper> Authenticate Silverstripe users using Core PHP - http://stackoverflow.com/questions/40523122/authenticate-silverstripe-users-using-core-php
106: [08:49:13] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
107: [09:02:14] * janneklouman-- has joined #silverstripe
108: [09:04:12] * Hailwood quit (Quit: Konversation terminated!)
109: [09:07:54] * kinglozzer has joined #silverstripe
110: [09:40:26] * Mike123 quit (Ping timeout: 260 seconds)
111: [09:41:16] * UncleCheese has joined #silverstripe
112: [09:41:42] * Mike123 has joined #silverstripe
113: [09:45:35] * lerni quit (Read error: Connection reset by peer)
114: [09:46:10] * lerni has joined #silverstripe
115: [10:15:20] * janneklouman-- quit (Read error: Connection reset by peer)
116: [10:21:07] * janneklouman-- has joined #silverstripe
117: [11:32:41] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
118: [11:38:08] * janneklouman-- quit (Ping timeout: 260 seconds)
119: [11:39:35] * rista has joined #silverstripe
120: [11:42:12] <rista> Hi guys. I need a little help about model admin. How can I redirect to the specific item when user click on it? Since I have only one dataobject item (and will always be like that) and I would like to skip grid field, but rather open that item right away.
121: [11:46:06] <wmk> well, you can generate the link yourself in a method in the DO, e.g. like public function adminLink() { return '/path/to/' . $this->ID; }
122: [11:46:21] <wmk> as you see the object's ID is in the URL, the rest is the same rista
123: [11:49:02] <rista> yes, url is the same except the ID, but where should I set (or call) this method, where the redirection occures?
124: [11:49:26] <rista> since in model admin you have a static property - url
125: [11:49:32] <rista> and it will always go there
126: [11:49:40] <rista> but I need it to go to a specific item instead
127: [12:02:23] * r5v3rb has joined #silverstripe
128: [12:02:29] <r5v3rb> afternoon
129: [12:03:48] <r5v3rb> got a weird one with an if else_if going on here - two versions both seem to require a second <% end_if %> before the end_loop %> but I can’t see the wood for the trees as to where the second end_if is being opened
130: [12:03:50] <r5v3rb> http://hastebin.com/nenatolama.bash
131: [12:03:53] <wmk> rista, from where do you want to go to a specific item?
132: [12:04:00] <wmk> r5v3rb, ☺/
133: [12:04:05] <r5v3rb> wmk ;)
134: [12:04:33] <wmk> r5v3rb, upgraded to v5?
135: [12:04:42] <r5v3rb> it’s me - lost my password for NickServ and don’t have the email address to restore :P
136: [12:04:56] <r5v3rb> so I jumped a couple of revisions
137: [12:05:25] <wmk> don't you have phpstorm with ss template highlighting?
138: [12:06:05] <r5v3rb> wmk, i do and it’s telling me i need that second end_if
139: [12:06:17] <r5v3rb> but I don’t see where its being opened
140: [12:06:27] <wmk> and does it work without the second end_if?
141: [12:07:05] <r5v3rb> nope
142: [12:07:30] <wmk> does a second else_if need another end_if ?? I try to avoid that in my templates
143: [12:07:45] <r5v3rb> yeh, maybe
144: [12:08:36] <wmk> r5v3rb, if you scroll right, you see some other ifs... try to reformat your code. It's CTRL-ALT-L on a windows machine
145: [12:08:58] <r5v3rb> done that they are all closed afaik
146: [12:11:27] <wmk> you can copy that code to a "scratch file" (tools menu) and eleminate some if-end-ifs
147: [12:11:44] <wmk> done that and i see a double <% if $required == 'true' %>
148: [12:12:02] <wmk> guess that's the error
149: [12:12:20] * janneklouman-- has joined #silverstripe
150: [12:12:34] <wmk> also in the <input> and <textarea>... I'd use one if/end_if per line for better readability
151: [12:21:09] <r5v3rb> wmk, lemme see! I have changed to single if/end-fi for now too
152: [12:22:04] <wmk> end-fi? wow, sounds like a high quality stere
153: [12:22:05] <wmk> o
154: [12:22:11] <r5v3rb> damn it where did that open require come from!
155: [12:22:34] * r5v3rb can’t see wood for the trees atm
156: [12:22:38] <r5v3rb> thenks wmk
157: [12:22:43] <r5v3rb> thanks* wmk
158: [12:23:08] <wmk> ;)
159: [12:23:26] <wmk> i guess today is the day where i think, some 80 chars per line are enough...
160: [12:26:23] <rista> wmk, I want to go to a specific item from the model admin (menu item) in the CMS
161: [12:26:47] <wmk> in that left menu?
162: [12:27:06] <kinglozzer> r5v3rb: Had a horrible day out down your way the other week ;)
163: [12:27:22] <r5v3rb> where were you kinglozzer ?
164: [12:27:29] <kinglozzer> Brighton
165: [12:27:31] <cloph> could also simplify that logic a bit by moving the <error> line outside the if, no need to duplicate that in all the ifs. (and potentially also the placeholder...)
166: [12:28:02] <r5v3rb> cloph: yeh, but I only like to render what’s required literally ;)
167: [12:28:15] <rista> wmk, yes in that left menu
168: [12:28:40] <wmk> do you only have ONE item of that stuff?
169: [12:28:48] <cloph> it would still only be rendered <% if $required... %> - just instead of having it twice in the template, you'd only have it once (and you didn't make that image one all-so-special :-)
170: [12:28:49] <rista> yes
171: [12:29:05] <rista> and will stay like this, always one item
172: [12:29:19] <wmk> rista, i see...
173: [12:29:24] <r5v3rb> kinglozzer: I’m not surprised - I don’t go there unless 110% required
174: [12:29:24] <kinglozzer> So not quite where you are r5v3rb :P dunno if you follow football/Brighton?
175: [12:29:31] <rista> only it have a bunch of relations and it's own properties
176: [12:29:50] <r5v3rb> kinglozzer: I know the ground - drive past it enough going to visit parents
177: [12:29:54] <wmk> then modeladmin isn't the best fit, but we could hack a bit
178: [12:29:59] <r5v3rb> did the canaries get beat?
179: [12:30:08] <wmk> rista, it's a DO or a page?
180: [12:30:10] <kinglozzer> r5v3rb: It's okay, I got off the coach, watched Norwich lose 5 - 0, then got back on the coach and went home
181: [12:30:16] <kinglozzer> So I didn't see much of it :P
182: [12:30:16] <rista> DO
183: [12:30:17] <r5v3rb> lol
184: [12:30:41] <kinglozzer> Some nice hills
185: [12:30:44] <r5v3rb> kinglozzer: a day parking in brighton could set you back upwards of £80 in the mall!
186: [12:30:49] <kinglozzer> (we don't have hills in Norfolk)
187: [12:30:54] <r5v3rb> this is try
188: [12:30:58] <kinglozzer> Good job I took the coach then!
189: [12:31:02] <r5v3rb> but you have lovely waterways
190: [12:31:38] <r5v3rb> and bewilderwood
191: [12:32:01] <kinglozzer> Haha, yeah... and pleasurewood hills
192: [12:32:41] * pweh quit (Read error: Connection reset by peer)
193: [12:32:45] <r5v3rb> never been there
194: [12:32:46] <wmk> rista, quite hard...
195: [12:32:58] <wmk> You could try to overwrite your ModelAdmin's init and redirect if needed
196: [12:33:15] <wmk> or you could try to inject a menu item on the left with a LeftAndMain extension
197: [12:33:41] * Mike123 quit (Ping timeout: 260 seconds)
198: [12:33:48] <wmk> or you could try something more sophisticated like https://github.com/littlegiant/silverstripe-singlepageadmin is for pages
199: [12:33:50] <r5v3rb> Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooook! Affinity Photo Win Beta! Today! No More CS
200: [12:34:06] <r5v3rb> alraedy have for Mac now I can ditch CS subscription!
201: [12:35:29] <r5v3rb> lmao, and adobe send me a ‘have an extra trail extension’ on those apps you’re not using email at the same time - worried much?
202: [12:35:30] <wmk> r5v3rb, as a replacement for LR or PS?
203: [12:36:27] <r5v3rb> PS
204: [12:36:32] <r5v3rb> wmk ^^
205: [12:37:08] <r5v3rb> wmk: they have an indesign page make up option coming out early next year too
206: [12:38:19] <wmk> so i can open that indesign stuff on my pc...?
207: [12:38:58] <r5v3rb> possibly when that software gets released
208: [12:39:02] <r5v3rb> who knows atm
209: [12:39:21] <wmk> ;)
210: [12:39:27] <r5v3rb> wmk, take a look at affinity designer and photo videos ;)
211: [12:39:28] <wmk> but i'll have an eye on it
212: [12:39:34] <r5v3rb> only £39
213: [12:39:43] <r5v3rb> foreveeeeeeeer
214: [12:42:38] <r5v3rb> wmk >> made with designer https://pbs.twimg.com/media/Cwp_W1cW8AEjfjF.jpg:large
215: [12:44:50] <wmk> can you stich a panorama with raw images?
216: [12:45:12] <wmk> LR can, that's a great feature for us
217: [12:46:49] <r5v3rb> not sure
218: [13:05:59] * DanaeNZ has joined #silverstripe
219: [13:12:00] <slievr> that Affinity Photo looks really cool
220: [13:18:41] <slievr> Happen to know if I bought it for mac if I'd have to buy it again for windows, or is a shared license?
221: [13:20:55] * UndefinedOffset has joined #silverstripe
222: [14:43:07] * cupcake has joined #silverstripe
223: [15:15:24] <ss-helper> SilverStripe 3.5.0-rc2 Release Announcement - https://groups.google.com/d/msg/silverstripe-announce/eiHmVmXGQrk/ausDUhCFBQAJ
224: [15:22:56] * muskie9 has joined #silverstripe
225: [15:35:20] * DanaeNZ quit (Ping timeout: 252 seconds)
226: [16:03:37] * muskie9 quit (Ping timeout: 265 seconds)
227: [16:37:31] * rista quit (Ping timeout: 260 seconds)
228: [16:38:23] * lerni quit ()
229: [17:10:11] * cupcake quit (Ping timeout: 260 seconds)
230: [17:39:13] * kinglozzer quit ()
231: [18:27:13] <wmk> that's the way it is, isn't it? https://twitter.com/iamdevloper/status/796781099540103168
232: [19:32:07] * bubaphex has joined #silverstripe
233: [19:32:25] * DanaeNZ has joined #silverstripe
234: [19:36:43] * DanaeNZ quit (Ping timeout: 245 seconds)
235: [19:57:47] * r5v3rb quit (Quit: r5v3rb)
236: [20:02:09] * micmania1 has joined #silverstripe
237: [20:02:17] * DanaeNZ has joined #silverstripe
238: [20:02:56] * digitall_it has joined #silverstripe
239: [20:03:09] <digitall_it> Greetings to everyoe.
240: [20:03:23] <digitall_it> first sentence, first typo. So far, 50% hit rate.
241: [20:04:27] * micmania1 quit (Client Quit)
242: [20:09:53] * neomang quit (Quit: Page closed)
243: [20:11:56] * neomang has joined #silverstripe
244: [20:12:36] <pippy> are we gonna see traits replacing extensions in SS4?
245: [20:17:38] <digitall_it> as PHP 5.3 is likely to not be supported anymore,
246: [20:17:43] <digitall_it> by SS4,
247: [20:18:35] <digitall_it> I hope so
248: [20:19:23] * Admonish has joined #silverstripe
249: [20:20:44] <Admonish> Hey there everyone. I was wondering if anyone here knows how to delete file relationships and the files themselfs when the related object is deleted?
250: [20:21:05] <digitall_it> have you ever tried this module?
251: [20:21:34] <digitall_it> it’s called...
252: [20:21:36] <digitall_it> (let me check)
253: [20:21:45] <digitall_it> oddnoc/silverstripe-artefactcleaner
254: [20:22:01] <neomang> I was looking at the subsites module some more and it says you can add a domain or subdomain for the subsite. I was wondering if anyone was aware if i could for example www.site.com/foo/ as the domain rather than foo.site.com?
255: [20:22:18] <digitall_it> @Admonish ah you look to delete the files themselves
256: [20:22:18] <neomang> I know i can clean this up with htaccess but i wonder if I even need to
257: [20:22:41] <digitall_it> files in the cms remain in the assets folder
258: [20:23:18] <digitall_it> they do not get unlinked I think when the objects that access them get deleted
259: [20:23:45] <digitall_it> if you delete them “by hand” you will have to issue an asset sync
260: [20:24:18] <Admonish> digitall_it: Thank you for your quick response. So are you saying that even if I delete the file dataobject for the particulaur file, the file itself remains in the filesystem?
261: [20:24:43] <digitall_it> yes, the entire “Assets” folder in silverstripe is the actual assets folder on the hard disk
262: [20:25:08] <digitall_it> you can even add or delete files and issue a Sync from the interface, and the database will sync with that folder
263: [20:25:18] <digitall_it> simply try to upload a file via an object and delete that object
264: [20:25:23] <digitall_it> the file will remain in the archive
265: [20:25:39] <digitall_it> you will find it on the hard disk in the /assets folder and in the assets admin area
266: [20:26:25] <Admonish> Do you think it would be possible for me to extend the File dataobject (via onAfterDelete) to completely remove the file in the assets folder when the file object is deleted?
267: [20:26:36] <digitall_it> sure, why note?
268: [20:27:02] <digitall_it> as you know, you cannot directly access the objects of the cms, your code would be deleted on framework upgrade
269: [20:27:13] <digitall_it> but there’s a clever way to do it via DataExtensions
270: [20:27:22] <Admonish> Right\
271: [20:27:28] * bubaphex quit (Quit: bubaphex)
272: [20:27:29] <Admonish> That makes sense
273: [20:27:36] <digitall_it> open you yaml config
274: [20:27:42] <digitall_it> write the name of the class you want to extend
275: [20:28:12] <digitall_it> then as a child write “extensions:” and then, as a child write a slash and a name for you dataextensions
276: [20:28:14] <digitall_it> like this:
277: [20:28:25] <digitall_it> Page:
278: [20:28:25] <digitall_it> extensions:
279: [20:28:26] <digitall_it> - ElementPageExtension
280: [20:29:02] <Admonish> Ahh yes, thank you very much for your help
281: [20:29:19] <digitall_it> (the example is a little unhappy because Page is usually a class you can edit yourself because it is the standard extension that comes with SS)
282: [20:29:30] <digitall_it> when you put the config in the yaml file
283: [20:29:33] <digitall_it> you have to create the class
284: [20:29:35] <digitall_it> like this:
285: [20:29:59] <digitall_it> class ElementImageExtension extends DataExtension {}
286: [20:30:15] <Admonish> After I eat some lunch I will try to use the information I have gleaned here to accomplish my goal.
287: [20:30:27] <Admonish> I will report back my findings
288: [20:30:44] <digitall_it> so you write the original class, under that the keyword extensions: under that the name of the dataextension class
289: [20:31:01] <digitall_it> create the dataextension class in your mysite folder, it extends the DataExtension
290: [20:31:17] <digitall_it> you have to note that if you want to access the “parent” class
291: [20:31:23] <digitall_it> you have to use $this->owner
292: [20:31:49] <digitall_it> it is the way DataExtensions work, and it is easily to forget
293: [20:32:22] <Admonish> I will do my best to remeber that :D
294: [20:32:31] <Admonish> remember*
295: [20:33:00] <digitall_it> if you want to get more informations, there’s a video tutorial for that
296: [20:33:11] <digitall_it> let me fetch the url for you
297: [20:33:12] <digitall_it> https://www.silverstripe.org/learn/lessons/data-extensions-and-siteconfig?ref=hub
298: [20:33:48] <Admonish> Thank you very much
299: [20:34:07] <digitall_it> also read the docs here
300: [20:34:07] <digitall_it> https://docs.silverstripe.org/en/3.4/developer_guides/extending/extensions/
301: [20:35:20] <digitall_it> remember that simply deleting the file will not be sufficient
302: [20:36:01] <digitall_it> because the cms will not “know” that and the file table will continue to have a row with the now defunct file
303: [20:36:20] <digitall_it> I’m pretty sure you can delete the file by using the assets API
304: [20:36:26] <digitall_it> that is better in my opinion
305: [20:36:32] <digitall_it> also, more safe
306: [20:36:49] <digitall_it> it internally does more checkups like paths
307: [20:36:58] <digitall_it> aliases and so on
308: [20:40:04] <digitall_it> !flush Admonish
309: [20:40:05] <ss-helper> Admonish: Have you flushed? Try doing a ?flush=all and /dev/build then see if it's sorted. Do it twice for good measure ;-)
310: [20:40:34] <digitall_it> always remember to flush or your caches will stink
311: [20:41:08] <digitall_it> (hey, that’s a good magnet to put on your desk!)
312: [20:41:57] <Admonish> Well I definitly want to accomplish this in the best way possible. Also is flush=1 the same as flush=all ?
313: [20:42:06] <digitall_it> yes
314: [20:42:17] <Admonish> ok then I flush quite a bit
315: [20:42:24] <digitall_it> do you know you can actually dev/build and flush from the command line?
316: [20:42:33] <Admonish> yepper :D
317: [20:42:39] <Admonish> I use it a bit
318: [20:42:49] <Admonish> quite a neat feature for a CMS
319: [20:43:18] <Admonish> Most other CMS's dont have CLI's build in
320: [20:43:41] <digitall_it> good CMF have them but do not have admin CMSes
321: [20:44:01] <digitall_it> it would be nice to have a scaffolding task, like Symfony
322: [20:44:31] <digitall_it> Symfony CLI can ask you questions and generate code
323: [20:44:36] <digitall_it> ready for you to extend
324: [20:44:50] <Admonish> that would be nice
325: [20:45:00] <digitall_it> scaffold dataextension
326: [20:45:09] * lerni has joined #silverstripe
327: [20:45:11] <Admonish> I use symfony for CLI creation as well
328: [20:46:11] <digitall_it> Symfony 2.x CLI is so much powerful than 1.x, you can actually create full command line apps with it
329: [20:46:47] <digitall_it> but the framework got burdersome and I hate they expelled the admin generator from the core
330: [20:46:59] <digitall_it> also, the Symfony admin generators produce too much “magic”
331: [20:47:16] <digitall_it> that is, code you can’t see because it is created at runtime
332: [20:47:29] * wmk quit (Read error: Connection reset by peer)
333: [20:49:17] <digitall_it> is this code right in the News() function?
334: [20:49:18] <digitall_it> http://www.sspaste.com/paste/show/5824dd3b6de28
335: [20:49:30] * micmania1 has joined #silverstripe
336: [20:50:00] <digitall_it> it should get last by date NewsPage object if Newscontent is 0, second last if 1 and third last if 2
337: [20:50:59] <neomang> I was looking at the subsites module some more and it says you can add a domain or subdomain for the subsite. I was wondering if anyone was aware if i could for example www.site.com/foo/ as the domain rather than foo.site.com?
338: [20:51:18] <neomang> *could use
339: [20:51:35] <digitall_it> @neomang let me check
340: [20:52:33] <neomang> thanks :D
341: [20:52:46] <digitall_it> the explanation here made me think no:
342: [20:52:49] <digitall_it> “Once you've created a subsite, you'll see a "Create Subsite Domain" button, hit that button to enter a domain or subdomain for your subsite. This will determine the URL of your website. For example, if your site is running on http://localhost/mysite, and you set the subdomain to "subsite", then your subsite will be accessible on http://subsite.localhost/mysite”
343: [20:53:18] <digitall_it> as subsites are purely cosmetic,
344: [20:53:45] <digitall_it> have you considered adding a theme to the page and have it inherit from parent if not set?
345: [20:54:30] <digitall_it> that is, you create another theme and set the preferred pages with a ‘theme’ dropdown in the cms
346: [20:54:53] <digitall_it> you could set code that inherit the parent page theme if the dropdown is not set
347: [20:54:58] <digitall_it> I made that with an header image
348: [20:54:59] * bubaphex has joined #silverstripe
349: [20:55:29] <neomang> The issue is I'm trying to separate dataobjects in the CMS and subsites is great for that
350: [20:55:36] <digitall_it> uhm,
351: [20:55:44] <neomang> like, they'll still be accessible, but their modeladmin tab wont appear
352: [20:56:08] <digitall_it> so it is a security measure
353: [20:56:13] <neomang> so if you're on site A you can't get to the tab to make a dataobject that's only really used by site B
354: [20:56:15] <digitall_it> or, like an accessibility feature
355: [20:56:17] <neomang> yeah
356: [20:56:21] <neomang> accessibility
357: [20:56:23] <neomang> removes clutter
358: [20:56:32] <neomang> the theme switcher is just a bonus
359: [20:56:59] <neomang> i just needed to know if I needed the subdomains as we have to request them from ITS so
360: [20:57:07] <digitall_it> I think you could control the modeladmin tabs from the pages just the same way
361: [20:57:17] <digitall_it> or, better than that
362: [20:57:20] * bubaphex quit (Client Quit)
363: [20:57:52] <digitall_it> make the modeladmin aware of the page in the tree you are editing
364: [20:57:57] <digitall_it> so it disables the interface
365: [20:58:09] <digitall_it> it could be something as simple as adding a css class to the tab
366: [20:58:38] * bubaphex has joined #silverstripe
367: [20:58:42] <neomang> wouldn't that be essentially the same as what the module currently does though?
368: [20:59:14] <digitall_it> I think what you are trying to accomplish is a little more than what the module does. Let me check
369: [20:59:31] <lerni> digitall_it: hi o/
370: [20:59:42] <neomang> alright, thanks
371: [20:59:56] * digitall_it lerni hi lerni! \o/
372: [21:00:52] <digitall_it> “All separation of content achieved with this module should be viewed as cosmetic and not appropriate for security-critical applications”. I did not try this module myself, but I think it will not do what you want.
373: [21:01:14] * bubaphex quit (Client Quit)
374: [21:01:16] <neomang> I mean I only really need it to be cosmetic
375: [21:01:27] <neomang> The 2 primary users will both be admins
376: [21:01:38] <neomang> and the other security stuff will be handled by groups and roles
377: [21:02:10] <digitall_it> yes I understand it is an accessibility feature, but I don’t know if there’s the interface to say hey show these modeladmins on this subsite only
378: [21:02:49] <digitall_it> also, if your subsite would be www.site.com/foo/ all the urls should start from there,
379: [21:03:10] <digitall_it> it is not really a new sitetree
380: [21:03:25] <digitall_it> the homepage would have to start from /foo
381: [21:03:54] <neomang> well the plan was to have one start from www.site.com and one to start from www.site.com/foo/
382: [21:04:07] <digitall_it> yes but as you create subpages,
383: [21:04:20] <digitall_it> the subpages on subsite B would be
384: [21:04:58] <digitall_it> it should be something a little difficult to obtain
385: [21:05:23] <digitall_it> ops sorry the chat deleted part of the paths
386: [21:05:37] <neomang> well, I'll just look into the idea of making modeladmin site tree aware
387: [21:05:40] <digitall_it> the subpages on subsite B would be / foo / bar , / foo / goofy
388: [21:05:50] <neomang> but that's sort of exactly what I wanted
389: [21:06:04] <digitall_it> yes but don’t think the module will do that
390: [21:06:09] <neomang> ah
391: [21:06:16] <digitall_it> it would have been in the docs because it would need more code
392: [21:06:25] <digitall_it> to not start subsites from root and
393: [21:06:33] <digitall_it> contemporary to have subsites on the same sitetree
394: [21:07:04] <digitall_it> I think it is better this way, more cleaner to persue the awareness of modeladmins
395: [21:07:26] <digitall_it> of the editing position in the tree
396: [21:07:52] <digitall_it> It could be as simply as removing the modeladmin init from the config
397: [21:07:59] <digitall_it> and adding it in the pages
398: [21:08:40] <digitall_it> or via
399: [21:08:43] <neomang> what would I do to achieve this? Im mainly concerned because I have multiple subpages off a single page
400: [21:08:45] <digitall_it> CMSMenu::remove_menu_item(‘your model admin’);
401: [21:09:22] <neomang> so that would go in getCMSFields?
402: [21:09:25] <digitall_it> no
403: [21:09:25] <neomang> or in init?
404: [21:09:26] <digitall_it> in the init
405: [21:09:29] <neomang> ok
406: [21:09:40] <digitall_it> try to add it to the Page,
407: [21:09:43] <digitall_it> make it work
408: [21:09:44] <digitall_it> then
409: [21:09:49] <digitall_it> add the code to check
410: [21:10:02] <digitall_it> what page are you editing and disable it
411: [21:12:52] <digitall_it> also, while you’re doing that, you can in a LeftAndMainExtension add a link to your help site
412: [21:13:09] <digitall_it> I’ve done that
413: [21:13:10] <digitall_it> CMSMenu::add_link("LinkToSupport", "Supporto", "https://digitall.it", -2, array('target' => '_blank'));
414: [21:14:01] <neomang> help site?
415: [21:14:21] <digitall_it> if you have an help page with all your contacts
416: [21:14:28] <digitall_it> for your admins to access
417: [21:14:32] <digitall_it> with a FAQ
418: [21:14:37] <neomang> oh, we don't really have that at the moment
419: [21:14:38] <digitall_it> a ticket system
420: [21:14:41] <neomang> we're still in dev
421: [21:14:52] <digitall_it> are you a design agency?
422: [21:14:52] * gelignite has joined #silverstripe
423: [21:14:54] <neomang> and it's really just a 2 person crew running it
424: [21:14:55] <neomang> no
425: [21:15:22] <digitall_it> ok so a page of the site not in the menu with all your contacts, it’s an example
426: [21:15:28] <digitall_it> it’s fun!
427: [21:15:48] * UncleCheese has joined #silverstripe
428: [21:16:23] <digitall_it> the docs for the ability to check if your page is in a particular url section are there
429: [21:16:23] <digitall_it> http://api.silverstripe.org/3.0/source-class-SiteTree.html#579-589
430: [21:16:46] <digitall_it> actually, the latest docs are there: http://api.silverstripe.org/3.4/source-class-SiteTree.html#579-589
431: [21:17:37] <neomang> so wait, this doesn't go in the page init?
432: [21:17:45] <neomang> it goes in leftandmain?
433: [21:17:50] <neomang> im a bit confused as to that
434: [21:17:52] * UndefinedOffset quit (Quit: Leaving.)
435: [21:17:58] <digitall_it> ok let me explain
436: [21:18:00] <neomang> or should it be a dataextension
437: [21:18:32] <digitall_it> as you want the CMSMenu::remove_menu_item command to be executed as the page gets edited,
438: [21:19:08] <digitall_it> I think it needs to be in an unusual location.
439: [21:19:22] <digitall_it> I previously stated the page init, but maybe I was wrong, the getcmsfields maybe could be right
440: [21:21:06] <digitall_it> remove_menu_item could be called by anywhere because it is static, but you can access $this from the getcmsfields function as you are in the page scope
441: [21:21:26] <digitall_it> and check if $this->inSection
442: [21:22:44] <neomang> right
443: [21:22:50] <neomang> okay
444: [21:23:20] <digitall_it> and apply your custom logic per section
445: [21:23:46] <neomang> and then the (‘your model admin’) would be the class name
446: [21:23:52] <digitall_it> yes,
447: [21:24:04] <digitall_it> my only doubt if that gecmsfields is called too late in the process and
448: [21:24:20] <digitall_it> the list of cmsmenu buttons has already been rendered
449: [21:24:34] <digitall_it> let me check this out if it works!
450: [21:24:42] <neomang> it doesn't seem to work for me
451: [21:24:58] <neomang> but i could be making a mistake if it works for you
452: [21:25:56] <digitall_it> I tried addming in the getCMSFields a line: CMSMenu::remove_menu_item('ReportAdmin');
453: [21:26:18] <digitall_it> but it didn’t get removed, I think it is because when the function gets called, it is very late in page generation
454: [21:26:46] <digitall_it> you have to do it in a modeladmin
455: [21:26:53] <digitall_it> ops
456: [21:26:57] <digitall_it> a LeftAndMainExtension
457: [21:27:19] <digitall_it> there you should try to access the page that gets modified
458: [21:27:44] <digitall_it> try to hide the reportadmin to start out
459: [21:27:50] <digitall_it> as I did, this will surely work
460: [21:27:51] <Admonish> digitall_it: I was doing some more research into deleting files and I descovered that you were right about an asset api method of deleting files.
461: [21:27:55] <digitall_it> then try with yours
462: [21:28:12] <digitall_it> @Admonish nice, how’s the function called?
463: [21:28:22] <Admonish> digitall_it: This was written in the api docs -> Caution: Calling DataObject::delete() will also delete from the filesystem. Call File::deleteDatabaseOnly() if you want to avoid this.
464: [21:28:42] <Admonish> So it would be through the delete() method
465: [21:29:35] <Admonish> I tried this but sometimes it errors out
466: [21:29:43] <digitall_it> @yes, the row is a bit confusing, it leads to understand you could delete in a swipe all your linked files to your page/dataobject. indeed it refers to the class that extends from File, like Image
467: [21:30:02] <digitall_it> before doing anything, sync your assets folder
468: [21:30:09] <Admonish> k
469: [21:30:21] <digitall_it> so you’re sure that your db is synced with your actual file tree
470: [21:30:33] <digitall_it> then, try to put a @ before the command
471: [21:30:57] * UndefinedOffset has joined #silverstripe
472: [21:31:12] <digitall_it> almost everytime a file gets deleted, there’s the non zero possibilty the file is not there anymore
473: [21:31:21] <digitall_it> so you silence that with the @
474: [21:31:28] <digitall_it> before issuing your delete
475: [21:31:33] <digitall_it> I know, it is scary.
476: [21:32:07] <digitall_it> but as you are using the API, it is not your full concern to check if the filesystem gets treated fine.
477: [21:33:18] <digitall_it> this wonderful night is thunderstorm-free.
478: [21:33:59] <Admonish> digitall_it: Here is my dataobject code (at least the part of it thats relavent. Cant post it all due to NDA) http://pastebin.com/1teBStaU
479: [21:35:08] <digitall_it> uhm
480: [21:35:49] * Hailwood has joined #silverstripe
481: [21:36:00] <Admonish> Sometimes it works and the file is deleted with the object other times i get this error: [User Error]: Uncaught LogicException: DataObject::delete() called on a DataObject without an ID
482: [21:36:02] <digitall_it> maybe it is better this way
483: [21:36:08] <digitall_it> function onBeforeDelete() {
484: [21:36:09] <digitall_it> parent::onBeforeDelete();
485: [21:36:10] <digitall_it> / .. delete your objects
486: [21:36:10] <digitall_it> }
487: [21:36:40] <Admonish> Ill try it
488: [21:36:54] <digitall_it> try this way, it is better because it gets executed immediately before the delete, not after. also, use this grammar, I think it is more elegant.
489: [21:38:08] <Hailwood> Man, it's annoying having the community split between here and slack
490: [21:38:21] <digitall_it> what, there’s a community on slack?
491: [21:38:30] <Admonish> yeah wut?
492: [21:38:41] <Admonish> lol
493: [21:38:44] <Admonish> news to me
494: [21:39:08] * bubaphex has joined #silverstripe
495: [21:39:09] <Hailwood> Yeah there's over 70 people on it lol
496: [21:39:16] <digitall_it> how to access it?
497: [21:39:19] <Hailwood> https://www.silverstripe.org/community/forums/connect-with-other-silverstripe-members/show/111715
498: [21:39:31] <Hailwood> basically go here https://silverstripe-users.signup.team/ fill out form
499: [21:41:15] <Admonish> digitall_it: I figured out my issue...(now I sfeel stupid) I was getting the error because some of the Item objects I was deleting dont have files associated with them. I just have to add an if statement and everything should work fine
500: [21:41:25] <Admonish> Hailwood: thanks for the link
501: [21:42:07] * bubaphex quit (Client Quit)
502: [21:42:09] <digitall_it> if ($file) $file->delete();
503: [21:42:11] <digitall_it> like this one?
504: [21:43:03] <Hailwood> Anyway, does anyone know how to create relationships on a model by default? populateDefaults() has a spaz if you try there when you dev/build the first time
505: [21:43:23] <digitall_it> there’s an article on that
506: [21:43:26] <digitall_it> let me fetch it for you
507: [21:43:54] <digitall_it> use the function
508: [21:44:07] <digitall_it> uhm
509: [21:44:12] <digitall_it> no
510: [21:44:25] <digitall_it> you can issue an onAfterWrite
511: [21:44:37] <digitall_it> check if the relationship is there, if not create it?
512: [21:44:56] <Hailwood> digitall_it: I was thinking about that, but I want the user to have the option to remove it, so I wanted to populate the relation before it's saved
513: [21:45:43] <digitall_it> so, you can check in the populateDefaults() for some data that
514: [21:45:57] <digitall_it> you know dev / build has not created yet the first time
515: [21:46:03] <digitall_it> it can be anything
516: [21:46:09] <Hailwood> digitall_it: I was thinking about populateDefaults() but if you access the database in there (in my case to get the ID of the object I want to relate) then on the first dev/build it falls over because the table doesn't exist.
517: [21:46:38] <digitall_it> ok so you just need to check if the table exists
518: [21:46:45] <digitall_it> if exists, populate the relationship
519: [21:46:54] <Hailwood> Ok. So how do I do that :D
520: [21:47:01] <digitall_it> let me check if there’s a way to do that
521: [21:47:13] <digitall_it> it should be something on the dataobject API…
522: [21:49:39] * bubaphex has joined #silverstripe
523: [21:50:00] <digitall_it> you know, you can just try to use a try catch
524: [21:50:21] <digitall_it> like a barbarian
525: [21:50:25] <Admonish> lol
526: [21:52:13] <digitall_it> however I’ve seen many modules create relationships only after the dataobject has already saved the first time to circumvent issues like this one
527: [21:52:47] <digitall_it> people, I have to go. I’ll just check out the slack community to say hi and nose dive into my own projects! goodbye!
528: [21:52:57] * digitall_it lerni o/
529: [21:53:04] * bubaphex quit (Client Quit)
530: [21:53:38] <lerni> bye, bye
531: [21:54:11] <Admonish> cya
532: [21:54:20] * digitall_it quit (Quit: digitall_it)
533: [21:54:20] <Admonish> thanks for all your help
534: [22:02:53] * UndefinedOffset quit (Quit: Leaving.)
535: [22:04:28] * bubaphex has joined #silverstripe
536: [22:09:19] * Tron has joined #silverstripe
537: [22:09:58] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
538: [22:10:03] <Tron> Hey guys I have a cwp site and I am working on my local mamp environment. Problem is I cant get into backend because /admin takes me to https and I dont have an ssl certificate....
539: [22:10:15] * bubaphex quit (Quit: bubaphex)
540: [22:10:24] * DorsaiNZ has joined #silverstripe
541: [22:10:33] * DorsaiNZ has left #silverstripe
542: [22:12:43] * bubaphex has joined #silverstripe
543: [22:13:11] <Hailwood> Tron: self signed certificate
544: [22:22:52] <lerni> Tron, Hailwood: can't you just if (!Director::isLive()) sign else unsigned ?
545: [22:23:42] <Hailwood> lerni: I have no idea how deeply buried in the CWP the https rules are
546: [22:29:18] <Tron> self signed certificates iot will have to be
547: [22:32:08] * janneklouman-- quit (Ping timeout: 245 seconds)
548: [22:34:10] * lerni quit (Remote host closed the connection)
549: [22:40:16] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
550: [22:46:30] * wmk has joined #silverstripe
551: [22:47:56] * Tron quit (Ping timeout: 260 seconds)
552: [23:00:01] * ss-helper quit (Remote host closed the connection)
553: [23:00:15] * ss-helper has joined #silverstripe
554: [23:06:22] <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?
555: [23:08:28] * janneklouman-- has joined #silverstripe
556: [23:15:14] * janneklouman-- quit (Read error: Connection reset by peer)
557: [23:15:46] * janneklouman-- has joined #silverstripe
558: [23:18:46] * darjusit has joined #silverstripe
559: [23:20:20] * bubaphex quit (Quit: bubaphex)
560: [23:20:40] * bubaphex has joined #silverstripe
561: [23:20:42] <darjusit> Hi, all when +/- silverstripe 4 will be ready aprox?
562: [23:24:22] * bubaphex quit (Client Quit)
563: [23:32:30] * janneklouman-- quit (Read error: Connection reset by peer)
564: [23:37:32] <Admonish> darjusit: Good question
565: [23:38:15] * janneklouman-- has joined #silverstripe
566: [23:52:53] * bubaphex has joined #silverstripe

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