#silverstripe IRC Log

IRC log for 27 February 2017

All timestamps are in UTC.

1: [00:02:44] * DanaeNZ has joined #silverstripe
2: [00:11:26] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
3: [00:50:34] * Nightjar has joined #silverstripe
4: [00:51:00] * Zauberfisch quit (Remote host closed the connection)
5: [00:55:08] * saiyan quit (Ping timeout: 255 seconds)
6: [00:57:07] * saiyan has joined #silverstripe
7: [01:13:02] <DanaeNZ> does loadDataFrom in an Extension even work?
8: [01:13:09] <DanaeNZ> $this->owner->loadDataFrom($data);
9: [01:13:34] <DanaeNZ> It just...doesn't work. It's going through all the motions, setting field values and such. But when it renders on the page the fields are empty
10: [01:49:12] <Nightjar> Gets reset later.
11: [01:50:02] <Nightjar> plonk a stack trace in the function, bet it gets called more than once :>
12: [01:50:10] <Nightjar> will show you where
13: [01:50:30] <Nightjar> Or y'know, a breakpoint. Because it's 2017.
14: [01:51:23] <Nightjar> DanaeNZ, ^
15: [01:51:56] <DanaeNZ> Oo hi
16: [01:52:11] <DanaeNZ> Yes, you were basically right
17: [01:52:30] <DanaeNZ> It's for UserForms - if $UserDefinedForm is in the content it just smacks the form in there
18: [01:52:42] <DanaeNZ> So it doesn't render a form that has all the extension modifications on it
19: [01:53:02] <DanaeNZ> Remove that from Content, it runs through the process including extension hooks
20: [01:56:29] * filisko quit (Ping timeout: 268 seconds)
21: [02:03:47] <Nightjar> o.0 Both (iirc) use $datControllah->Form(), just one dumps it's output in terms of ->forTemplate() into the $content with str_replace
22: [02:04:32] <Nightjar> seems odd there are two paths. Unless there's some second identifier like UserDefinedForm, and Form just calls that then applies extension hooks. Dunno. I'd be dissappoint though.
23: [02:20:56] <DanaeNZ> Nightjar: yeah it just goes forTemplate on $this->Form() which goes through UserForm::create().
24: [02:21:18] <Nightjar> Yeah, but $this->Form should call them hooks like
25: [02:21:40] <DanaeNZ> Yeah the hooks are still called
26: [02:21:48] <DanaeNZ> but then the results just...poof
27: [02:22:08] <DanaeNZ> If you get rid of $UserDefinedForm from the Content, each hook seems to be called twice
28: [02:22:15] <DanaeNZ> I didn't follow the trace very well
29: [02:23:15] <Nightjar> http://i.giphy.com/12NUbkX6p4xOO4.gif
30: [02:23:30] <DanaeNZ> that was my conclusion
31: [02:23:45] <Nightjar> A solid conclusion.
32: [02:24:05] <Nightjar> Now, wtf is a code, and where does it come from, in terms of a Group? :<
33: [02:25:17] <Nightjar> I'm guessing permssion-code, but ... idk. I'm a touch disoriented just now.
34: [02:26:33] * Azure|dc quit (Quit: Oops.)
35: [02:27:08] <Nightjar> I hate you so bad just now :< http://api.silverstripe.org/3.1/source-class-Group.html#231
36: [02:27:44] <DanaeNZ> Ha
37: [02:27:59] <DanaeNZ> there are some functions
38: [02:28:05] <DanaeNZ> addToGroupByCode for members
39: [02:28:16] <Nightjar> so like... if a group with a code that's needed all throughout the system gets removed... how does one go about making a new one!? :o
40: [02:28:18] <DanaeNZ> it saves a slug on write
41: [02:28:37] <Nightjar> Yeah, but there is no group with that code, which is what is causing the issues :<
42: [02:28:44] <DanaeNZ> Lel
43: [02:28:53] <DanaeNZ> Ummmm I usually try put it in requireDefaultRecords
44: [02:29:05] <DanaeNZ> if Group by code does not exist then make it
45: [02:29:06] <Nightjar> might be worth checking out.
46: [02:29:20] <DanaeNZ> that function is so dodge tho, I don't know when it actually is triggered
47: [02:29:23] <Nightjar> but... dev/build will require _all_ the default records. May not be ... desirable.
48: [02:29:43] <Nightjar> only on build.
49: [02:30:22] * Zauberfisch has joined #silverstripe
50: [02:41:32] * Zauberfisch quit (Remote host closed the connection)
51: [02:42:35] * Zauberfisch has joined #silverstripe
52: [02:46:13] <Nightjar> OK, neat. If code is not set, it URLSegmentFilter's the title and sets that as the code.
53: [03:00:53] * Azure has joined #silverstripe
54: [03:40:11] <Nightjar> gg, hf DanaeNZ :>
55: [03:40:14] * Nightjar quit (Quit: Leaving)
56: [03:42:15] <DanaeNZ> o/
57: [03:52:22] * DanaeNZ quit (Remote host closed the connection)
58: [05:08:59] * DarjusIT has joined #silverstripe
59: [05:09:20] <DarjusIT> Hi all how to redirect to 404?
60: [05:52:54] * DanaeNZ has joined #silverstripe
61: [05:57:35] * DanaeNZ quit (Ping timeout: 268 seconds)
62: [06:46:52] * Shrike_Finland has joined #silverstripe
63: [07:44:29] * Eliseth has joined #silverstripe
64: [07:54:24] * DanaeNZ has joined #silverstripe
65: [07:58:27] * DanaeNZ quit (Ping timeout: 240 seconds)
66: [08:36:44] * janneklouman-- has joined #silverstripe
67: [08:41:20] * janneklouman-- quit (Ping timeout: 255 seconds)
68: [09:00:48] * janneklouman-- has joined #silverstripe
69: [09:04:46] * kinglozzer has joined #silverstripe
70: [09:14:25] * filisko has joined #silverstripe
71: [09:36:16] * Firesphere quit (Quit: Bye now)
72: [09:37:54] * Firesphere has joined #silverstripe
73: [09:42:42] * agent44 has joined #silverstripe
74: [09:49:49] * Shrike_Finland quit (Quit: Leaving.)
75: [09:55:17] * DanaeNZ has joined #silverstripe
76: [09:59:24] * DanaeNZ quit (Ping timeout: 240 seconds)
77: [10:18:50] * Shrike_Finland has joined #silverstripe
78: [10:28:29] * jarard01 has joined #silverstripe
79: [10:56:37] * DanaeNZ has joined #silverstripe
80: [11:00:49] * DanaeNZ quit (Ping timeout: 255 seconds)
81: [11:08:21] * Shrike_Finland quit (Quit: Leaving.)
82: [11:14:27] * janneklouman-- quit (Read error: No route to host)
83: [11:17:37] * janneklouman-- has joined #silverstripe
84: [11:20:44] * filisko quit (Ping timeout: 240 seconds)
85: [11:30:16] <ss-helper> where I add card detail to receive payment of subscribe user (customer) in stripe - http://stackoverflow.com/questions/42484528/where-i-add-card-detail-to-receive-payment-of-subscribe-user-customer-in-strip
86: [11:30:30] * samsamek has joined #silverstripe
87: [11:37:43] <cloph> DarjusIT: a *redirect* to a 404 is pretty pointless - what is the usecase where you would want to do something like that?
88: [11:39:19] <DarjusIT> cloph, there is some links in system that only be reachable to logged in users, for those that dont have account links should look like they not exists
89: [11:39:30] <DarjusIT> I have found solution :)
90: [12:05:46] * Shrike_Finland has joined #silverstripe
91: [12:30:17] <ss-helper> Silverstripe How to get datas in SiteConfig from subclasses - http://stackoverflow.com/questions/42029141/silverstripe-how-to-get-datas-in-siteconfig-from-subclasses
92: [12:41:40] * ajmitch quit (Ping timeout: 256 seconds)
93: [12:42:15] * ajmitch has joined #silverstripe
94: [12:43:53] * janneklouman-- quit (Ping timeout: 252 seconds)
95: [12:48:14] * janneklouman-- has joined #silverstripe
96: [12:49:21] * Apc has joined #silverstripe
97: [12:49:21] <ss-helper> Apc: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
98: [12:54:07] <Apc> Would anyone be able to help me out with a .htaccess problem i'm having? It's probably really simple
99: [12:54:22] <Apc> I have a forum post explaining it https://www.silverstripe.org/community/forums/general-questions/show/119735
100: [12:57:13] * DanaeNZ has joined #silverstripe
101: [12:58:15] * agent44 quit (Quit: zzz)
102: [13:01:17] <Zauberfisch> Apc: easy
103: [13:01:56] * DanaeNZ quit (Ping timeout: 260 seconds)
104: [13:03:01] <Zauberfisch> can be done in plain php, SilverStripe or htaccess
105: [13:03:26] <cloph> (or nginx and location blocks :-P)
106: [13:03:35] <Zauberfisch> well,
107: [13:03:36] <Zauberfisch> yes
108: [13:04:03] <Zauberfisch> anyway, I guess I would recommend htaccess of all those options for your usecase
109: [13:04:14] <Zauberfisch> I see 2 mistakes: $1 is probably www.
110: [13:04:24] <Zauberfisch> there is no [L]
111: [13:06:00] <cloph> and of course the .htaccess will only be used if you have your apache vhost set to also server club1.com using the same config..
112: [13:06:05] <Zauberfisch> you'd probably also want a redirect header
113: [13:06:33] <cloph> But if you really want to redirect to mainsite.com/club1,m then the rule must also target http://www.mainsite.com/club1, not just /club1
114: [13:07:45] <Zauberfisch> true
115: [13:08:34] <Zauberfisch> Apc: see this page as an example: http://htaccesscheatsheet.com/#force-www
116: [13:08:37] <Apc> thanks guys, I would want the url to still appear to the user like www.club1.com but to serve the page from www.mainsite.com/club1/ "behind the scenes"
117: [13:09:13] <Apc> so the user thinks it is a seperate website, if that is possible
118: [13:10:10] <Zauberfisch> oh
119: [13:10:15] <Zauberfisch> that's a different story
120: [13:10:42] <Zauberfisch> then I would recommend another aproach
121: [13:10:56] <Zauberfisch> probably best to handle this within silverstripe
122: [13:10:56] <cloph> if you want it to be www.club1.com (and are not OK with www.club1.com/club1 (which silverstripe will happily server the same way as www.mainsite.com/club1), then rewrite is not the way to go. (use alias/proxy instead)
123: [13:11:55] <DarjusIT> I have ClientAddresses page for frontend user, what is best solution for making edit page? just make function, or seperite EditPage?
124: [13:12:31] <cloph> depending on how large your site already has become: maybe the subsite module is what you're really after?
125: [13:12:46] <cloph> (it is not limited to subsites, but can also be used for completely different domains)
126: [13:13:43] <cloph> so if you don't mine writing a admin thingie to move your pages from /club1 hierarchy to a new subsite (and tweak whatever templating hacks you used to make those work without an additional /club1 as part of the URL....)
127: [13:13:56] <cloph> TMWTDI
128: [13:15:16] <Apc> will take a look at that module, I have 80+ clubs set up with lots of subpages so a solution without having to alter the site would be ideal though
129: [13:16:12] <Apc> maybe the rewrite can be done within silverstripe like @Zauberfisch said?
130: [13:16:41] <cloph> do you already have a solution to the "links in the page should not include the club1 pathelement" when rewriting that to a different domain? In other words: is your navigation already flexible enough/using relative links based on that starting point?
131: [13:16:52] <Zauberfisch> https://packagist.org/packages/silverstripe/homepagefordomain
132: [13:18:03] <Apc> yeah, I came up with a solution for that which uses a CMS field on each club with the domain
133: [13:18:03] <cloph> that only affects access via www.domain.com without any specific page name (like www.domain.com/home) - but won't have any impact on navigation/base-URL
134: [13:19:12] <cloph> so ok/easiest if www.club1.com/club1/pagename is OK to have
135: [13:23:10] <cloph> (I'd be fine if silverstripe would default to the first page in page-tree when there is no page with /home segment, rather than going into redirect loop ;-> )
136: [13:25:40] <Apc> would it be possible to then strip out the /club1/pagename within silverstripe?
137: [13:26:42] <cloph> it is possible, but that would require you to override the Link function (or similar) - although not 100% what you mean with "then" - when using what approach?
138: [13:27:04] <cloph> With just using different homepage: saves you the redirect dance in htaccess, but nothing else.
139: [13:27:57] <cloph> (and will not allow you to strip out the /club1/ part, without doing htaccess dance for that again (or custom director rules)
140: [13:28:25] <Apc> was thinking if I just parked the domain so mainsite.com and club1.com were the same
141: [13:29:47] <Apc> then I could make some changes in framework/main.php to convert to the right path if the domain given was club1.com (adding /club1/)
142: [13:32:11] <cloph> wouldn't touch framework/main in that case..
143: [13:33:20] <cloph> rather would add different htaccess rule to the domain, that would point to main.php?url=/club1/… instead (and then have your custom rules to strip out the toplevel page in your Link/navigation stuff.
144: [13:33:53] <cloph> (or rather: I'd use cvs exporter/importer to migrate it to subsites module and not having to bother with all that :-P)
145: [13:34:34] <Apc> makes sense, i'll experiment with that
146: [13:35:16] <Apc> appreciate the help btw
147: [13:37:47] <cloph> looking around: http://addons.silverstripe.org/add-ons/silverstripe/multi-domain sounds like what you're looking for I guess.
148: [13:43:44] <Apc> looks promising, will install and give it a go
149: [13:49:04] * UndefinedOffset has joined #silverstripe
150: [13:49:37] * filisko has joined #silverstripe
151: [14:18:22] * janneklouman-- quit (Ping timeout: 264 seconds)
152: [14:22:14] * agent44 has joined #silverstripe
153: [14:30:17] * mrG has joined #silverstripe
154: [14:30:43] * Shrike_Finland quit (Quit: Leaving.)
155: [14:30:58] <mrG> How can i include TreeBaseID in setTreeBaseID when using TreeDropdownField
156: [14:31:01] * Shrike_Finland has joined #silverstripe
157: [14:31:49] * Shrike_Finland quit (Client Quit)
158: [14:31:54] <mrG> i.e. i want to ask users to chose a page in a subsection of a site tree . including the parent with ID as i set as setTreeBaseID
159: [14:37:00] * janneklouman-- has joined #silverstripe
160: [14:43:01] * agent44 quit (Quit: zzz)
161: [15:09:15] * mrG quit (Ping timeout: 260 seconds)
162: [16:21:13] * agent44 has joined #silverstripe
163: [16:25:52] * filisko quit (Ping timeout: 260 seconds)
164: [16:30:48] * Parker1090 has joined #silverstripe
165: [16:31:58] <Parker1090> Hello :)
166: [16:34:08] * samsamek quit (Quit: samsamek)
167: [16:35:40] <Parker1090> I'm looking for a bit of help with a form. I've got a testimonials page (with a very original name of 'TestimonialPage'), and want to add the ability to post new testimonials. So far, all I have is a form with 5 fields and a recaptcha using the code here: http://www.sspaste.com/paste/show/58b454ea77f56. However, this doesn't seem to do anything when you click 'Submit', it looks as if it just reloads the page
168: [16:36:11] <Parker1090> I'm at a bit of a loss with this one, so any pointers massively appreciated. I'm guessing there's likely to be an issue with the doSubmit function, but I've not got that far yet to find out
169: [16:42:06] <kinglozzer> Parker1090: You probably need to add 'add' to your allowed_actions
170: [16:42:26] <Parker1090> Thanks! I didn't post that part, but it is there
171: [16:42:54] <Parker1090> Should I have added 'doSubmit' there too?
172: [16:43:00] <kinglozzer> Oh, I see what's going on
173: [16:43:01] <kinglozzer> No
174: [16:43:35] <kinglozzer> Break the form out of the add() function (name it something like AddForm())
175: [16:43:53] <kinglozzer> It should return $form;, otherwise SilverStripe can't find it when it submits
176: [16:44:08] <Parker1090> Oh, I see
177: [16:45:14] <kinglozzer> Parker1090: http://www.sspaste.com/paste/show/58b4579117994 something like that
178: [16:45:24] <kinglozzer> Then you'll need to use $AddForm in your template instead of $Form
179: [16:46:02] * Eliseth quit (Quit: Textual IRC Client: www.textualapp.com)
180: [16:47:39] <Parker1090> I was trying to create it as a sub-page of /testimonials/, so it could be access from /testimonials/add/ for example
181: [16:47:53] <cloph> isn't Link with get parameter "abuse" of Link? "Please use Controller::join_links() instead to append GET parameters."
182: [16:48:11] <kinglozzer> Parker1090: As long as 'add' is still in your allowed_actions you can do that
183: [16:48:14] <cloph> could still have that. Render with...add template and just call $FormHere or whatever in your template
184: [16:48:20] <Parker1090> Ok, thanks. I'll give it a go and come back to you ;)
185: [16:48:25] <kinglozzer> It will automatically use TestimonialPage_add.ss, even without an add() function
186: [16:49:42] * samsamek has joined #silverstripe
187: [16:49:44] * janneklouman-- quit (Ping timeout: 240 seconds)
188: [16:52:30] * Apc quit (Ping timeout: 260 seconds)
189: [16:59:37] <Parker1090> kinglozzer: I've updated the code (hopefully done it right). Updated, full paste here: http://www.sspaste.com/paste/show/58b45a9c12787
190: [16:59:57] <Parker1090> As suggested, the template then called $AddForm
191: [17:00:44] <Parker1090> It does now redirect back to the form, and repopulate with data. But it doesn't show any errors (e.g. when I leave the reCaptcha blank)
192: [17:01:20] <kinglozzer> Parker1090: You're calling ->enableSpamProtection() twice, could it be that?
193: [17:01:32] <Parker1090> Oh, ignore me - my fault! Didn't change part of the template
194: [17:01:49] <Parker1090> Didn't notice the spam protection being called twice though - thanks for that!
195: [17:03:32] <Parker1090> Thanks for your help - much appreciated! Not sure where you're from, but it's 5pm in the UK, so have a good evening :)
196: [17:06:46] <kinglozzer> Parker1090: Yup, UK here too!
197: [17:07:46] * Parker1090 quit (Quit: Page closed)
198: [17:30:51] * kinglozzer quit ()
199: [17:44:36] * Shrike_Finland has joined #silverstripe
200: [18:03:14] * janneklouman-- has joined #silverstripe
201: [18:03:59] * mrG has joined #silverstripe
202: [18:13:49] * agent44 quit (Quit: zzz)
203: [18:24:39] * Shrike_Finland quit (Quit: Leaving.)
204: [19:00:03] * DanaeNZ has joined #silverstripe
205: [19:04:32] * DanaeNZ quit (Ping timeout: 260 seconds)
206: [19:51:13] * DanaeNZ has joined #silverstripe
207: [20:26:42] * filisko has joined #silverstripe
208: [20:27:34] * samsamek quit (Quit: samsamek)
209: [21:00:27] <ss-helper> How do I programatically add a new Page to Silverstripe? - http://stackoverflow.com/questions/21780380/how-do-i-programatically-add-a-new-page-to-silverstripe
210: [21:21:32] * UndefinedOffset quit (Quit: Leaving.)
211: [21:27:09] * janneklouman-- quit (Ping timeout: 240 seconds)
212: [21:34:05] * gelignite has joined #silverstripe
213: [21:34:28] * gelignite quit (Read error: Connection reset by peer)
214: [21:37:45] * gelignite has joined #silverstripe
215: [22:01:58] * janneklouman-- has joined #silverstripe
216: [23:00:02] * ss-helper quit (Remote host closed the connection)
217: [23:00:18] * ss-helper has joined #silverstripe
218: [23:15:53] * DarjusIT quit (Quit: Leaving)
219: [23:49:08] <DanaeNZ> Wish you could vote on PRs
220: [23:49:08] <DanaeNZ> https://github.com/heyday/silverstripe-cacheinclude/pull/25
221: [23:49:27] * janneklouman-- quit (Ping timeout: 240 seconds)

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