#silverstripe IRC Log

IRC log for 30 March 2017

All timestamps are in UTC.

1: [00:09:24] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
2: [00:25:22] * UncleCheese has joined #silverstripe
3: [01:00:04] <ss-helper> SilverStripe random order for ArrayList() - http://stackoverflow.com/questions/43103588/silverstripe-random-order-for-arraylist
4: [01:04:07] * helenclarko quit (Ping timeout: 246 seconds)
5: [01:10:13] * filisko quit (Ping timeout: 260 seconds)
6: [01:10:40] * spronk has joined #silverstripe
7: [01:53:33] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
8: [02:16:41] * UncleCheese has joined #silverstripe
9: [03:00:23] * helenclarko has joined #silverstripe
10: [03:30:07] <ss-helper> Silverstripe custom display rules—how to use the value of a select? - http://stackoverflow.com/questions/43107958/silverstripe-custom-display-rules-how-to-use-the-value-of-a-select
11: [04:00:31] * Phlunk3 has joined #silverstripe
12: [04:01:39] * Phlunk3 quit (Remote host closed the connection)
13: [04:17:26] * helenclarko quit (Read error: Connection reset by peer)
14: [04:59:32] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
15: [05:00:08] <ss-helper> Silverstripe 3.3: how to translate date month variable in a template? - http://stackoverflow.com/questions/36689491/silverstripe-3-3-how-to-translate-date-month-variable-in-a-template
16: [05:15:57] * cloph quit (Ping timeout: 260 seconds)
17: [05:18:28] * cloph_away has joined #silverstripe
18: [05:40:14] * Shrike_Finland has joined #silverstripe
19: [06:09:22] * Audlex quit ()
20: [06:09:29] * spronk quit (Quit: I may need a longer sleep timer...)
21: [06:39:02] * UncleCheese has joined #silverstripe
22: [06:45:10] <ss-helper> Apache2 user (www-data) permission denied for folder owned by www-data - http://stackoverflow.com/questions/43110283/apache2-user-www-data-permission-denied-for-folder-owned-by-www-data
23: [07:32:57] * tt_ has joined #silverstripe
24: [07:33:12] <tt_> guys , getting the following error
25: [07:33:12] <tt_> PHP Warning: Director::protocolAndHost() lacks sufficient information - HTTP_HOST not set. You probably want to define $_FILE_TO_URL_MAPPING in your _ss_environment.php as instructed on the "sake" page of the doc.silverstripe.com wiki in
26: [07:33:31] <Zauberfisch> tt_: using sake/cli?
27: [07:33:46] <tt_> yes
28: [07:33:54] <Zauberfisch> then set $_FILE_TO_URL_MAPPING :P
29: [07:34:04] <tt_> usling cliscript
30: [07:34:05] <Zauberfisch> silverstripe needs to know what the current URL is
31: [07:34:19] <tt_> php framework/cli-script.php
32: [07:34:25] <Zauberfisch> and if you use cli you don't have any URL
33: [07:34:26] <tt_> using php framework/cli-script.php
34: [07:34:34] <Zauberfisch> so you need to tell silverstripe what the site url is
35: [07:35:23] <tt_> but the same thing is working fine when I am not sending http headers using define() in _config.php
36: [07:35:37] <Zauberfisch> tt_: have you read https://docs.silverstripe.org/en/3/developer_guides/cli/ ?
37: [07:35:53] <Zauberfisch> see the Configuration part
38: [07:36:20] <tt_> ok
39: [07:36:21] <tt_> thanx
40: [07:36:23] <Zauberfisch> doesn't matter if you sake or cli-script.php
41: [07:36:24] <tt_> checking it
42: [07:36:27] <Zauberfisch> configuration is the same
43: [07:37:03] <Zauberfisch> if you don't have a _ss_environment.php you could probably put it in your mysite/_config.php
44: [07:40:50] * tt_ quit (Ping timeout: 260 seconds)
45: [07:43:18] * tt_ has joined #silverstripe
46: [07:43:23] <tt_> not able to find _ss_environment.php
47: [07:43:30] <tt_> where is it located?
48: [07:47:02] <Shrike_Finland> Hi! Could someone give me a hint, how can I add third option ("Attachment") to be checked , if it's set or not. Code here: $selectedOption = ($this->LinkLocID) ? "LinkLocID" : "ExternalLink";
49: [07:47:33] <Zauberfisch> tt_: then you probably don't have one
50: [07:48:04] <tt_> how can i create it?
51: [07:48:18] <tt_> doesn't that come along silverstripe instalation?
52: [07:48:40] <Zauberfisch> tt_: it's a different (better) way to configure your silverstripe site
53: [07:48:57] <Zauberfisch> it's an alternative to putting your database config in mysite/_config.php
54: [07:49:41] <tt_> so, can i put the same into mysite/_config.php ?
55: [07:50:00] <Zauberfisch> probably
56: [07:50:47] <tt_> ok
57: [07:53:27] <Zauberfisch> Shrike_Finland: not quiet sure what you mean
58: [07:53:31] * samsamek has joined #silverstripe
59: [07:53:38] <Zauberfisch> Shrike_Finland: elaborate on your question please
60: [07:59:21] <Shrike_Finland> Zauberfisch: https://www.silverstripe.org/blog/a-beginners-introduction-to-using-entwine-in-silverstripe/
61: [08:00:22] <Shrike_Finland> Zauberfisch: I'm adding third option besides internal and external link
62: [08:04:46] <Zauberfisch> still, your question is unclear
63: [08:06:02] <Zauberfisch> what do you mean with checked?
64: [08:06:38] <Shrike_Finland> How to update $selectedOption line so, that it checks, which of the three is selected/set before.
65: [08:11:25] <Shrike_Finland> I'll pasted my code here: https://pastebin.com/97hZcNrV
66: [08:12:58] * samsamek quit (Quit: samsamek)
67: [08:14:09] * kinglozzer has joined #silverstripe
68: [08:34:01] <Shrike_Finland> Zauberfisch: If user have selected one of the three options, saved the dataobject, reopened it, the selection should remember which of the three is selected.
69: [08:35:06] * agent44 has joined #silverstripe
70: [08:36:15] <Zauberfisch> oh, so you have a option set field that selects wich field to display
71: [08:36:21] <Shrike_Finland> yes
72: [08:36:40] <Zauberfisch> so when you select external it only shows the external field and then only saves the external field?
73: [08:37:09] <Zauberfisch> but the OptionSetField doesn't actually get stored in the DB
74: [08:37:13] <Zauberfisch> ?
75: [08:37:45] <Shrike_Finland> No, it checks if there is data on these three fields
76: [08:38:21] <Zauberfisch> I see
77: [08:38:40] <Zauberfisch> have you tried to pass a value to the FormField in getCMSFields?
78: [08:38:55] <Zauberfisch> I probably won't work but it's worth a try
79: [08:39:19] <Zauberfisch> new OptionSetField($name, $title, $options, "external")
80: [08:39:21] <Zauberfisch> or something
81: [08:52:48] * samsamek has joined #silverstripe
82: [09:05:23] * Otterpocket has joined #silverstripe
83: [09:06:23] <Otterpocket> Is there any good and recent documentation on various orm filters for dates ?
84: [09:13:34] * samsamek quit (Quit: samsamek)
85: [09:15:13] <ss-helper> Silverstripe SQLUpdate multiple rows - http://stackoverflow.com/questions/43113396/silverstripe-sqlupdate-multiple-rows
86: [09:19:08] * samsamek has joined #silverstripe
87: [09:27:21] * DimiStripe quit (Quit: DimiStripe)
88: [09:29:34] <Shrike_Finland> Zauberfisch: This is what I have: $selectedOption = ($this->LinkLocID) ? "LinkLocID" : "ExternalLink"; $linkTypeField = OptionsetField::create("LinkType", "", $linkOptions, $selectedOption);
89: [09:31:22] <Shrike_Finland> I thought, I could write it this way: $selectedOption = ($this->LinkLocID) ? "LinkLocID" : "ExternalLink" : "Attachment";
90: [09:31:44] <Shrike_Finland> But that's not working
91: [09:39:05] * Otterpocket has left #silverstripe
92: [09:41:17] * deschebbs has joined #silverstripe
93: [09:45:03] * DimiStripe has joined #silverstripe
94: [09:47:25] * samsamek quit (Quit: samsamek)
95: [09:57:24] <Zauberfisch> oh
96: [09:57:27] <Zauberfisch> so that's your question
97: [09:57:35] <Shrike_Finland> :D
98: [09:58:34] <Zauberfisch> well, Shrike_Finland, $a = ($b)?$c:$d; is the short for of "if ($b) { $a = $c; } else { $a = $d; }"
99: [09:58:46] <Zauberfisch> so, no, you can't have two ":"
100: [09:58:54] <Zauberfisch> you have 2 options:
101: [10:00:50] <Zauberfisch> $selectedOption = $this->LinkLocID ? "LinkLocID" : $this->ExternalLink ? "ExternalLink" : "Attachment");
102: [10:00:57] <Zauberfisch> so nested if's
103: [10:01:02] <Zauberfisch> or you just use a normal if:
104: [10:01:49] <Zauberfisch> if ($this->LinkLocID) { $selectedOption = "LinkLocID"; } elseif ($this->ExternalLink) { $selectedOption = "ExternalLink"; } else { $selectedOption = "Attachment"; }
105: [10:04:52] <Shrike_Finland> Hell yea! WOrks lke a charm. Chaining is less messy.
106: [10:10:46] * Otterpocket has joined #silverstripe
107: [10:11:32] * filisko has joined #silverstripe
108: [10:11:42] <Otterpocket> If I have a 'Date' property on my model and I want use this function $this->StartDate->inFuture() ....
109: [10:12:18] <Zauberfisch> Otterpocket: not sure if there are good docs
110: [10:12:20] <Zauberfisch> but:
111: [10:12:47] <Zauberfisch> $list->filter('Date:GreaterThan', date('Y-m-d'));
112: [10:13:07] <Otterpocket> Zauberfisch: Thanks I have done that bit now
113: [10:13:59] <Otterpocket> just trying to make my model aware of its own status, ideally I would create a model scope and solve both problems, but as far as I am aware SS doesn't not have this feature
114: [10:14:17] <Zauberfisch> not sure what you mean
115: [10:14:59] <Zauberfisch> but regarding dates, there is no special date filter, but the GreaterThan, GreaterThanEqual, LessThan and LessThanEqual all work on Date ranges
116: [10:15:20] <Zauberfisch> so you can use them for Future and Past stuff
117: [10:15:27] <Otterpocket> https://gist.github.com/Otterpocket/256cd29ddceb437fa162aa7a0f3e305a
118: [10:15:36] <Zauberfisch> on the object itself, isFuture() already exists as method
119: [10:15:57] <Zauberfisch> $dataObject->obj('StartDate')->isInFuture()
120: [10:16:22] <Zauberfisch> $dataObject->obj('StartDate')->InFuture()
121: [10:16:45] <Zauberfisch> ->obj() on a dataobject returns a db field as a DBField object
122: [10:16:51] <Zauberfisch> in case of date that's: https://api.silverstripe.org/3.1/source-class-Date.html
123: [10:16:58] <Zauberfisch> so you can access all those date methods
124: [10:17:25] <Zauberfisch> (in templates this obj() call happens automaticall, so in template you just do $StartDate.InFuture
125: [10:18:00] <Otterpocket> Zauberfisch: great thanks, $this->obj('StartDate')->inFuture() works a charm
126: [10:18:01] <Zauberfisch> does that answer your question?
127: [10:18:09] <Otterpocket> Does indeed
128: [10:29:24] * wmk has joined #silverstripe
129: [10:35:37] * Shrike_Finland quit (Quit: Leaving.)
130: [10:55:12] * Shrike_Finland has joined #silverstripe
131: [11:12:03] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
132: [11:13:02] * UncleCheese has joined #silverstripe
133: [11:13:36] * UncleCheese quit (Client Quit)
134: [11:13:51] * UncleCheese has joined #silverstripe
135: [11:14:25] * UncleCheese quit (Client Quit)
136: [11:14:40] * UncleCheese has joined #silverstripe
137: [11:15:14] * UncleCheese quit (Client Quit)
138: [11:15:29] * UncleCheese has joined #silverstripe
139: [11:16:04] * UncleCheese quit (Client Quit)
140: [11:16:18] * UncleCheese has joined #silverstripe
141: [11:16:52] * UncleCheese quit (Client Quit)
142: [11:17:06] * UncleCheese has joined #silverstripe
143: [11:17:41] * UncleCheese quit (Client Quit)
144: [11:17:54] * UncleCheese has joined #silverstripe
145: [11:18:29] * UncleCheese quit (Client Quit)
146: [11:18:44] * UncleCheese has joined #silverstripe
147: [11:19:17] * UncleCheese quit (Client Quit)
148: [11:19:32] * UncleCheese has joined #silverstripe
149: [11:20:07] * UncleCheese quit (Client Quit)
150: [11:56:02] * filisko quit (Ping timeout: 260 seconds)
151: [12:14:24] * tt_ quit (Ping timeout: 260 seconds)
152: [12:27:23] * UndefinedOffset has joined #silverstripe
153: [12:53:19] * terryapodaca has joined #silverstripe
154: [13:02:53] * terryapodaca quit (Quit: Later fellas......I'm out.)
155: [13:12:32] * Shrike_Finland quit (Quit: Leaving.)
156: [13:41:59] * NETim has joined #silverstripe
157: [13:42:18] <NETim> Morning. Why would a dev/build fail with an unknown column error?
158: [13:44:38] <cloph_away> because there is one missing? anyway: real output helps more..
159: [13:47:01] <NETim> cloph_away, me?
160: [13:47:11] <cloph_away> yes
161: [13:47:51] <NETim> Managed to resolve it now though. Seems like it wouldn't build the new column on siteconfig because a dataobject extension called SiteConfig to get other data.
162: [14:00:57] * DimiStripe quit (Quit: DimiStripe)
163: [14:32:44] * cloph_away is now known as cloph
164: [14:54:04] * filisko has joined #silverstripe
165: [14:57:44] * DimiStripe has joined #silverstripe
166: [15:35:05] * samsamek has joined #silverstripe
167: [16:15:26] * samsamek quit (Quit: samsamek)
168: [16:31:42] * kinglozzer quit ()
169: [16:40:07] * wmk quit (Ping timeout: 260 seconds)
170: [17:02:33] * agent44 quit (Quit: zzz)
171: [17:21:47] * Fuxo has joined #silverstripe
172: [17:24:07] <Fuxo> Hi, how can I install silverstripe-australia/silverstripe-gridfieldextensions compatible with ss 3.5? The dev-master branch is for ss 4.0
173: [18:40:41] * Fuxo quit (Quit: Going offline, see ya! (www.adiirc.com))
174: [19:09:22] * UncleCheese has joined #silverstripe
175: [19:09:27] * UncleCheese quit (Client Quit)
176: [19:11:51] * deschebbs quit (Quit: Konversation terminated!)
177: [19:45:12] * UncleCheese has joined #silverstripe
178: [20:00:38] * UndefinedOffset quit (Quit: Leaving.)
179: [20:06:10] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
180: [20:06:30] * UncleCheese has joined #silverstripe
181: [20:10:21] * UncleCheese quit (Client Quit)
182: [20:15:29] * UncleCheese has joined #silverstripe
183: [20:20:18] * UndefinedOffset has joined #silverstripe
184: [20:32:51] * gelignite has joined #silverstripe
185: [21:30:01] * UndefinedOffset quit (Quit: Leaving.)
186: [22:15:15] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
187: [22:37:18] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
188: [23:00:01] * ss-helper quit (Remote host closed the connection)
189: [23:00:16] * ss-helper has joined #silverstripe

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