#silverstripe IRC Log

IRC log for 29 December 2013

All timestamps are in UTC.

1: [00:44:42] * SphereSilverNL has joined #silverstripe
2: [00:45:19] <SphereSilverNL> Anyone here familiar with the Forum module?
3: [00:45:25] <SphereSilverNL> I installed it locally, all fine
4: [00:45:42] <SphereSilverNL> Installed it on the production, and now I'm unable to access the admin :/
5: [00:49:00] <SphereSilverNL> ehhhh, nevermind.....
6: [00:49:30] <SphereSilverNL> appearantly "Security::set_default_admin('my_password_here');" isn't the correct password :F
7: [00:59:23] * ssnewbie has joined #silverstripe
8: [00:59:49] <ssnewbie> what is the best way to display in the template a nested array?
9: [01:00:54] <ssnewbie> I have authors who have multiple books and would like load the author name then a list of their books, then the next author and a list of their books ect
10: [01:12:18] <SphereSilverNL> Make it a grouped list
11: [01:12:26] <SphereSilverNL> then, loop the authors
12: [01:12:38] <SphereSilverNL> inside that loop, loop it's children (that's the books)
13: [01:13:02] <SphereSilverNL> That way, you can group and even sort them on the authors name
14: [01:14:11] <SphereSilverNL> I don't know how well you know Silverstripe, but these docs should get you started: http://doc.silverstripe.org/framework/en/howto/grouping-dataobjectsets
15: [01:17:06] <ssnewbie> here is what I am doing
16: [01:17:21] * SphereSilverNL quit (Remote host closed the connection)
17: [01:17:57] <ssnewbie> $authors = Authors::get()->filter(array('AuthorID' => $this->ID));
18: [01:18:06] * SphereSilverNL has joined #silverstripe
19: [01:18:07] <SphereSilverNL> sorry, something crashed I guess...
20: [01:18:14] <ssnewbie> $authors = Authors::get()->filter(array('AuthorID' => $this->ID));
21: [01:18:29] <ssnewbie> that gets me the author IDs in an array
22: [01:19:05] <SphereSilverNL> First (minor) remark: Your DO shouldn't be named plural, but singular. But it doesn't matter for the functionality ;)
23: [01:19:19] <ssnewbie> ok
24: [01:19:46] <SphereSilverNL> It gets you the author with the current ID. Assuming you're running this from the page, it gets you the author with the same ID as the Page
25: [01:20:04] <ssnewbie> yes
26: [01:20:51] <SphereSilverNL> It looks a bit illogical
27: [01:20:59] <ssnewbie> hmmm
28: [01:21:01] <SphereSilverNL> I would more likely guess
29: [01:21:39] <SphereSilverNL> Author::get()->filter(array('PageID' => $this->ID));
30: [01:22:07] <SphereSilverNL> What you're doing now, is filtering the author, on AuthorID.... Sounds illogical
31: [01:23:20] <ssnewbie> ok another way to explain, i have the author IDs as Array [1], [2], [3] and within each of those arrays I have further arrays with the books
32: [01:23:31] <ssnewbie> does that make sense?
33: [01:23:52] <SphereSilverNL> Why are they arrays?
34: [01:24:01] <SphereSilverNL> Why not objects?
35: [01:24:29] <ssnewbie> ok
36: [01:24:38] <ssnewbie> so use objects, sorry new to SS
37: [01:24:42] <SphereSilverNL> Ok, let's start from the beginning :)
38: [01:24:47] <ssnewbie> OK
39: [01:24:52] <SphereSilverNL> One, you have an "AuthorPage" right?
40: [01:25:11] <ssnewbie> No,
41: [01:25:24] <ssnewbie> I have a book store page,
42: [01:25:45] <SphereSilverNL> pretty much the same, I'm just trying to deduct and get to what's going wrong :)
43: [01:25:48] <ssnewbie> in bookstore i have author page
44: [01:25:55] <SphereSilverNL> Ah, ok :)
45: [01:26:01] <ssnewbie> and then books
46: [01:26:26] <SphereSilverNL> So, you have many AuthorPages, which have many books, do I understand that correctly?
47: [01:26:34] <ssnewbie> yup
48: [01:26:51] <SphereSilverNL> BookstorePage -> AuthorPage (a bunch of them, named by author) -> Books
49: [01:26:51] <ssnewbie> many to many from what I have been reading
50: [01:27:01] <ssnewbie> yup
51: [01:27:06] <SphereSilverNL> A book with many_many author??
52: [01:27:44] <SphereSilverNL> Many_Many is for relationships that occur multiple times. For example, an Actor played in many_many movies, and a Movie has many_many actors
53: [01:27:57] <ssnewbie> sorry 1 author per book,
54: [01:27:59] <ssnewbie> my mistake
55: [01:28:21] <SphereSilverNL> but an author-book relationship, sounds like it should be a book: has_one author; author: has_many books
56: [01:28:23] <ssnewbie> but an author can have multiple books
57: [01:28:23] <SphereSilverNL> ah, ok.
58: [01:28:58] <SphereSilverNL> So, to get to the point, you want, in your bookstore, to loop all author-pages (which are children of the bookstore-page)?
59: [01:29:08] <SphereSilverNL> And then, per author, display the books?
60: [01:29:28] <ssnewbie> yes to display it in a list
61: [01:29:37] <ssnewbie> ul, li ect
62: [01:29:53] <SphereSilverNL> In your bookstorepage template, how do you loop the authors?
63: [01:31:01] <ssnewbie> I have a public function called GetAuthors
64: [01:33:19] <ssnewbie> $myauthors = Authors::get()->filter(array('BookStorePageID' => $this->ID));
65: [01:34:00] <ssnewbie> this gets me the author info such as name title and ID
66: [01:35:14] <SphereSilverNL> I think, this is close to what you want to achieve:
67: [01:35:16] <SphereSilverNL> http://pastebin.com/7mmiHW2k
68: [01:35:29] <SphereSilverNL> Excuse the shortcuts I took :)
69: [01:35:58] <SphereSilverNL> The BookstorePage, has a function getAuthors(), which returns only the AuthorPages
70: [01:36:10] <SphereSilverNL> Then, in the template, you loop those.
71: [01:36:34] <ssnewbie> ok great thank you so much
72: [01:36:34] <SphereSilverNL> In the template, display the name of the author, and then, loop the books the author has.
73: [01:37:00] <ssnewbie> Ok, i think i can see where the logic is now
74: [01:37:04] <ssnewbie> thank you so much :)
75: [01:37:09] <SphereSilverNL> The actual template and such, can ofcourse be changed to a <ul> and so on, this is set up just to show the functional logic :)
76: [01:37:13] <SphereSilverNL> You're welcome
77: [01:37:42] <ssnewbie> will work on this an report back thanks again:)
78: [01:39:04] <SphereSilverNL> No problem, that's what this channel is for ;)
79: [01:44:41] * SphereSilverNL quit (Remote host closed the connection)
80: [01:45:44] * SphereSilverNL has joined #silverstripe
81: [01:46:15] <SphereSilverNL> flashplayer
82: [01:51:42] * ssnewbie quit (Quit: Page closed)
83: [02:22:02] * violet- quit (Remote host closed the connection)
84: [02:29:34] * SphereSilverNL quit (Quit: bye)
85: [03:33:22] * Kolin has joined #silverstripe
86: [03:54:01] * Motoservo quit (Quit: Motoservo)
87: [04:02:18] * Motoservo has joined #silverstripe
88: [04:05:55] * Marvanni_ quit (Quit: Marvanni_)
89: [04:14:44] * Marvanni_ has joined #silverstripe
90: [04:18:54] * Marvanni_ quit (Ping timeout: 246 seconds)
91: [04:21:29] * Marvanni_ has joined #silverstripe
92: [04:25:58] * cloph has joined #silverstripe
93: [04:26:51] * cloph_away quit (Ping timeout: 272 seconds)
94: [04:44:15] * simon_w has joined #silverstripe
95: [05:02:41] * Marvanni_ quit (Quit: Marvanni_)
96: [05:08:03] * abitran quit (Ping timeout: 260 seconds)
97: [05:08:24] * abitran has joined #silverstripe
98: [07:23:24] * simon_w quit (Quit: Leaving)
99: [09:39:03] * abitran quit (Ping timeout: 240 seconds)
100: [09:39:11] * abitran has joined #silverstripe
101: [11:15:10] * violetina has joined #silverstripe
102: [11:32:25] * Error404NotFound has joined #silverstripe
103: [11:32:31] * Error404NotFound quit (Changing host)
104: [11:32:31] * Error404NotFound has joined #silverstripe
105: [12:01:40] * Error404NotFound quit (Remote host closed the connection)
106: [12:13:16] * Error404NotFound has joined #silverstripe
107: [12:18:06] * Error404NotFound quit (Remote host closed the connection)
108: [12:18:59] * Error404NotFound has joined #silverstripe
109: [12:21:57] * Error404NotFound quit (Remote host closed the connection)
110: [12:23:22] * Error404NotFound has joined #silverstripe
111: [12:40:08] * Error404NotFound quit (Remote host closed the connection)
112: [13:09:37] * openbees has joined #silverstripe
113: [14:11:53] * ARNHOE has joined #silverstripe
114: [14:18:44] * Liquide has joined #silverstripe
115: [15:22:19] * gelignite has joined #silverstripe
116: [15:24:46] * ARNHOE_ has joined #silverstripe
117: [15:26:02] * openbees quit (Read error: Connection reset by peer)
118: [15:26:21] * violet- has joined #silverstripe
119: [15:26:24] * openbees has joined #silverstripe
120: [15:28:46] * ajmitch_ has joined #silverstripe
121: [15:30:40] * openbees quit (Read error: Connection reset by peer)
122: [15:33:24] * ARNHOE quit (*.net *.split)
123: [15:33:24] * violetina quit (*.net *.split)
124: [15:33:25] * ajmitch quit (*.net *.split)
125: [15:46:49] * openbees has joined #silverstripe
126: [16:41:50] * zfmf has joined #silverstripe
127: [16:52:13] * Marvanni_ has joined #silverstripe
128: [17:12:48] * mrzero_ has joined #silverstripe
129: [17:13:25] * mrzero quit (*.net *.split)
130: [17:13:26] * mrzero_ is now known as mrzero
131: [17:19:38] * Azure quit (Ping timeout: 252 seconds)
132: [17:21:06] * violet- quit (Read error: Connection reset by peer)
133: [17:21:17] * violetina has joined #silverstripe
134: [17:21:27] * Azure has joined #silverstripe
135: [17:21:54] * Azure quit (Read error: Connection reset by peer)
136: [17:25:56] * openbees has left #silverstripe
137: [17:45:08] * ARNHOE_ quit ()
138: [17:49:33] * Azure has joined #silverstripe
139: [18:01:26] * Zauberfisch23 quit (Ping timeout: 264 seconds)
140: [18:01:35] * Zauberfisch23 has joined #silverstripe
141: [18:10:29] * Alexwijn has joined #silverstripe
142: [18:11:23] * Alexwijn quit (Client Quit)
143: [18:11:39] * Alexwijn has joined #silverstripe
144: [18:12:04] * Alexwijn quit (Client Quit)
145: [18:12:24] * Alexwijn has joined #silverstripe
146: [18:13:05] * Alexwijn quit (Client Quit)
147: [18:13:23] * Alexwijn has joined #silverstripe
148: [18:13:55] * Alexwijn quit (Client Quit)
149: [18:16:30] * Alexw_ has joined #silverstripe
150: [18:17:59] * Alexw_ quit (Client Quit)
151: [18:20:05] * Alexw_ has joined #silverstripe
152: [18:20:39] <Alexw_> Hi, does anyone know if Silverstripe can work with the Zend Optimizer?
153: [18:20:55] <Alexw_> Because my silverstripe is very slow on PHP 5.5
154: [18:36:03] <guzzlefry> Alexw_: no clue, I've heard that APC helps.
155: [18:36:07] <guzzlefry> I'd guess they're similar?
156: [18:39:22] <Alexw_> APC is obsolete in PHP 5.5
157: [18:40:15] <guzzlefry> 0.o
158: [18:40:36] <Alexw_> Because Zend Optimizer is buildin
159: [18:40:59] <Alexw_> And APC is in very slow development and the latest stable version is from 2011
160: [18:42:24] <guzzlefry> ah
161: [18:42:26] <guzzlefry> well, try it
162: [18:42:31] <Alexw_> Try what?
163: [18:42:40] <Alexw_> APC is 100% compatible with PHP 5.5
164: [18:46:05] <guzzlefry> Try Zend Optimizer.
165: [18:47:20] <Alexw_> I already did
166: [18:47:24] <Alexw_> it is built in
167: [18:48:38] <Alexw_> Ok, appearantly it is not enabled by default
168: [18:48:40] <Alexw_> I enabled it
169: [18:48:45] <Alexw_> Silverstripe stopped responding
170: [18:48:51] <Alexw_> I restarted PHP a second time
171: [18:48:55] <Alexw_> And it seemed to work better now
172: [19:14:21] * abitran quit (Remote host closed the connection)
173: [19:14:31] * abitran has joined #silverstripe
174: [19:17:06] * Marvanni_ quit (Quit: Marvanni_)
175: [19:18:14] <lewellyn> Alexw_: silverstripe works fine with the 5.5 opcache. it also works fine with the opcache + apcu.
176: [19:18:33] <lewellyn> at least that's been my experience.
177: [19:54:06] * Azure quit (Ping timeout: 246 seconds)
178: [19:58:30] * Azure has joined #silverstripe
179: [20:12:41] * mobiusnz quit (Quit: Leaving.)
180: [20:14:14] * Alexw_ quit ()
181: [20:44:08] * mobiusnz has joined #silverstripe
182: [20:47:35] * mobiusnz1 has joined #silverstripe
183: [20:47:36] * mobiusnz quit (Read error: Connection reset by peer)
184: [20:52:07] * mobiusnz1 quit (Ping timeout: 260 seconds)
185: [20:55:09] * mobiusnz has joined #silverstripe
186: [21:08:09] * mobiusnz quit (Ping timeout: 272 seconds)
187: [21:44:41] * zfmf quit ()
188: [21:51:49] * mobiusnz has joined #silverstripe
189: [22:01:13] * SphereSilverNL has joined #silverstripe
190: [22:17:43] * spronk has left #silverstripe
191: [22:37:05] * SphereSilverNL quit (Remote host closed the connection)
192: [22:45:42] * Liquide quit ()
193: [23:22:59] * duramater has joined #silverstripe
194: [23:23:24] <duramater> i have a custom form and template, how do i display a field validation error?
195: [23:25:29] <guzzlefry> I thought that was automatic?
196: [23:25:29] * mobiusnz quit (Quit: Leaving.)
197: [23:25:43] * mobiusnz has joined #silverstripe
198: [23:25:59] <guzzlefry> Well, you'd need to set it in the validator.
199: [23:26:07] <guzzlefry> $form->setMessage() iirc.
200: [23:26:22] * mobiusnz quit (Read error: Connection reset by peer)
201: [23:26:32] * mobiusnz has joined #silverstripe
202: [23:27:20] <duramater> yes, i already have $form->addErrorMessage(
203: [23:27:28] <duramater> but how does this get rendered back on the form
204: [23:27:44] <duramater> i have this in the custom template - $Fields.FieldByName(Email)
205: [23:32:12] <guzzlefry> $form->addErrorMessage("Email"...?
206: [23:34:58] <guzzlefry> hm
207: [23:35:10] <guzzlefry> wonder if you need to manually call Form->setupFormErrors()
208: [23:46:21] <duramater> i can see that the form field is being populated with the error message
209: [23:46:28] <duramater> i just don't know how to render it to screen
210: [23:47:09] <guzzlefry> duramater: it's in the HTML?
211: [23:48:20] <duramater> no.. it's in the FormField object
212: [23:49:01] <guzzlefry> Each FormField has a template afaik.
213: [23:49:09] <guzzlefry> That should get populated with the error.

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