#silverstripe IRC Log

IRC log for 10 March 2017

All timestamps are in UTC.

1: [01:28:25] * Nightjar has joined #silverstripe
2: [01:28:34] <Nightjar> FK YEH FRIDAYIIIIIIIEEEEE
3: [01:30:27] <DanaeNZ> boiiIIIIII
4: [01:30:32] <DanaeNZ> Yes though end of the week
5: [01:30:37] <DanaeNZ> After this 3 more working days
6: [01:30:43] <DanaeNZ> NEW YORK NEW YORK
7: [01:30:47] <DanaeNZ> then no travel for a while
8: [01:30:47] <DanaeNZ> lol
9: [01:30:51] <ss23> nice
10: [01:40:02] * loki has joined #silverstripe
11: [01:40:02] <ss-helper> loki: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
12: [01:40:24] * loki is now known as Guest26480
13: [01:41:45] * Guest26480 is now known as loki_nz
14: [01:41:56] <loki_nz> hi
15: [01:46:15] * matt-in-a-hat has joined #silverstripe
16: [01:46:49] <loki_nz> anyone able to help me with an issue setting up a relationship between a page and a DataObject? I am tearing my hair out.
17: [01:54:11] <matt-in-a-hat> Hi peeps. I've just updated my composer packages but now my phpunit tests fail. It seems the test framework is looking for tests in some of the packages e.g. externallinks: PHP Warning: require_once(/vagrant/externallinks/tests/ExternalLinksTest.php): failed to open stream: No such file or directory in /vagrant/framework/core/manifest/ClassLoader.php on line 77
18: [01:54:23] <matt-in-a-hat> It looks like some of these packages used to ship with the tests folder and no longer do, but I've built and flushed and it seems the SS test bootstrap seems to try load them. Any ideas?
19: [01:54:24] <DanaeNZ> loki_nz: sure what is going wrong?
20: [01:54:54] <DanaeNZ> matt-in-a-hat: Are you using whitelisting in your phpunit.xml? Should only need to search through your own tests
21: [01:55:11] <matt-in-a-hat> I've got only <directory>mysite/tests/importers</directory>
22: [01:55:20] <loki_nz> I am trying to setup a 1-to-1 relationship between a 'Solution' DataObject and a 'SolutionPage' Page
23: [01:55:42] <loki_nz> in my DataObject i have private static $has_one = array( 'SolutionPage' => 'SolutionPage', );
24: [01:55:55] <loki_nz> in my page i have private static $has_one = array ( 'Solution' => 'Solution', );
25: [01:56:27] <loki_nz> When I try and list the pages using: $fields->addFieldToTab('Root.Main', ListboxField::create('Solution','Solution', Solution::get()->map('ID', 'Name')->toArray()), 'Metadata');
26: [01:56:36] <loki_nz> I get [User Error] Uncaught Exception: Object->__call(): the method 'getidlist' does not exist on 'Solution'
27: [01:56:53] <loki_nz> But, I can var_dump Solution::get()->map('ID', 'Name')->toArray()
28: [01:56:59] <loki_nz> and it looks fine.
29: [01:57:51] <matt-in-a-hat> loki_nz: try belongs_to on one of them https://docs.silverstripe.org/en/3/developer_guides/model/relations/#belongs-to
30: [01:58:09] <loki_nz> I have tried that :(
31: [02:00:12] <matt-in-a-hat> loki_nz: Have you tried in your page: $belongs_to = array ( 'Solution' => 'Solution.SolutionPage', );
32: [02:00:44] <matt-in-a-hat> With a build and flush
33: [02:01:16] <DanaeNZ> ListboxField::create('SolutionID'
34: [02:01:19] <DanaeNZ> for one
35: [02:01:53] <DanaeNZ> Also try doing aplain DropdownField loki_nz
36: [02:02:00] <DanaeNZ> Instead of a listboxfield
37: [02:03:50] <matt-in-a-hat> DanaeNZ: no other ideas? I've even tried running a specific test with phpunit mysite/tests/MyTest.php, but it loads framework/tests/bootstrap.php which itself seems to try find tests in packages
38: [02:03:52] <loki_nz> DanaeNZ: adding ID worked!
39: [02:03:58] <loki_nz> magic, thanks!
40: [02:04:46] <loki_nz> Is there some docs on the need for that?
41: [02:07:13] <DanaeNZ> loki_nz: Yeah I think so
42: [02:08:15] <DanaeNZ> Hmm can't find it
43: [02:08:26] <DanaeNZ> It's just something you always do on a has_one so
44: [02:08:42] <loki_nz> I will need to remember that!
45: [02:09:05] <DanaeNZ> matt-in-a-hat: Hmmm, I use PHPStorm to run my tests, and I believe I have to specifically point it to the bootstrap in framework
46: [02:09:06] <DanaeNZ> hmm
47: [02:09:53] <DanaeNZ> <filter> <whitelist> <directory suffix=".php">/twitter-card-meta/</directory> </whitelist> </filter>
48: [02:09:59] <DanaeNZ> That's my whitelist
49: [02:10:03] <DanaeNZ> in phpunit.xml
50: [02:10:42] <DanaeNZ> Now I'm going to go elbow deep into the request handler business
51: [02:10:58] <DanaeNZ> Trying to see if I can have a page work with a different parent URL segment
52: [02:11:02] <DanaeNZ> I think I will not succeed
53: [02:14:59] <spronk> hmm
54: [02:15:03] <spronk> who are the formula 1ers in here
55: [02:20:26] <DanaeNZ> not I
56: [02:24:03] <DanaeNZ> Is there an extension hook right before a 404 error is thrown?
57: [02:42:18] <loki_nz> How can I access the name of my 'Solution' from withing the page controller? I can do it on the layout with $Solution.Name
58: [02:42:41] <loki_nz> I want to write it to a readonly field for informational purposes
59: [02:46:02] <matt-in-a-hat> Like ReadonlyField::create('Solution.Name') ?
60: [02:48:03] <loki_nz> I have tried that and I get " (none)"
61: [02:49:27] <DanaeNZ> ReadonlyField::create('Page.Title', 'Page')->setValue($this->Page()->Title)
62: [02:49:37] <DanaeNZ> loki_nz: Instead of Page go Solution
63: [02:49:59] <DanaeNZ> And instead of Title go Name
64: [02:51:41] <loki_nz> DanaeNZ: you are a legend!
65: [02:51:53] <DanaeNZ> haha np
66: [03:39:21] <loki_nz> On my "Solution" DataObject, where I associate a "SolutionPage", is there a way to limit the items in the dropdown to pages that are not associated with a solution?
67: [03:44:52] <DanaeNZ> loki_nz: Solution::get()->filter(['SolutionPageID' => 0])->map('ID', 'Name')->toArray()
68: [03:45:17] <DanaeNZ> Looking at your database will probably help your understanding of how SS data model works
69: [03:49:43] <spronk> hmm
70: [03:49:44] <spronk> guys
71: [03:49:55] <loki_nz> Ok, will do, thanks.
72: [03:50:06] <spronk> where can i host a static html+javascript site that i want to go viral, and not pay massive bandwidth charges?
73: [03:52:28] <loki_nz> Looking at it now, there are no SolutionIDs in my solutionpage table
74: [03:52:51] <loki_nz> I am creating the relationship from the Solution object only.
75: [03:52:58] * DanaeNZ quit (Quit: TIME TO FEED)
76: [03:53:06] <loki_nz> I only want to have to control that from one place
77: [03:58:18] <matt-in-a-hat> Is the class manifest that the unit test uses to create a testing database different to that for the webserver? I'm getting errors because it can't find a table for my class even though that class/table is working fine on the webpage
78: [04:07:41] <matt-in-a-hat> Hmm, I trashed the silverstripe-cache folder and my problems went away. I knew it was some cache issue but builds/flushes wouldn't fix it for some reason...
79: [04:23:50] <Nightjar> matt-in-a-hat, CLI builds a different manifest than the web interface.
80: [04:24:05] <Nightjar> It can be a bit of a gotcha at times.
81: [04:24:39] <Nightjar> spronk, ec2 free tier?
82: [04:24:50] <spronk> Nightjar mm, thinking that
83: [04:24:59] <spronk> or possibly static s3 hosting + cloudflare
84: [04:25:06] <Nightjar> lambda
85: [04:25:20] <Nightjar> YOU HAVE TO USE SERVERLESS OR YOU'RE CLEARLY DOING IT WRONG, GOSH
86: [04:25:26] <Nightjar> :P
87: [04:25:32] <loki_nz> solved it with: DropdownField::create('SolutionPageID', 'Solution Page',SolutionPage::get() ->exclude('ID',Solution::get()->exclude('SolutionPageID',$this->SolutionPage()->ID)->column('SolutionPageID')) ->map('ID','Title')->toArray()) ->setEmptyString('(Select one)')
88: [04:47:28] * Nightjar quit (Quit: Leaving)
89: [04:50:39] * matt-in-a-hat has left #silverstripe
90: [06:46:17] * wmk has joined #silverstripe
91: [06:48:29] * wmk quit (Client Quit)
92: [07:17:05] * wmk has joined #silverstripe
93: [07:50:23] * deschebbs has joined #silverstripe
94: [09:02:11] * kinglozzer has joined #silverstripe
95: [09:23:00] * PigeonFriend has joined #silverstripe
96: [09:31:58] * agent44 has joined #silverstripe
97: [10:19:06] * Shrike_Finland has joined #silverstripe
98: [10:19:07] * Shrike_Finland quit (Client Quit)
99: [10:46:14] * gelignite has joined #silverstripe
100: [11:25:57] * wmk quit (Ping timeout: 240 seconds)
101: [12:10:19] * Shrike_Finland has joined #silverstripe
102: [12:30:47] * PigeonFriend quit (Read error: Connection reset by peer)
103: [13:16:47] * oldmols has joined #silverstripe
104: [13:28:17] * UndefinedOffset has joined #silverstripe
105: [14:02:13] * wmk has joined #silverstripe
106: [14:18:01] * Shrike_Finland quit (Quit: Leaving.)
107: [14:18:01] * Shrike_Finland has joined #silverstripe
108: [14:22:13] <oldmols> anyone using silverstripe with valet on nginx?
109: [14:46:19] <wmk> oldmols, what's that? I just know silverstripe on nginx can be tricky sometimes to find the right settings
110: [14:46:47] <oldmols> laravel-valet
111: [14:47:24] <oldmols> I just switched back to good old apache with mamp
112: [14:47:30] <oldmols> couldn't figure it out
113: [14:47:50] <oldmols> https://laravel.com/docs/5.4/valet
114: [14:48:17] <oldmols> I wasn't able to run dev/build on nginx
115: [14:48:55] * UndefinedOffset quit (Quit: Leaving.)
116: [14:57:12] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
117: [15:00:12] * UndefinedOffset has joined #silverstripe
118: [15:04:18] <cloph> the only "hidden magic" is that having pass main.php through php-interpreter is not enough, you also need to satisfy tinymce - but apart from that it is pretty standard.
119: [15:05:18] <oldmols> talking about nginx?
120: [15:06:18] <cloph> yes, that was only related to ngix, no idea what valet is :-)
121: [15:08:41] <cloph> oldmols: without knowing specifics about your problem, fastcgi_buffer_size likely needs to be larger (if you get "upstream sent too big header while reading response header from upstream" error)
122: [15:09:04] <cloph> should be >=8k for silverstripe
123: [15:16:09] * oldmols quit (Remote host closed the connection)
124: [15:16:34] * oldmols has joined #silverstripe
125: [15:21:04] * oldmols quit (Ping timeout: 260 seconds)
126: [15:27:29] * oldmols has joined #silverstripe
127: [15:29:41] <wmk> cloph, oldmols yup, nginx and tinymce.. I had to disable gzip for tiny to get it running, see http://www.silverstrip.es/blog/tinymce-does-not-load-on-nginx/
128: [15:31:57] <Shrike_Finland> Hi, I have used PermissionProvider and checks for user rights on dataobjects, but there is a one object where I do not want to use permissions. Instead give access to all straight away. How can I do this?
129: [15:40:44] * Shrike_Finland quit (Quit: Leaving.)
130: [15:41:49] * oldmols quit (Remote host closed the connection)
131: [15:42:16] * oldmols has joined #silverstripe
132: [15:46:45] * oldmols quit (Ping timeout: 258 seconds)
133: [15:55:30] * Shrike_Finland has joined #silverstripe
134: [15:56:25] * deschebbs quit (Quit: Konversation terminated!)
135: [16:00:22] <Zauberfisch> Shrike_Finland: depends on your usecase
136: [16:00:47] <Zauberfisch> but have you tried "public function canView($m = null) { return true; } public function canEdit($m = null) { return true; }"
137: [16:01:42] <Zauberfisch> at least the CMS check those 2 methods before allowing to edit
138: [16:01:56] <Zauberfisch> but it really depends on how you use permissions, and where
139: [16:02:27] <Shrike_Finland> I used now Kinglozzers example: https://www.silverstripe.org/community/forums/general-questions/show/20626
140: [16:02:35] <Shrike_Finland> Seems to work in this case
141: [16:43:26] * oldmols has joined #silverstripe
142: [16:46:54] * Shrike_Finland1 has joined #silverstripe
143: [16:48:05] * oldmols quit (Ping timeout: 258 seconds)
144: [16:48:18] * Shrike_Finland quit (Quit: Leaving.)
145: [17:00:09] * Shrike_Finland1 quit (Quit: Leaving.)
146: [17:03:29] * Shrike_Finland has joined #silverstripe
147: [17:05:20] * janneklouman-- has joined #silverstripe
148: [17:09:57] * janneklouman-- quit (Ping timeout: 240 seconds)
149: [17:10:06] * kinglozzer quit ()
150: [17:12:00] * BackEndCoder quit (Excess Flood)
151: [17:14:12] * BackEndCoder has joined #silverstripe
152: [17:15:06] * janneklouman-- has joined #silverstripe
153: [17:19:27] * janneklouman-- quit (Ping timeout: 240 seconds)
154: [17:31:57] * janneklouman-- has joined #silverstripe
155: [17:33:30] * oldmols has joined #silverstripe
156: [17:36:28] * janneklouman-- quit (Ping timeout: 240 seconds)
157: [17:36:52] * oldmols quit (Client Quit)
158: [17:42:31] * wmk quit (Ping timeout: 258 seconds)
159: [17:56:23] * agent44 quit (Quit: zzz)
160: [18:08:17] * Shrike_Finland quit (Quit: Leaving.)
161: [18:15:39] * Shrike_Finland has joined #silverstripe
162: [18:26:32] * gelignite has joined #silverstripe
163: [18:39:29] * wmk has joined #silverstripe
164: [19:01:42] <Shrike_Finland> Anyone had a problems with latest alpha5 (SS4)? I'm getting error • Fatal error: Interface 'PHPUnit_Framework_TestListener' not found in
165: [19:23:43] * wmk quit (Ping timeout: 258 seconds)
166: [19:26:51] <Zauberfisch> Shrike_Finland: not that paticular error, but other errors
167: [19:27:02] <Zauberfisch> seems like alpha5 has a few issues
168: [19:27:15] <Zauberfisch> I am staying on alpha4 right now for the projects that I am working on
169: [19:46:03] * Shrike_Finland quit (Quit: Leaving.)
170: [20:10:53] * UndefinedOffset quit (Quit: Leaving.)
171: [20:50:54] * Shrike_Finland has joined #silverstripe
172: [20:50:57] * Shrike_Finland quit (Client Quit)
173: [21:13:52] * UndefinedOffset has joined #silverstripe
174: [21:29:05] * UndefinedOffset quit (Quit: Leaving.)
175: [22:11:50] * janneklouman-- has joined #silverstripe
176: [22:17:10] * janneklouman-- quit (Ping timeout: 268 seconds)
177: [22:39:25] * janneklouman-- has joined #silverstripe
178: [22:47:27] * janneklouman-- quit (Ping timeout: 240 seconds)
179: [23:00:02] * ss-helper quit (Remote host closed the connection)
180: [23:00:18] * ss-helper has joined #silverstripe
181: [23:37:31] * gelignite quit (Quit: http://bit.ly/1kso8Ta)

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