# |
Feb 18th 2020, 10:03 |
FunkadelicRelic |
@ndm - Thanks again - I'm going to check that out - brb. |
# |
Feb 18th 2020, 10:03 |
Tropix |
pleas can sameone help me to fix this problem |
# |
Feb 18th 2020, 10:03 |
ndm |
Like ```public function beforeMarshal(\Cake\Event\Event $event, \ArrayObject $data, \ArrayObject $options) { // ... $data['recommendations']['_ids'] = $arrayOfRecommedationPrimaryKeys; }``` https://pastebin.com/1TWSExQP |
# |
Feb 18th 2020, 10:03 |
Tropix |
Hi |
# |
Feb 18th 2020, 10:00 |
ndm |
I didn't mean to say that you should _save_ the data in `beforeMarshal`, just that you should modify it there, so that in your controller you'll receive the proper data required for saving your associations! |
# |
Feb 18th 2020, 09:59 |
FunkadelicRelic |
The assessment saves OK, but no related recommendations. |
# |
Feb 18th 2020, 09:58 |
FunkadelicRelic |
For simplicity I'm just getting the first reccomendation with ID 1 until I understand what's going on - then the idea is I will get all the recommendations based on something in the add form the user has selected. |
# |
Feb 18th 2020, 09:58 |
FunkadelicRelic |
$data->recommendations = $recs; |
# |
Feb 18th 2020, 09:58 |
FunkadelicRelic |
} |
# |
Feb 18th 2020, 09:58 |
FunkadelicRelic |
$recs = TableRegistry::getTableLocator()->get('Recommendations')->get(1); |
# |
Feb 18th 2020, 09:58 |
FunkadelicRelic |
{ |
# |
Feb 18th 2020, 09:58 |
FunkadelicRelic |
public function beforeMarshal(\Cake\Event\Event $event, \ArrayObject $data, \ArrayObject $options) |
# |
Feb 18th 2020, 09:57 |
FunkadelicRelic |
I have an assessment that I would like to save with associated recommendations. In beforeMarshal I'm getting a recommendation but I don't know how to add it to the assessment. |
# |
Feb 18th 2020, 09:56 |
FunkadelicRelic |
Hey all - I'm trying to save some related data in beforeMarshal but not having much luck - I'm definitely doing something wrong. |
# |
Feb 18th 2020, 09:52 |
alexdd55976 |
any ideas? |
# |
Feb 18th 2020, 09:52 |
alexdd55976 |
plus: i habe no code completion on the parameters that the element expects |
# |
Feb 18th 2020, 09:51 |
alexdd55976 |
calling an element through a helper does not look natural, but whats the better way? adding a bunch of paramters into `$this->element('foo', [])`does not seem right either |
# |
Feb 18th 2020, 09:43 |
kaliel |
i'm trying to make it out but for now i still got a 403, maybe because i have the RequestAuthorizationMiddleware after the AuthorizationMiddleware |
# |
Feb 18th 2020, 09:42 |
challgren |
@kaliel it is in the docs https://book.cakephp.org/authorization/2/en/middleware.html#handling-unauthorized-requests |
# |
Feb 18th 2020, 09:30 |
kaliel |
my thought is that many people will need this, should it be added to the docs ? |
# |
Feb 18th 2020, 09:29 |
jotpe |
np :fist: |
# |
Feb 18th 2020, 09:29 |
kaliel |
@jotpe wow this is exactly what i need !!! |
# |
Feb 18th 2020, 09:28 |
kaliel |
i'll give a look thx a lot |
# |
Feb 18th 2020, 09:27 |
jotpe |
https://github.com/cakephp/authorization/blob/master/docs/en/middleware.rst#handling-unauthorized-requests |
# |
Feb 18th 2020, 09:27 |
jotpe |
@kaliel I didn't try myself, but did you try to set the RedirectHandler in the middleware? |
# |
Feb 18th 2020, 09:27 |
neon1024 |
`composer require dereuromark/doorbell` |
# |
Feb 18th 2020, 09:20 |
challgren |
And I wouldnt get to pester @dereuromark as much! |
# |
Feb 18th 2020, 09:19 |
challgren |
Plus if I worked normal hours I’d miss out on all the time hanging with yall |
# |
Feb 18th 2020, 09:19 |
challgren |
My door bell is through my phone, callbox for apartment complex |
# |
Feb 18th 2020, 09:18 |
challgren |
One client sent a messenger service to my place once |
# |
Feb 18th 2020, 09:18 |
kaliel |
doror bell ? |
# |
Feb 18th 2020, 09:18 |
spriz |
:) |
# |
Feb 18th 2020, 09:18 |
spriz |
Damn you people |
# |
Feb 18th 2020, 09:18 |
challgren |
Oh theres times I turn the phone off and blackhole gmail.com but people find a way |
# |
Feb 18th 2020, 09:18 |
spriz |
Rent a place - keep the address secret and turn off the phone before entering it ;P |
# |
Feb 18th 2020, 09:17 |
challgren |
@kaliel I hear yah, I’m dealing with the same issue. Havent found a solution just yet |
# |
Feb 18th 2020, 09:17 |
kaliel |
i'd like to achieve the same i was doing in 3.8 eg redirect to /login if url is prefixed and use role dont match that prefix |
# |
Feb 18th 2020, 09:16 |
jotpe |
@challgren you need a mancave w/o mobile reception :) |
# |
Feb 18th 2020, 09:16 |
kaliel |
yes sure, but i was looking for a redirect with the Authorization plugin |
# |
Feb 18th 2020, 09:15 |
challgren |
@kaliel its unauthenticatedRedirect https://github.com/cakephp/authentication/commit/0631e449e1d1fbefebc33aad4f4b8406cc14704a |
# |
Feb 18th 2020, 09:13 |
challgren |
Too many people bug me during the daytime hours |