Log message #4217525

# At Username Text
# Dec 5th 2019, 21:47 storkovo if so, read app/tom/logs/*
# Dec 5th 2019, 21:47 storkovo @fhxfhx /app/tmp and subfolders writable? debug 2?
# Dec 5th 2019, 21:44 challgren Yeah but people that know Cake 1.3.6 is probably very slim
# Dec 5th 2019, 21:43 fhxfhx anyone here ?
# Dec 5th 2019, 21:13 fhxfhx what can be the reason for a 403 error when otherwise a test file works properly ? we try to install an old cake_v136-app and receive the 403 error, not sure what steps to take
# Dec 5th 2019, 20:13 randompherret if I wanted to be able to bake and get json response automatically this the best thing to do to edit the twig file or some plugin that would be better?
# Dec 5th 2019, 16:49 dereuromark I think cakebox has issues now since a few weeks. Did anyone try to set up a fresh one these days? Seems like people cant do it anymore. Besides it needing some upgrades ;)
# Dec 5th 2019, 16:45 ndm And maybe consider ditching the old blog tutorial, and use the new CMS tutorial instead, the blog one isn't even in the TOC anymore.
# Dec 5th 2019, 16:44 ndm Start with checking that you've followed and implemented the _complete_ turorial, loading the auth component is shown in https://book.cakephp.org/3/en/tutorials-and-examples/blog-auth-example/auth.html#authentication-login-and-logout
# Dec 5th 2019, 16:38 gianmarxgagliardi @ndm how do i check auth component ?
# Dec 5th 2019, 16:32 info315 @admad and @ndm thanks for this!! `<3 i love it` to not us WYSIWYG anymore :slightly_smiling_face:
# Dec 5th 2019, 16:28 ndm https://cakesf.slack.com/archives/C053DPNGT/p1575516844333700
# Dec 5th 2019, 16:28 gianmarxgagliardi How could I initialize it? where do I find Auth?
# Dec 5th 2019, 16:27 ndm Well that specific tutorial is for the auth component, that's just how it is :slightly_smiling_face: Tutorials for the new plugins are going to be present in the 4.x docs IIRC
# Dec 5th 2019, 16:27 info315 and the slack WYSIWYG editor is a piece of crap
# Dec 5th 2019, 16:26 info315 Edit: I use `Authentication.Authentication so its from the plugin`
# Dec 5th 2019, 16:25 info315 @ndm But AuthComponent is deprecated but you still need it some how :man-shrugging:
# Dec 5th 2019, 16:19 ndm The blog tutorial has been replaced with the CMS tutorial for a reason, but it should work if you follow it completely. If `$this->Auth->allow()` gives you that error, then that means that the auth component hasn't been loaded.
# Dec 5th 2019, 16:17 gianmarxgagliardi @info315 the strangest thing that following the official guide of cakephp you have problems
# Dec 5th 2019, 16:10 info315 @gianmarxgagliardi take a look at this: https://github.com/nook24/blood-pressure This is an example app with Authentication and Authorization you can use to check whats different with your code...
# Dec 5th 2019, 16:07 gianmarxgagliardi :(
# Dec 5th 2019, 15:51 wnasich It seems the Auth component was not initialized and it is not attached to UsersController
# Dec 5th 2019, 15:48 gianmarxgagliardi no one can help me
# Dec 5th 2019, 15:28 info315 Done #13980 :slightly_smiling_face:
# Dec 5th 2019, 15:24 admad yup
# Dec 5th 2019, 15:24 info315 @admad should I open an issue on this?
# Dec 5th 2019, 15:23 admad that check will have to be tweaked
# Dec 5th 2019, 15:21 ndm That's probably what triggers it, even when it's being parsed correctly, the request data will be empty, as it decodes to an empty array, the raw input data however isn't empty, it's `{}`, and that triggers the check in the component, `body = empty, input != empty`. https://github.com/cakephp/cakephp/blob/4.x/src/Controller/Component/RequestHandlerComponent.php#L176-L186
# Dec 5th 2019, 15:17 info315 Angular sends `{}` which should not let the Framework run into any parser errors...
# Dec 5th 2019, 15:16 info315 To be honest - I don't know why it's POST and not GET, there are working several people on this project...
# Dec 5th 2019, 15:14 ndm Well, maybe, kind of... what does `$request->input()` give you? I'm not overly familiar with Angular, but maybe it sends an empty-ish JSON value when no data is present, like `{}`, `''`, `null`, ... That would probably trigger the notice. But again, do you actually have a specific reason to use POST over GET?
# Dec 5th 2019, 15:12 info315 @ndm adding post data solved the Problem, but i guess this is a bug ...
# Dec 5th 2019, 15:05 info315 @ndm This are all the headers the browser sends. This is the javascript: https://github.com/it-novum/openITCOCKPIT/blob/4.x-dev/app/cake4/webroot/js/scripts/controllers/Contactgroups/ContactgroupsAddController.js#L40-L45
# Dec 5th 2019, 15:04 slackebot2 Content-Length: 2 Origin: https://dev-dziegler.oitc.itn Connection: keep-alive Referer: https://dev-dziegler.oitc.itn/ng/ Cookie: CookieAuth=%5...; csrfToken=808e5d68071467a3dca223bfdaa327d503baa9823d324ee4b4219dc31f846f05d87af4407c2fdb85c12f7adf986e90186c327db584f39e4574317da48442bcc2; PHPSESSID=po21fkp3cb3fgek6n8tlpfl791 Pragma: no-cache Cache-Control: no-cache```
# Dec 5th 2019, 15:04 info315 ```Host: dev-dziegler.oitc.itn User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:70.0) Gecko/20100101 Firefox/70.0 Accept: application/json, text/plain, */* Accept-Language: de,en-US;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate, br Content-Type: application/json;charset=utf-8 X-CSRF-Token: 808e5d68071467a3dca223bfdaa327d503baa9823d324ee4b4219dc31f846f05d87af4407c2fdb85c12f7adf986e90186c327db584f39e4574317da48442bcc2
# Dec 5th 2019, 15:02 ndm Or, if it has no body, why is it a POST request?
# Dec 5th 2019, 15:01 ndm @info315 Why does it have no body? It's not invalid, but possibly a problem for how the request handler components determines deprecated usage. And what headers are you sending?
# Dec 5th 2019, 14:59 slackebot2 src/Model/Table/UsersTable.php // src/Controller/UsersController.php <!-- src/Template/Users/add.ctp -->``` `it gives me an error: Call to a member function allow() on boolean`...`Error in: ROOT\src\Controller\UsersController.php, line 14` as is possible with a copy and paste?
# Dec 5th 2019, 14:59 gianmarxgagliardi I was following this guide for Blog Tutorial - Authentication and Authorization (https://book.cakephp.org/3/en/tutorials-and-examples/blog-auth-example/auth.html) I made a copy of the following files: ```CREATE TABLE users ( id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, username VARCHAR(50), password VARCHAR(255), role VARCHAR(20), created DATETIME DEFAULT NULL, modified DATETIME DEFAULT NULL );``` ```//
# Dec 5th 2019, 14:59 info315 It has no body
# Dec 5th 2019, 14:59 info315 @ndm Thats my POST request: https://dev-dziegler.oitc.itn/contactgroups/loadContacts/61.json?angular=true