# |
Jan 4th 2019, 20:55 |
ricksaccous |
tbh |
# |
Jan 4th 2019, 20:55 |
ricksaccous |
child is actually just an array of data |
# |
Jan 4th 2019, 20:53 |
ricksaccous |
ugh |
# |
Jan 4th 2019, 20:53 |
ricksaccous |
my use case is weird because the parent entity is represented by a table but child entity is not really |
# |
Jan 4th 2019, 20:52 |
ricksaccous |
under the correct conditions |
# |
Jan 4th 2019, 20:52 |
jeremyharris |
you can maybe use a table rule to do this though |
# |
Jan 4th 2019, 20:52 |
ricksaccous |
I'm opting to just do $this->Form->error('field') under the desired field |
# |
Jan 4th 2019, 20:52 |
jeremyharris |
actually I don’t think they will. validators only validate a flat array, they aren’t aware that the data is an entity or should has “children” |
# |
Jan 4th 2019, 20:50 |
jeremyharris |
you can use nested validators though. they might do the trick |
# |
Jan 4th 2019, 20:50 |
jeremyharris |
or are you asking for the validator to set the error? because it cannot |
# |
Jan 4th 2019, 20:49 |
jeremyharris |
setError on the entity |
# |
Jan 4th 2019, 20:04 |
ricksaccous |
i want to place the error on the first related entity to the parent entity |
# |
Jan 4th 2019, 20:03 |
ricksaccous |
if validation fails on the parent entity |
# |
Jan 4th 2019, 20:03 |
ricksaccous |
on a related entity |
# |
Jan 4th 2019, 20:03 |
ricksaccous |
how do i place an error |
# |
Jan 4th 2019, 19:13 |
jhall |
thanks |
# |
Jan 4th 2019, 19:13 |
jhall |
yeah true |
# |
Jan 4th 2019, 19:13 |
jeremyharris |
I like to explicitly call ->decrypt so it doesn’t accidentally leak sensitive information |
# |
Jan 4th 2019, 19:12 |
jhall |
oh ok that might be the way to go |
# |
Jan 4th 2019, 19:12 |
jeremyharris |
I use a custom EncryptedStringType that does it all at the db type level, which creates an object that has a ->decrypt() method on it |
# |
Jan 4th 2019, 19:11 |
jeremyharris |
probably an accessor |
# |
Jan 4th 2019, 19:11 |
jhall |
I tried afterFind but it does not appear to being called |
# |
Jan 4th 2019, 19:11 |
jhall |
What is the best model callback to use to decrypt some data before I display it in the template? |
# |
Jan 4th 2019, 19:10 |
Bambino |
Thank you! I will start doing this. |
# |
Jan 4th 2019, 19:09 |
dereuromark |
for bake not even that is needed |
# |
Jan 4th 2019, 19:09 |
dereuromark |
first rule of cli: -h (--help) on a command |
# |
Jan 4th 2019, 19:09 |
dereuromark |
bake model? |
# |
Jan 4th 2019, 19:06 |
Bambino |
How can I bake a model? |
# |
Jan 4th 2019, 15:57 |
challgren |
@hippo probably best just to delete the directory and have composer reinstall it. Sounds like your package was modified |
# |
Jan 4th 2019, 13:28 |
hippo |
@challgren it's really strange.. On line 308 in my source it has `if (is_string($event))` .. Doesn't make any sense.. |
# |
Jan 4th 2019, 10:23 |
asdfgh |
yes hippo i am trying thanks |
# |
Jan 4th 2019, 10:22 |
challgren |
https://github.com/cakephp/cakephp/blob/3.7.2/src/Event/EventManager.php#L312 |
# |
Jan 4th 2019, 10:22 |
challgren |
infact that call should be on Line 312 if you are running 3.7.1 |
# |
Jan 4th 2019, 10:21 |
challgren |
It sounds like you have a modified source file because line 308 has not been modified in over 4 years. https://github.com/cakephp/cakephp/blame/eae26792654fece99bb121420e179f0a0efcb2ae/src/Event/EventManager.php#L308 |
# |
Jan 4th 2019, 10:19 |
challgren |
Update to cake 3.7.2 |
# |
Jan 4th 2019, 10:18 |
challgren |
@hippo what version of cake are you running? |
# |
Jan 4th 2019, 10:18 |
hippo |
no worries.. should give you an idea on how to structure the form. If you setup your relationships correctly and the form then it should work correctly :slightly_smiling_face: |
# |
Jan 4th 2019, 10:12 |
asdfgh |
hippo thanks! i am reading |
# |
Jan 4th 2019, 10:11 |
hippo |
Has anyone seen this deprecation warning? ``` NOTICE Deprecated (16384): Event::name() is deprecated. Use Event::getName() instead. - /vendor/cakephp/cakephp/src/Event/EventManager.php, line: 308 ``` Running Cake 3.7.1 and PHP 7.1. |
# |
Jan 4th 2019, 10:08 |
hippo |
asdfgh have a look at this: https://gist.github.com/LoveMHz/c0f6694b3e0da1987eed |
# |
Jan 4th 2019, 09:51 |
challgren |
@nickbuseymake sure you name does not include an underscore I updated the docs to let you know about this in case you experince it |