Log message #4209244

# At Username Text
# Oct 17th 2019, 14:00 slackebot1 `Undefined variable: APP_user`, and this feels workaround-ish too What is the common accepted practice for this that'll work with 4.x? I don't need the complete answer, just link to the docs would be great
# Oct 17th 2019, 14:00 mehov Hi all, I need to know if user is logged in inside a Layout file. I found https://stackoverflow.com/questions/5901685/cakephp-check-if-user-is-logged-in-inside-a-view/, but it's either outdated, or doesn't work, or feels workaround-ish I put this in my AppController ``` public function beforeFilter(\Cake\Event\Event $event) { $this->set([ 'APP_user' => $this->Auth->user(), ]); } ``` and it gives me
# Oct 17th 2019, 13:45 neon1024 I wonder if codeception supports fixtures :thinking_face: Although that’s a lot of data to ingest per test-case, unless it was a suite level import
# Oct 17th 2019, 13:41 neon1024 When creating an acceptance test suite, using something like codeception, do you populate forms with data and submit them as part of a test? Wouldn’t test data build up in the dev db this way?
# Oct 17th 2019, 13:41 admad @francis.nadal use `dd(func_get_args())` in your closure and you will get idea of all arguments passed to it :slightly_smiling_face:
# Oct 17th 2019, 12:37 francis.nadal um hi @jotpe hope you're not very busy as of the moment hehe. just a question, I'm trying to rename my photos and I'm using nameCallback of the cake-upload plugin. But I'm seem to be confused about what to put in the arguments
# Oct 17th 2019, 12:01 jotpe You're welcome
# Oct 17th 2019, 12:01 francis.nadal @jotpe thank you again! I will try and see if any problem comes up hehe
# Oct 17th 2019, 12:00 jotpe @francis.nadal that should work :slightly_smiling_face:
# Oct 17th 2019, 12:00 jotpe @vjnvisakh I use CakePdf (https://github.com/FriendsOfCake/CakePdf/tree/1.0) in a old project. You need to create a .ctp as template and pass some viewVars
# Oct 17th 2019, 11:58 francis.nadal @jotpe my other question is, they have different validation should I put them differently like this?
# Oct 17th 2019, 11:57 francis.nadal @jotpeindeed! thank you very much for your help. I will be using the plugin
# Oct 17th 2019, 11:54 jotpe When you remove (or comment out) the validator the file is not validated, so better add some rules :slightly_smiling_face:
# Oct 17th 2019, 11:53 jotpe it's path
# Oct 17th 2019, 11:53 jotpe @francis.nadal there you go: https://cakephp-upload.readthedocs.io/en/latest/configuration.html#behavior-configuration-options
# Oct 17th 2019, 11:46 slackebot1 <francis.nadal>
# Oct 17th 2019, 11:46 francis.nadal @jotpe file was moved too but only the filename was saved in the db. so I might need to check cake-upload plugin documentation how to add the path so that I can render the image in frontend as well
# Oct 17th 2019, 11:45 francis.nadal actually while I tried commenting out the validator with scalar my entry was successful
# Oct 17th 2019, 11:45 vjnvisakh How to make a pdf from a url in cake2
# Oct 17th 2019, 11:43 francis.nadal um, sorry very noob question, could I try all of them like this?
# Oct 17th 2019, 11:42 neon1024 Nor do they have a max length
# Oct 17th 2019, 11:42 neon1024 They are array
# Oct 17th 2019, 11:42 neon1024 Uploaded files are not scalar
# Oct 17th 2019, 11:41 jotpe Have fun :slightly_smiling_face:
# Oct 17th 2019, 11:41 francis.nadal thank you! looking into it now
# Oct 17th 2019, 11:40 jotpe Remove the validator with photo and try something from https://cakephp-upload.readthedocs.io/en/latest/validation.html#uploadvalidation
# Oct 17th 2019, 11:38 francis.nadal that would be
# Oct 17th 2019, 11:38 jotpe What's the content of validationDefault() in UsersTable for photo?
# Oct 17th 2019, 11:37 jotpe There's something with your Validation Rules in UsersTable
# Oct 17th 2019, 11:35 francis.nadal does it mean I ahve to set path to where the photos will be moved?
# Oct 17th 2019, 11:35 francis.nadal @jotpe running this $this->request->getData('photo'); I get this
# Oct 17th 2019, 11:34 alexdd55976 seems that you need to add a file when you want to add a user
# Oct 17th 2019, 11:33 francis.nadal @jotpe hi i get this when debug is enabled
# Oct 17th 2019, 11:31 jotpe Form looks good. You see the post data with `if ($this->request->is('post')) { debug($this->request->getData('photo'));...`
# Oct 17th 2019, 11:27 francis.nadal @conehead this is my form
# Oct 17th 2019, 11:26 conehead And how does your form look like?
# Oct 17th 2019, 11:26 francis.nadal Thank you very much! I will try it right now
# Oct 17th 2019, 11:25 slackebot1 <jotpe>
# Oct 17th 2019, 11:25 jotpe @francis.nadal I don't know about this plugin, but you can try to debug it. In your UsersController try something like this:
# Oct 17th 2019, 11:15 francis.nadal Do I also need to configure this here in users table?
# Oct 17th 2019, 11:15 francis.nadal hello, I have a question regarding the cakephp-upload plugin. I wanted to have a photo upload for users and it was suggested to me to use it. But I was trying out their documentation example(https://cakephp-upload.readthedocs.io/en/latest/examples.html) but I seem to not get it to work. I always get this error.