# |
Jun 28th 2017, 19:18 |
jeremyharris |
like ->combine(‘description’, function ($entity) { return $entity->childArray ?? ‘something else’; }); |
# |
Jun 28th 2017, 19:17 |
gutts |
so instead of ->combine('description', 'childArray'); pass 2 callbacks and return a dynamic value? |
# |
Jun 28th 2017, 19:16 |
gutts |
you mean a callback? |
# |
Jun 28th 2017, 19:16 |
jeremyharris |
gutts you can pass a callable as the argument, and check within that callable |
# |
Jun 28th 2017, 19:16 |
gutts |
so the optgroup label itself is selectable.. but with its own id |
# |
Jun 28th 2017, 19:16 |
gutts |
i want to ->combine('description', 'childArray') when 'childArray' is not empty. otherwise i want to nest the row under itself ( for an optgroup ) |
# |
Jun 28th 2017, 19:15 |
gutts |
how can I differentiate a combine() based on if a given property is a non empty array? |
# |
Jun 28th 2017, 19:06 |
chris-andre |
Yes, multiple rules will be triggered on the same field. If I post an empty organization number, both notEmpty() and customRuleMethod() is returned as an error in the entity. |
# |
Jun 28th 2017, 19:05 |
saeideng |
other rule for same validation not trigger |
# |
Jun 28th 2017, 19:04 |
saeideng |
if one of that return false |
# |
Jun 28th 2017, 19:04 |
chris-andre |
The case is; Either name or organization number has to have a valid value. If name is empty, then organization number has to have a valid value. If organization number is empty, then name has to have a value. |
# |
Jun 28th 2017, 19:04 |
saeideng |
probably |
# |
Jun 28th 2017, 19:03 |
chris-andre |
Yea. Or applied. If I add a notEmpty() rule to a field and then posts a empty field, then the custom rule is applied as well. |
# |
Jun 28th 2017, 19:01 |
saeideng |
name and organization_number ? |
# |
Jun 28th 2017, 19:01 |
saeideng |
? |
# |
Jun 28th 2017, 19:01 |
saeideng |
>My custom rule is only triggered if another rule is triggered |
# |
Jun 28th 2017, 18:58 |
chris-andre |
That didn't work @steinkel |
# |
Jun 28th 2017, 18:29 |
steinkel |
try using a different alias in line 22 |
# |
Jun 28th 2017, 17:56 |
chris-andre |
Any idea someone? |
# |
Jun 28th 2017, 17:55 |
chris-andre |
Can't figure out my issue with validating. My custom rule is only triggered if another rule is triggered. https://gist.github.com/chris-andre/4e6d9bda6d671feb3a529654b931fe05#file-customerstable-php-L23 |
# |
Jun 28th 2017, 17:44 |
saeideng |
try this `aclKey => 'user_type_id` |
# |
Jun 28th 2017, 17:28 |
saeideng |
for 3.x you can |
# |
Jun 28th 2017, 17:28 |
saeideng |
? |
# |
Jun 28th 2017, 17:28 |
saeideng |
jarad you need use `user_type_id` instead of `user_id` |
# |
Jun 28th 2017, 17:11 |
jarard |
I think this does it : aclModel => 'Group' |
# |
Jun 28th 2017, 17:05 |
jarard |
dereuromark - if I want to use TinyAuth for a pre-existing 2.x App is it possible to configure the Plugin to user UserTypes rather than Roles since the Users table has already uses user_type_id |
# |
Jun 28th 2017, 16:50 |
jarard |
and I don't see a folder relating to debug kit in vendor |
# |
Jun 28th 2017, 16:49 |
jarard |
odd behvior here - installed debug kit via composer but getting an error message that it is missing |
# |
Jun 28th 2017, 16:41 |
hmic |
it's not about the session, it's the cookie only. cake will handle the session if the cookie is present |
# |
Jun 28th 2017, 16:38 |
pedroseco |
what is the name of the header the $.post needs so my method knows it’s authenticated? |
# |
Jun 28th 2017, 16:37 |
jarard |
in my composer.json: "friendsofcake/crud" : "3.*", |
# |
Jun 28th 2017, 16:37 |
pedroseco |
*right. |
# |
Jun 28th 2017, 16:37 |
pedroseco |
yes you were write I can get the session |
# |
Jun 28th 2017, 16:37 |
jarard |
i just ran compser update and no in my 2.x app I am getting: Plugin Crud could not be found. |
# |
Jun 28th 2017, 16:35 |
hmic |
it should just work by default IMHO |
# |
Jun 28th 2017, 16:34 |
pedroseco |
I’ll try that approach. thanks |
# |
Jun 28th 2017, 16:34 |
pedroseco |
I see your point |
# |
Jun 28th 2017, 16:34 |
hmic |
just check in the network debugging tab of your browser. if it's missing, you need to make sure the JS sends it... |
# |
Jun 28th 2017, 16:33 |
hmic |
you should do nothing. the AJAX request the JS sends will have the correct cookie anyways |
# |
Jun 28th 2017, 16:33 |
pedroseco |
so I should just ask for the currrent session cookie? |
# |
Jun 28th 2017, 16:32 |
hmic |
the JS can easily - and the browser would by default i think, send the auth cookie back. no problems at all |