Logs for #cakephp

Page 1 of 36,296, showing 100 records out of 3,629,532 total, starting on record 1, ending on 100

# At Username Text
# Today, 05:17 adam282 Hm, so this does not work in `3.8`? ``` <?php echo $this->Time->format($user->created, 'M jS, Y g:iA'); ?> ```
# Today, 05:10 javier.villanueva morning all
# Today, 02:24 itmpls n/m, probably `SqlServer` -> `Sqlserver`
# Today, 02:23 itmpls oh
# Today, 02:23 itmpls anyone know why `Database driver Cake\Database\Driver\SqlServer could not be found` is thrown even though the class clearly exists? Also, sqlsrv is installed and is in_array of `PDO::getAvailableDrivers()` but enabled doesn't get called bc it doesn't reach the class
# Yesterday, 22:10 noel Nvm.. it must be late.. my eyes deceive me.
# Yesterday, 22:05 daniel.upshaw Thank you for your input and help :slightly_smiling_face:
# Yesterday, 22:04 noel The GET seems to work if I use an Accept header of `application/json` instead of the recommended `application/vnd.api+json` (which doesn't work, I get HTML back instead of json).
# Yesterday, 22:01 noel I'm trying to get CrudJsonApi working. I can get data using a request URL ending in .json. E.g. `http://crud-test:8888/cocktails/1.json`, however it also says that I should be able to make that request without the `.json` if using the correct headers but I can't seem to get that to work. Also it says that specific validation errors will be shown but it's telling me there are validation errors without specifics. Any clues?
# Yesterday, 21:47 daniel.upshaw I think it must not use fallbacks at all, for this case
# Yesterday, 21:46 daniel.upshaw Yeah, it seems like I'll just need to be specific with the routes, instead of leveraging fallbacks
# Yesterday, 21:46 dereuromark then instead of fallback set a custom route for /login inside. and you have your URL
# Yesterday, 21:45 daniel.upshaw Lol that does load, if I use `['path' => '/auth']`
# Yesterday, 21:45 daniel.upshaw `/auth/auth/login`
# Yesterday, 21:44 daniel.upshaw I think that's going to be the only way, to scope it to a path
# Yesterday, 21:44 daniel.upshaw Hmm, I'll check.. yeah maybe the idea will be to just rename my controllers and stuff
# Yesterday, 21:44 dereuromark what if you use /auth as path, and then set /login inside it etc?
# Yesterday, 21:42 daniel.upshaw I like to see `/auth/login` if possible
# Yesterday, 21:42 daniel.upshaw Yeah same
# Yesterday, 21:42 dereuromark but that doesnt sound like a good idea to me.
# Yesterday, 21:42 dereuromark ah, or maybe you indeed overwrite root
# Yesterday, 21:42 daniel.upshaw Hmmm
# Yesterday, 21:42 dereuromark the plugins root, including /auth
# Yesterday, 21:41 daniel.upshaw That's saying from the root, to use DashedRoutes as a fallback, right? But in the main app, since that fallbacks to DashedRoutes as well.... it never checks the plugin's fallback route
# Yesterday, 21:40 daniel.upshaw Even if I have ```Router::plugin( 'Auth', ['path' => '/'], function (RouteBuilder $routes) { $routes->fallbacks(DashedRoute::class); } );```
# Yesterday, 21:40 daniel.upshaw `plugins/Auth/src/Controller/AuthController.php` ... and a `login()` method.... it won't see `/auth/login`
# Yesterday, 21:39 daniel.upshaw So for example, I'm trying to learn the Authorization stuff, and I want it in a plugin.. Say I have plugins/Auth
# Yesterday, 21:38 dereuromark i dont follow. plugins use the apps by default, they inherit.
# Yesterday, 21:38 daniel.upshaw Might just make the Plugins use very specific routes, instead of leveraging DashedRoutes, if it won't be possible otherwise
# Yesterday, 21:37 daniel.upshaw Wellll, isn't it ideal to modularize the plugins?
# Yesterday, 21:36 dereuromark just make the plugin ignore its routes and set up plugin routes from your app, this way you can overwrite it.
# Yesterday, 21:32 daniel.upshaw Or otherwise I wonder if it's possible to check plugin routes before the main routes...
# Yesterday, 21:31 daniel.upshaw It seems that if the core app has `$routes->fallbacks(DashedRoute::class);`, then it doesn't pick up the `/:controller/:action` pattern from the root path
# Yesterday, 21:31 daniel.upshaw Any way to have a Plugin use `DashedRoutes` from the root path `/`, if the core app uses `$routes->fallbacks(DashedRoute::class);`?
# Yesterday, 20:32 ricksaccous I have no idea what you're currently using
# Yesterday, 20:31 noel So I'd have to create an action which listens for 'json-api' on the request and then manually construct json that shows the validation errors?
# Yesterday, 20:30 noel No, it's`422 Unprocessable Entity`
# Yesterday, 20:29 ricksaccous if not I think it's up to you to show the errors/etc
# Yesterday, 20:29 ricksaccous are you getting a 404?
# Yesterday, 20:28 noel ok cool. I'm trying to post to the json api and it's saying there are validation errors but not showing what they are?
# Yesterday, 20:25 ricksaccous then you can just get rid of the beforeFilter logic
# Yesterday, 20:24 ricksaccous https://book.cakephp.org/3.0/en/controllers/middleware.html#cross-site-request-forgery-csrf-middleware
# Yesterday, 20:24 ricksaccous yeah I'd say so
# Yesterday, 20:23 noel So I suppose I should register it only for non API prefixes?
# Yesterday, 20:22 noel Like this: ``` Router::scope('/', function (RouteBuilder $routes) { // Register scoped middleware for in scopes. $routes->registerMiddleware('csrf', new CsrfProtectionMiddleware([ 'httpOnly' => true, ])); ```
# Yesterday, 20:21 noel in the routes.php file
# Yesterday, 20:21 noel middleware
# Yesterday, 20:20 ricksaccous are you enabling it in the first place via routing or middleware?
# Yesterday, 20:20 noel Ok tx. Got that... now the CSRF error is back, even though it's disabled in the beforeFilter.
# Yesterday, 20:20 ricksaccous use Cake\Event\Event;
# Yesterday, 20:19 ricksaccous whatever it is
# Yesterday, 20:19 ricksaccous or use
# Yesterday, 20:19 ricksaccous you didn't import the class
# Yesterday, 20:19 noel Is that just scoping?
# Yesterday, 20:18 noel ok tx.. but then I get this error instead: `Declaration of App\Controller\AppController::beforeFilter(App\Controller\Event $event) should be compatible with Cake\Controller\Controller::beforeFilter(Cake\Event\Event $event) `
# Yesterday, 20:11 ricksaccous @noel disable CSRF for your Api
# Yesterday, 20:11 noel Hi all. I'm trying to use CrudJsonApi and I'm getting: `Error: CSRF token mismatch.` on a POST using Postman. Any idea how to fix that?
# Yesterday, 20:03 henri.mjr Ok, thanks
# Yesterday, 20:02 ricksaccous @henri.mjr not really no, you just have to specify a select form control
# Yesterday, 19:59 henri.mjr btw form->control show it as "input", its possible to cake understand it as select automatic?
# Yesterday, 19:59 henri.mjr `protected function _getTipo($tipo)` ` {` ` $opcoes = ['Branca','Morena','Negra'];` ` return $opcoes;` ` }`
# Yesterday, 19:58 henri.mjr Ok.. I got it on entity
# Yesterday, 19:31 henri.mjr I'm googling but no luck
# Yesterday, 19:31 henri.mjr Do you have an example for cakephp3?
# Yesterday, 19:26 ricksaccous up to you, meh
# Yesterday, 19:26 ricksaccous you could even make it a virtual property of your entity if you want
# Yesterday, 19:25 ricksaccous replacing X with a more descriptive word
# Yesterday, 19:25 ricksaccous $entity->getXOptions
# Yesterday, 19:25 ricksaccous i always find it kind of neat to do
# Yesterday, 19:25 ricksaccous or put it in your table class
# Yesterday, 19:25 ricksaccous you can put a get in your entity if you want
# Yesterday, 19:24 henri.mjr I need to "hardcode" some options for few selects.. Like "Hair Color", "Body Type". Where is the best place to put it?
# Yesterday, 19:02 LuizMarin url workspace on slack?
# Yesterday, 19:00 royalty https://app.slack.com/client/T053DPNCM/C053DPNGT
# Yesterday, 19:00 royalty you're better off on slack
# Yesterday, 18:56 LuizMarin Is there a way to create a user here?
# Yesterday, 18:45 admad "I learned to use debug" most important thing to learn as a coder :slightly_smiling_face:
# Yesterday, 18:44 ricksaccous awesome ;)
# Yesterday, 18:43 luiz69 By the way, I learned to use debug :)
# Yesterday, 18:43 luiz69 find the menu)
# Yesterday, 18:43 luiz69 Like I said before, I'm learning. I found the problem. Since no fields were changed, it did not save 'last_ip'. I happened to change a piece of content and it worked fine. I didn't know about this cake concept.
# Yesterday, 18:38 luiz69 moment please
# Yesterday, 18:35 royalty but you're not
# Yesterday, 18:34 royalty you should be getting a white screen or seeing the debugged entity when you try to save now
# Yesterday, 18:34 luiz69 I use vscode. It does not show errors.
# Yesterday, 18:34 royalty luiz69, everything looks right, what i would try doing is creating a method in your users table and make sure you can call it from your users controller
# Yesterday, 18:32 noel Does anyone have recommendations for enforcing style / linting for PHP on Sublime?
# Yesterday, 18:31 luiz69 basically it is the code generated by cake. I am learning to change each screen and the internal structure. I want to stay within cake programming conventions
# Yesterday, 18:27 luiz69 https://gist.github.com/LuizMarin/201c420bf26844b7dfd4994b465f7db0
# Yesterday, 18:25 luiz69 one moment please.
# Yesterday, 18:20 royalty can you gist your users controller and your users table?
# Yesterday, 18:19 luiz69 yes, in UsersTable
# Yesterday, 18:17 ricksaccous is beforeSave in your table class?
# Yesterday, 18:17 ricksaccous then your event is not running
# Yesterday, 18:16 luiz69 one moment please. I don't see where debug appears ...
# Yesterday, 18:13 luiz69 moment
# Yesterday, 18:13 ricksaccous in beforeSave before you run the first line of code do debug($entity); exit; and gist the result
# Yesterday, 18:12 ricksaccous or are you sure it's hitting that code?
# Yesterday, 18:11 ricksaccous or are you sure it's hitting that code?
# Yesterday, 18:11 ricksaccous is entity coming up as null?