Log message #4181952

# At Username Text
# Apr 3rd 2019, 11:41 admad https://api.cakephp.org/3.7/class-Cake.TestSuite.TestCase.html#_loadPlugins
# Apr 3rd 2019, 11:41 admad Then a chance for someone to contribute :slightly_smiling_face:
# Apr 3rd 2019, 11:40 challgren @admad no doc on that at all https://book.cakephp.org/3.0/en/development/testing.html
# Apr 3rd 2019, 11:37 admad @livia.scapin there's loadPlugins() method available in test cases
# Apr 3rd 2019, 11:31 nico946 Hi everyone, how is going? I have a quick question, I need to send a post request from a controller to another and I getting "Missing CSRF token cookie", is there any part of the doc you can link me to solve this problem?
# Apr 3rd 2019, 10:51 snake-venom got it.
# Apr 3rd 2019, 10:45 neon1024 You’ll have to write that route yourself, or stick to the conventions
# Apr 3rd 2019, 10:45 neon1024 So you’re getting a 404 because ’saveData` isn’t a method mapped by the resource routes
# Apr 3rd 2019, 10:44 neon1024 https://book.cakephp.org/3.0/en/development/routing.html#resource-routes
# Apr 3rd 2019, 10:44 neon1024 Well you’re using `->resources()` which I think only maps CRUD
# Apr 3rd 2019, 10:40 neon1024 its working for add() method but why its not working with custom mapped url ? and how to make it working also ?
# Apr 3rd 2019, 10:37 snake-venom example.com/api/leads/saveData.json -- > In APi folder/ Leads Controller/ SaveData() method
# Apr 3rd 2019, 10:36 snake-venom no no ..
# Apr 3rd 2019, 10:36 snake-venom yes same
# Apr 3rd 2019, 10:35 neon1024 I would expect `example.com/api/leads.json`
# Apr 3rd 2019, 10:35 neon1024 What url are you trying?
# Apr 3rd 2019, 10:30 snake-venom i am trying to off CSRF in cakephp api . https://codeshare.io/5Q0bLq here is my routes.php after commenting CSRF registry , i am getting another error that "Controller class Api could not be found." but if i am enabling CSRF then its working ok..
# Apr 3rd 2019, 10:09 challgren You’ll need some settings from that file
# Apr 3rd 2019, 10:09 challgren https://github.com/CakeDC/users/blob/develop/tests/bootstrap.php
# Apr 3rd 2019, 10:09 livia.scapin Thanks!
# Apr 3rd 2019, 10:09 challgren @livia.scapin https://github.com/CakeDC/users/blob/develop/tests/TestApplication.php is what you would do
# Apr 3rd 2019, 10:07 slackebot2 pretty much https://github.com/cakephp/app/blob/master/tests/bootstrap.php I do understand that since the plugins are not loaded in bootstrap.php anymore, I guess I should do something in tests/bootstrap.php to load them? Or maybe somehow call Application::bootstrap? How do you guys handle this in your applications? And should we maybe adjust the app template? :slightly_smiling_face:
# Apr 3rd 2019, 10:07 livia.scapin So... I just updated a CakePHP 3.6 application to 3.7, everything went pretty well I guess. There is one problem, though and I'm not sure how to fix it, maybe someone could point me in the right direction? My problem is that plugin configuration isn't available anymore in my unit tests, which kind of makes sense. As suggested I moved all the plugin loading stuff from bootstrap.php to Application::bootstrap(). My tests/bootstrap.php is
# Apr 3rd 2019, 09:59 challgren Yep thats it! So its an flystsem-aws-3-v3 bug
# Apr 3rd 2019, 09:57 challgren Ok so it appears thats returning null because the content is not a string
# Apr 3rd 2019, 09:53 challgren Yep I have it
# Apr 3rd 2019, 09:51 challgren let me check if I got finfo
# Apr 3rd 2019, 09:45 admad @challgren https://github.com/thephpleague/flysystem/blob/master/src/Util/MimeType.php#L182
# Apr 3rd 2019, 09:38 asdfgh the same
# Apr 3rd 2019, 09:38 asdfgh th ecomposer.json is the cakephp/app
# Apr 3rd 2019, 09:38 asdfgh i do not understand the reason
# Apr 3rd 2019, 09:37 asdfgh guys why do i get bash: bin/cake: No such file or directory ??? i run composer install
# Apr 3rd 2019, 09:31 challgren Guess its time for a custom Writer
# Apr 3rd 2019, 09:30 challgren But if I could pass Config on https://github.com/FriendsOfCake/cakephp-upload/blob/master/src/File/Writer/DefaultWriter.php#L122 I could manually set the ContentType
# Apr 3rd 2019, 09:29 challgren So it can serve it correctly
# Apr 3rd 2019, 09:29 challgren But S3 needs the content-type
# Apr 3rd 2019, 09:28 challgren Thats part of FlySystem
# Apr 3rd 2019, 09:28 admad Why is it even trying to detect type using extension, it's error prone anyway. Don't you have finfo() available?
# Apr 3rd 2019, 09:22 challgren But not really a cakephp-upload bug either
# Apr 3rd 2019, 09:20 challgren Its not really the adapters bug
# Apr 3rd 2019, 09:20 challgren Well the easiest solution would be to have a custom writerinterface it seems