#silverstripe IRC Log

IRC log for 12 April 2014

All timestamps are in UTC.

1: [00:05:55] * simon_w|air quit (Quit: This computer has gone to sleep)
2: [00:49:04] * joelpittet has joined #silverstripe
3: [00:53:18] * joelpitt_ has joined #silverstripe
4: [00:53:35] * joelpittet quit (Ping timeout: 250 seconds)
5: [01:09:12] * UncleCheese_ quit (Quit: UncleCheese_)
6: [01:11:02] * UncleCheese has joined #silverstripe
7: [01:25:55] * DesignerX has joined #silverstripe
8: [01:28:28] * UncleCheese quit (Quit: UncleCheese)
9: [01:32:01] * UncleCheese has joined #silverstripe
10: [01:37:00] * UncleCheese quit (Ping timeout: 276 seconds)
11: [01:39:55] * UncleCheese has joined #silverstripe
12: [01:56:06] * DesignerX quit (Ping timeout: 240 seconds)
13: [02:20:21] * Motoko has joined #silverstripe
14: [02:20:54] <Motoko> Okay, I'm sure I'll probably be told that I'm doing something wrong, but maybe I'm just running into odd behavior, so I'll see if anyone has ideas.
15: [02:21:04] <Motoko> I have two page types that are very similar.
16: [02:21:22] <Motoko> A "personnel" page, and a "riskpersonnel" page.
17: [02:21:46] <Motoko> In the $db variable, I have an enum set.
18: [02:22:03] <Motoko> RiskPersonnel extends Personnel (which extends Page).
19: [02:22:38] <Motoko> When I do a db build and then try to add a RiskPersonnel page, the field with the enum shows the values in Personnel, not the values I set in RiskPersonnel.
20: [02:23:03] <Motoko> Should the values in $db be overwritable or not?
21: [02:24:13] <Motoko> If I didn't make sense, let me know.
22: [02:35:32] <Zauberfisch> Motoko: so you are redefining a DB variable in a subclass?
23: [02:35:40] <Zauberfisch> I think that's not working in silverstripe
24: [02:35:46] <Zauberfisch> not sure though
25: [02:35:57] <Motoko> Yeah.
26: [02:36:14] <Motoko> I wonder if I can add an extra field.
27: [02:36:39] <Motoko> I mean, I can go ahead and just duplicate the code, but where's the fun in that?
28: [02:37:15] <Zauberfisch> if I was you, I'd probably just change that field to a varchar
29: [02:37:28] <Zauberfisch> thus you don't need to overwrite it in the subclass
30: [02:37:50] <Motoko> It's an enum because I want a selectable list of values.
31: [02:40:09] * joelpitt_ quit (Remote host closed the connection)
32: [02:40:59] <Motoko> I think I'll first try and see if I can add extra values. Then I'll probably just split it apart and duplicate the code.
33: [02:42:15] * joelpittet has joined #silverstripe
34: [02:42:56] * UncleCheese quit (Quit: UncleCheese)
35: [02:43:44] * UncleCheese has joined #silverstripe
36: [02:45:12] <Zauberfisch> Motoko: you could create 3 classes
37: [02:45:23] * joelpittet quit (Client Quit)
38: [02:45:27] <Zauberfisch> BasePersonelPage extends Page {
39: [02:45:28] <Zauberfisch> ...
40: [02:45:32] * joelpittet has joined #silverstripe
41: [02:45:39] <Zauberfisch> public function canCreate($m = null) {return false;}
42: [02:45:41] <Zauberfisch> }
43: [02:46:07] <Zauberfisch> class PersonnelPage extends BasePersonnelPage {}
44: [02:46:10] <Zauberfisch> class RiskPersonnelPage extends BasePersonnelPage {}
45: [02:47:30] * UncleCheese quit (Client Quit)
46: [02:47:35] <Motoko> I'll also try that in a bit.
47: [02:48:46] <Zauberfisch> since BasePersonellPage returns false on canCreate(), it shouldn't show up in the CMS
48: [02:49:01] <Zauberfisch> (obviously you need to overwrite canCreate() in the subclasses again
49: [02:49:06] <Zauberfisch> )
50: [02:50:43] <Zauberfisch> or a more specific canCreate()
51: [02:50:47] <Zauberfisch> that might be easier
52: [02:50:52] <Zauberfisch> like so: http://paste2.org/wE70cbEn
53: [02:52:33] <Zauberfisch> bed time
54: [02:52:35] <Zauberfisch> good night
55: [03:12:33] * CodeTrap1 quit (Ping timeout: 276 seconds)
56: [03:12:41] * CodeTrap has joined #silverstripe
57: [03:25:05] * cloph quit (Ping timeout: 258 seconds)
58: [03:37:09] * violetina quit (Remote host closed the connection)
59: [04:42:46] * joelpittet quit (Remote host closed the connection)
60: [05:10:14] * joelpittet has joined #silverstripe
61: [05:20:23] * joelpittet quit (Remote host closed the connection)
62: [05:47:42] * Colin[pi] quit (Ping timeout: 240 seconds)
63: [05:58:31] * DesignerX has joined #silverstripe
64: [06:17:26] * jordanmk has joined #silverstripe
65: [06:17:38] <jordanmk> yo, anyone here on a Saturday arvo? lol
66: [06:18:49] <jordanmk> well in case anyone is here to see this
67: [06:23:51] <jordanmk> i've got a page that needs to be only accessible for a subset of members. if someone visits the page and is not one of those members, they need to be redirected to another page. i managed to get this functionality working by putting the checks and subsequent redirect into the page's init() function
68: [06:26:41] <jordanmk> to be more specific, users who attempt to visit /PageName and are not part of the subset of members with access to it would be redirected to /PageName/SomethingElse
69: [06:30:22] <jordanmk> the page /PageName/SomethingElse has a form on it and when a user (who doesn't have access to the 'parent' /PageName) would submit that form, the page would reload and then my check in the init() method would redirect them to /PageName/SomethingElse and the form's doFormSubmit() method would not get run, so the form would not actually get processed
70: [06:31:12] <jordanmk> so obviously my solution of putting the check and redirect in the init() method is not viable
71: [06:32:42] <jordanmk> what would be the best way to do what i'm trying to do? i think I could potentially just have a function CheckAccess() which does the check and redirect and then put $CheckAccess somewhere in the page's template, but it feels like that's not the best solution
72: [07:39:52] * violetina has joined #silverstripe
73: [07:47:35] * UncleCheese has joined #silverstripe
74: [07:47:39] * spronk has joined #silverstripe
75: [08:28:28] <jordanmk> anyone here?
76: [08:49:53] * Shrike_Finland has joined #silverstripe
77: [08:57:49] <UncleCheese> hi
78: [08:59:17] * chr1stopher has joined #silverstripe
79: [09:48:15] <jordanmk> hi UncleCheese :)
80: [09:48:21] <UncleCheese> hey
81: [09:50:25] <jordanmk> i've got a page, lets call it /PageName, that should only be accessible to a certain group of users. users who don't have access should be redirected to /PageName/SomethingElse
82: [09:50:55] <jordanmk> i managed to get this functionality working by adding code to the page's init() function which checks if the user has access, and redirects them if they don't
83: [09:51:46] <jordanmk> when a user is redirected to /PageName/SomethingElse, there's a form on the page. when a user (who doesn't have access to the 'parent' /PageName) would submit that form, the page would reload and then my check in the init() method would redirect them to /PageName/SomethingElse and the form's doFormSubmit() method would not get run, so the form woul
84: [09:51:46] <jordanmk> d not actually get processed
85: [09:51:55] <jordanmk> so obviously my solution of putting the check and redirect in the init() method is not viable
86: [09:52:01] <jordanmk> what would be the best way to do what i'm trying to do? i think I could potentially just have a function CheckAccess() which does the check and redirect and then put $CheckAccess somewhere in the page's template, but it feels like that's not the best solution
87: [10:36:16] * chr1stopher has left #silverstripe
88: [10:40:45] <UncleCheese> jordanmk: your /somethingelse/ is a controller action?
89: [10:43:50] <UncleCheese> if that’s the case, you want to do your check in the index() action.
90: [10:44:21] <UncleCheese> Or, if there are other actions you want to block, then just hijack the handleAction() method, or even the handleRequest method do get it to do what you want
91: [10:44:31] <UncleCheese> either way, init() is not an appropriate place to be doing stuff like that.
92: [10:46:15] * boytikz has left #silverstripe
93: [11:16:36] * Shrike_Finland quit (Quit: Leaving.)
94: [11:25:22] * UncleCheese quit (Quit: UncleCheese)
95: [11:28:47] <Zauberfisch> jordanmk: silverstripe allows to define a function for permissions in the allowed_actions
96: [11:29:17] <Zauberfisch> doc.silverstripe.org/framework/en/topics/controller#access-control
97: [11:29:24] <Zauberfisch> http://doc.silverstripe.org/framework/en/topics/controller#access-control
98: [11:29:34] <Zauberfisch> read the section Access Control
99: [11:30:05] <Zauberfisch> // complexaction can only be accessed if $this->canComplexAction() returns true
100: [11:30:08] <Zauberfisch> 'complexaction' '->canComplexAction'
101: [11:30:15] <Zauberfisch> 'foobar' '->canComplexAction'
102: [11:30:38] <Zauberfisch> this way foobar and complexaction both use $this->canComplexAction() to check if its allowed
103: [11:31:01] <Zauberfisch> however, there is probably one problem: not sure if you can control the error message if you don't have permission
104: [11:31:21] <Zauberfisch> so on second thought, perhaps not what you where looking for
105: [11:51:37] * babak has joined #silverstripe
106: [12:06:12] * LoveDuckie has joined #silverstripe
107: [12:06:17] * LoveDuckie quit (Remote host closed the connection)
108: [12:06:32] * LoveDuckie has joined #silverstripe
109: [12:28:08] * Shrike_Finland has joined #silverstripe
110: [12:40:35] * Shrike_Finland quit (Quit: Leaving.)
111: [12:42:43] * joelpittet has joined #silverstripe
112: [13:04:55] * joelpittet quit (Remote host closed the connection)
113: [13:05:19] * joelpittet has joined #silverstripe
114: [13:05:23] * joelpittet quit (Remote host closed the connection)
115: [13:15:00] * joelpittet has joined #silverstripe
116: [13:47:37] * joelpittet quit (Remote host closed the connection)
117: [14:13:19] * joelpittet has joined #silverstripe
118: [14:18:35] * babak quit (Quit: Connection closed for inactivity)
119: [15:47:17] * DesignerX quit (Ping timeout: 252 seconds)
120: [15:56:45] * Liquide quit ()
121: [16:51:42] * joelpittet quit (Remote host closed the connection)
122: [16:54:00] * joelpittet has joined #silverstripe
123: [16:59:59] * joelpittet quit (Remote host closed the connection)
124: [17:08:23] * gelignite has joined #silverstripe
125: [17:30:50] * joelpittet has joined #silverstripe
126: [17:34:02] * joelpittet quit (Remote host closed the connection)
127: [17:42:55] * joelpittet has joined #silverstripe
128: [18:14:24] * Shrike_Finland has joined #silverstripe
129: [18:17:07] * cloph_away has joined #silverstripe
130: [18:22:50] * simon_w|air has joined #silverstripe
131: [18:32:45] * Shrike_Finland quit (Quit: Leaving.)
132: [18:34:33] * simon_w|air quit (Quit: This computer has gone to sleep)
133: [19:04:46] * joelpittet quit (Remote host closed the connection)
134: [19:13:29] * joelpittet has joined #silverstripe
135: [19:21:51] * Motoservo quit (Read error: Connection reset by peer)
136: [19:21:56] * Motoservo_ has joined #silverstripe
137: [19:27:35] * qlex has joined #silverstripe
138: [19:27:40] * qlex has left #silverstripe
139: [19:31:17] * joelpittet quit (Remote host closed the connection)
140: [19:56:41] * babak has joined #silverstripe
141: [20:08:49] * joelpittet has joined #silverstripe
142: [20:55:03] * simon_w|air has joined #silverstripe
143: [20:58:23] * joelpittet quit (Remote host closed the connection)
144: [21:11:19] <simon_w|air> So, what's the haps?
145: [21:20:21] <jordanmk> hey simon_w :)
146: [22:10:02] * nbezzala has joined #silverstripe
147: [22:28:37] * babak quit (Quit: Connection closed for inactivity)
148: [22:46:00] * joelpittet has joined #silverstripe
149: [22:48:12] * UncleCheese_ has joined #silverstripe
150: [22:50:01] * Colin[pi] has joined #silverstripe
151: [23:03:06] * joelpittet quit (Remote host closed the connection)
152: [23:07:41] <simon_w|air> Dammit, GridFieldBulkManager doesn't support bulking adding
153: [23:08:10] <Colin[pi]> curses
154: [23:08:24] <simon_w|air> Is there something that does?
155: [23:14:47] <Colin[pi]> write it yourself!
156: [23:15:19] <simon_w|air> Sounds like effort, which I'm not putting into this site :p
157: [23:15:24] <Colin[pi]> ;P
158: [23:15:37] <Colin[pi]> u still in the US?
159: [23:16:05] <simon_w|air> Nope
160: [23:16:10] <Colin[pi]> oh wow that was quick
161: [23:16:14] * UncleCheese_ quit (Quit: UncleCheese_)
162: [23:16:15] * simon_w has joined #silverstripe
163: [23:16:47] <Colin[pi]> how was it?
164: [23:17:35] <simon_w|air> Good
165: [23:19:43] * muskie9 has joined #silverstripe
166: [23:28:18] * UncleCheese_ has joined #silverstripe
167: [23:30:33] <simon_w|air> I'm going to have to write an XHP wrapper for SilverStripe.
168: [23:31:17] * DesignerX has joined #silverstripe
169: [23:32:28] <Colin[pi]> that would be pretty cool
170: [23:51:44] * violetina quit (Remote host closed the connection)
171: [23:59:50] * muskie9 quit (Remote host closed the connection)

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