# |
Feb 19th 2020, 17:15 |
neon1024 |
Wouldn’t you override the template and change the element being rendered? |
# |
Feb 19th 2020, 17:12 |
ricksaccous |
is it possible to over-ride elements rather than templates? |
# |
Feb 19th 2020, 17:12 |
ricksaccous |
https://book.cakephp.org/3/en/plugins.html#overriding-plugin-templates-from-inside-your-application |
# |
Feb 19th 2020, 16:56 |
neon1024 |
Using `array_merge` was all I could think of. `array_merge(['thing' => 0, 'other' => 0], $counted->toArray())` |
# |
Feb 19th 2020, 16:55 |
neon1024 |
`countBy` obviously doesn’t create a key if the count is 0 |
# |
Feb 19th 2020, 16:55 |
neon1024 |
When using `countBy` is there a way to set defaults, so keys always exist, and count as 0 |
# |
Feb 19th 2020, 15:31 |
dereuromark |
hah, wrote a small check script that found that all the rest of the tables were ok. https://github.com/dereuromark/cakephp-setup/commit/f1ae1953fd70f8c2ab3241146e9dc4d0e8ba04d8 Only that one issue was left. |
# |
Feb 19th 2020, 15:13 |
dereuromark |
hehe |
# |
Feb 19th 2020, 15:08 |
admad |
If you can undo it means you never removed the data in the first place :P |
# |
Feb 19th 2020, 14:48 |
spriz |
Yeah but good luck explaining that to a confused user :) :) |
# |
Feb 19th 2020, 14:35 |
neon1024 |
Oh geez, I wouldn’t think you could do that though. If you could it would prove you never actioned it properly in the first instance I’d think :thinking_face: |
# |
Feb 19th 2020, 14:34 |
spriz |
Then I will be grumpy cat |
# |
Feb 19th 2020, 14:34 |
spriz |
I am just waiting for the first "Can we please undo this GDPR thingy???" |
# |
Feb 19th 2020, 14:33 |
spriz |
:) |
# |
Feb 19th 2020, 14:33 |
spriz |
just to you can at least track back end figure out when `user_id`'s data was suddenly all `0`'s |
# |
Feb 19th 2020, 14:33 |
spriz |
like which `user_id`, `organization_id`, `account_id` or whatever it might be related to |
# |
Feb 19th 2020, 14:33 |
spriz |
but maybe something like `gdpr_removal_requests` that contains whatever meta data you are allowed to save about it :) |
# |
Feb 19th 2020, 14:32 |
spriz |
Yeah, but nothing identifiable in that |
# |
Feb 19th 2020, 14:32 |
neon1024 |
So you know how many you’ve actioned and when etc |
# |
Feb 19th 2020, 14:32 |
neon1024 |
@spriz Would you also store the GDPR removal request? As a record I mean? |
# |
Feb 19th 2020, 14:27 |
spriz |
I would have expected the same @dereuromark |
# |
Feb 19th 2020, 14:27 |
neon1024 |
True, but I should think about building it into my bake them |
# |
Feb 19th 2020, 14:26 |
spriz |
Ah, not until someone wants to exercise the right @neon1024;P |
# |
Feb 19th 2020, 14:26 |
dereuromark |
Depending on `'dependent' => false` and nullable key I would probably expect this to be taken on by the application if no DB constraint has been set up. But sounds sure like manual opt in kind of behavior. |
# |
Feb 19th 2020, 14:26 |
neon1024 |
@spriz Yeah, I need to build a button for that :) |
# |
Feb 19th 2020, 14:25 |
spriz |
@neon1024 you can "just" blank out that - so if an user wants to exercise the "right to be forgotten" you just put `00000000000000` in names/emails/whatever |
# |
Feb 19th 2020, 14:25 |
spriz |
but why/how did was the parent removed? you mean like in `DELETE FROM tbl WHERE`-removed? |
# |
Feb 19th 2020, 14:24 |
dereuromark |
cake itself doesnt do this it seems, would need some specific afterDelete logic |
# |
Feb 19th 2020, 14:24 |
dereuromark |
as I said, the belongsTo parent has been removed, thus leaving the hasMany items with a bad key in place. to this optional relation. |
# |
Feb 19th 2020, 14:23 |
spriz |
I might be - but what is the case - why did you end up with orphans in the first place @dereuromark? |
# |
Feb 19th 2020, 14:23 |
neon1024 |
..and GDPR removal notices and how to action them effectively |
# |
Feb 19th 2020, 14:23 |
neon1024 |
I should spend more time on deletion than I do, and more thinking about cascading and dependant deletes |
# |
Feb 19th 2020, 14:22 |
dereuromark |
I outlined the word optional :) earlier. Which clarifies the use case and why this is just data integrity. |
# |
Feb 19th 2020, 14:22 |
neon1024 |
Orphan data might go unnoticed |
# |
Feb 19th 2020, 14:22 |
dereuromark |
I think you misunderstand this specific case. |
# |
Feb 19th 2020, 14:22 |
neon1024 |
I think I’d rather it fail the delete |
# |
Feb 19th 2020, 14:21 |
spriz |
If someone by accident had an option to delete stuff, I would rather have bad data integrity than deleted data |
# |
Feb 19th 2020, 14:21 |
neon1024 |
We had a long discussion in the office once about this kind of thing, then it drifted into overly normalising your data, and into NoSQL, and from there into … |
# |
Feb 19th 2020, 14:20 |
neon1024 |
Semantics I guess, as long as it works that’s good enough for me! |
# |
Feb 19th 2020, 14:20 |
neon1024 |
I mean, sure, it’s data integrity too, but the way the database is designed would be dictated by the objects I’d say :) |
# |
Feb 19th 2020, 14:19 |
neon1024 |
I see it as business logic as a sale would have an invoice kinda thing |