Log message #4208470

# At Username Text
# Oct 11th 2019, 18:26 itmpls how did you . have a databreach if you dont mind me asking
# Oct 11th 2019, 18:24 this.impetus Hey guys—is there way to rebuild a MySQL database from the a cakephp project? I had a databreach yesterday and all our tables were replaced with ransom notes. Luckily the project was very much under development and so only test data was stored, but re-authoring the tabes by hand will be tedious
# Oct 11th 2019, 17:09 devito if i wanted to overload the protected fields in the schema class and add an additional one. What would be the best way to go about it?
# Oct 11th 2019, 15:32 slackebot1 !tias
# Oct 11th 2019, 15:32 slackebot1 Command sent from Slack by dereuromark:
# Oct 11th 2019, 15:32 dereuromark Didnt you try it? ;)
# Oct 11th 2019, 15:31 dereuromark Yes
# Oct 11th 2019, 15:14 jeremy.halin I've a weird question. When cakephp session expires and you are logged out, is the feature `redirect to previous page` is implemented and default behavior ?
# Oct 11th 2019, 13:17 jeremy.halin I hate cache in dev environment
# Oct 11th 2019, 13:16 jeremy.halin :,)
# Oct 11th 2019, 13:16 slackebot1 <josbeir>
# Oct 11th 2019, 13:16 josbeir i guess the cache does not get cleared after running migrations :P
# Oct 11th 2019, 13:16 jeremy.halin I use cakephp migrations
# Oct 11th 2019, 13:16 josbeir it caches the table keys
# Oct 11th 2019, 13:16 jeremy.halin thats weird
# Oct 11th 2019, 13:15 jeremy.halin :(
# Oct 11th 2019, 13:15 jeremy.halin @josbeir wow thanks...
# Oct 11th 2019, 13:15 slackebot1 <jeremy.halin>
# Oct 11th 2019, 13:15 josbeir bin/cake cache clear_all
# Oct 11th 2019, 13:15 josbeir did you clear the cache
# Oct 11th 2019, 13:14 jeremy.halin @ndm @aivaras.godliauskas `beforeSave` is working but when I assign a value to my column `start_at_utc`, it's not saved to DB (column is in `accessible` array)
# Oct 11th 2019, 13:11 scuadra @ndm thank you very much. :slightly_smiling_face:
# Oct 11th 2019, 13:05 ndm Also it should be `Countries.name` if association is named `Countries`
# Oct 11th 2019, 13:04 ndm Fields of associated tables need to be whitelisted: https://book.cakephp.org/3.0/en/controllers/components/pagination.html#control-which-fields-used-for-ordering
# Oct 11th 2019, 13:02 scuadra Hello. I am using Cake 3.7. Let's say I have tables products and countries (Products belongsTo Countries). So I want to paginate my Products and be able to sort them by Country name. But when I try to use $this->Paginator->sort('Country.name') or $this->Paginator->sort('country.name') in my view the results are not sorted by Country. Where am I wrong?
# Oct 11th 2019, 12:58 slackebot1 <jotpe>
# Oct 11th 2019, 12:58 jotpe Thanks @ndm, this was the change i needed to do:
# Oct 11th 2019, 12:53 jeremy.halin sorry, 37/5000 maybe I spoke too fast :slightly_smiling_face:
# Oct 11th 2019, 12:52 jeremy.halin @aivaras.godliauskas @ndm nope, not working :(
# Oct 11th 2019, 12:35 ndm @jeremy.halin You can, give it a try
# Oct 11th 2019, 12:35 aivaras.godliauskas @jeremy.halin i believe only ```beforeSave``` is enough
# Oct 11th 2019, 12:35 ndm @rchavik That's years before `cakephp/authentication` and `cakephp/authorization` even existed... maybe you were referring to something I don't see over here.
# Oct 11th 2019, 12:34 jeremy.halin or do I need a behavior ?
# Oct 11th 2019, 12:32 jeremy.halin @ndm thanks, can I just create a `beforeSave` function in my `table` ?
# Oct 11th 2019, 12:31 ndm @jeremy.halin https://book.cakephp.org/3.0/en/orm/behaviors.html#defining-event-listeners https://book.cakephp.org/3.0/en/tutorials-and-examples/bookmarks/part-two.html#persisting-the-tag-string
# Oct 11th 2019, 12:21 jeremy.halin Hi, I would like to create and save a column value based on another automatically. I have a local time in a column and want to store that same time but converted to UTC in another column. Rather than doing so in each save or update, I would like to make it automatic. I've seen https://book.cakephp.org/3.0/en/orm/table-objects.html#lifecycle-callbacks but it's unclear for me. Anyone with a concrete example please ? Thanks.
# Oct 11th 2019, 12:14 ndm @jotpe It may help if you'd show your code... have you checked https://github.com/cakephp/authorization/issues/79 ?
# Oct 11th 2019, 12:14 ndm That's... a totally different question ;) Look at for example https://github.com/UseMuffin/Footprint, injecting the data via events is usually the way to go.
# Oct 11th 2019, 11:29 rochasmarcelo In your controller, ``` $user = $this->Auth->user(); ``` or ```$userId = $this->Auth->user('id');```
# Oct 11th 2019, 11:26 jotpe How can i solve this
# Oct 11th 2019, 11:25 jotpe I implement `Authentication\IdentityInterface` and `Authorization\IdentityInterface` on my user