Logs for #cakephp

Page 4 of 36,420, showing 100 records out of 3,641,957 total, starting on record 301, ending on 400

# At Username Text
# Dec 5th, 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, 16:07 gianmarxgagliardi :(
# Dec 5th, 15:51 wnasich It seems the Auth component was not initialized and it is not attached to UsersController
# Dec 5th, 15:48 gianmarxgagliardi no one can help me
# Dec 5th, 15:28 info315 Done #13980 :slightly_smiling_face:
# Dec 5th, 15:24 admad yup
# Dec 5th, 15:24 info315 @admad should I open an issue on this?
# Dec 5th, 15:23 admad that check will have to be tweaked
# Dec 5th, 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, 15:17 info315 Angular sends `{}` which should not let the Framework run into any parser errors...
# Dec 5th, 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, 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, 15:12 info315 @ndm adding post data solved the Problem, but i guess this is a bug ...
# Dec 5th, 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, 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, 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, 15:02 ndm Or, if it has no body, why is it a POST request?
# Dec 5th, 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, 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, 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, 14:59 info315 It has no body
# Dec 5th, 14:59 info315 @ndm Thats my POST request: https://dev-dziegler.oitc.itn/contactgroups/loadContacts/61.json?angular=true
# Dec 5th, 14:58 ndm Nobody's going to dig through all that ;) Details about your request would probably be more helpful. What exactly are you sending, data and headers wise?
# Dec 5th, 14:55 info315 It's also on GitHub if this helps: https://github.com/it-novum/openITCOCKPIT/tree/4.x-dev/app/cake4/src
# Dec 5th, 14:49 angelxmoreno :scream:cake 4? @info315 you so fancy!:,)
# Dec 5th, 14:45 info315 In my AppController i still load the RequestHandler like so: ``` public function initialize(): void { parent::initialize(); $this->loadComponent('RequestHandler'); $this->loadComponent('Flash'); // Docs: https://book.cakephp.org/authentication/1/en/index.html $this->loadComponent('Authentication.Authentication', [ 'logoutRedirect' => '/users/login' // Default is false ]);
# Dec 5th, 14:45 slackebot2 //$this->loadComponent('Security'); }```
# Dec 5th, 14:44 slackebot2 [CORE/src/Core/functions.php, line 305]``` I use the BodyParserMiddleware in my Application.php: ``` public function middleware($middlewareQueue): MiddlewareQueue { $middlewareQueue ->add(new BodyParserMiddleware()) ->add(ErrorHandlerMiddleware::class) ->add(new AssetMiddleware([ 'cacheTime' => Configure::read('Asset.cacheTime') ])) ->add(new
# Dec 5th, 14:44 slackebot2 RoutingMiddleware($this)) ->add(new AppAuthenticationMiddleware($this, [ //Only redirect .html requests if login is invalid - no json requests 'htmlUnauthenticatedRedirect' => '/users/login' ])) ->add(new AuthorizationMiddleware($this)) ->add(new RequestAuthorizationMiddleware()); return $middlewareQueue; }```
# Dec 5th, 14:44 info315 With CakePHP 4 i get this error on some on one post request: ```Deprecated (16384): Request's input data parsing feature has been removed from RequestHandler. Use the BodyParserMiddleware in your Application class instead. - /usr/share/openitcockpit/app/cake4/vendor/cakephp/cakephp/src/Event/EventManager.php, line: 311 You can disable deprecation warnings by setting `Error.errorLevel` to `E_ALL and ~E_USER_DEPRECATED` in your config/app.php.
# Dec 5th, 13:38 josbeir no problem :slightly_smiling_face:
# Dec 5th, 13:37 javier.villanueva ok i use matching, i read. thanks!
# Dec 5th, 13:37 javier.villanueva ok thank you
# Dec 5th, 13:37 javier.villanueva Do you say that $conditions not affect to this query?
# Dec 5th, 13:36 josbeir so @javier.villanueva as @neon1024 said: check out https://book.cakephp.org/3/en/orm/retrieving-data-and-resultsets.html#filtering-by-associated-data-via-matching-and-joins
# Dec 5th, 13:36 javier.villanueva sorry xD
# Dec 5th, 13:36 josbeir i needed to read it twice to understand it tho :)
# Dec 5th, 13:35 neon1024 @josbeir Nailing it again! :clap:
# Dec 5th, 13:35 neon1024 Ah, matching?
# Dec 5th, 13:35 josbeir you are just filtering the groups list but not the parent folders list using tat query @javier.villanueva
# Dec 5th, 13:35 neon1024 Not sure I understand that @javier.villanueva but it seems like if your `$conditions` is something else or `[]` that’s not related to the query you pasted
# Dec 5th, 13:30 javier.villanueva $conditions are other conditions or [ ]
# Dec 5th, 13:30 javier.villanueva but... not is correct...
# Dec 5th, 13:30 javier.villanueva return $query->find('list')->where($conditions)->contain('Groups', function (Query $q) use ($user) { return $q ->where(['Groups.id' => $user['group']['id']]); });
# Dec 5th, 13:30 javier.villanueva I am trying to create a custom finder with the next condition. I have Folders , and Groups. The folder belongsToMany Groups. The user belongs to one Group. I want find all folders, but if folders has groups then only find if in these groups is the user's group :)
# Dec 5th, 13:16 neon1024 That first contact experience is absolutely critical to me
# Dec 5th, 13:16 neon1024 @challgren I’d agree with you. I’d rather use a bad package if it’s documented well, than great code with poor documentation
# Dec 5th, 12:58 admad talking about phptan
# Dec 5th, 12:57 admad @dereuromark i am waiting to see how many of those tickets are addressed vs closed with "no, this is how it should work"
# Dec 5th, 12:44 challgren We tried bitwise but it was just becoming a mess people would choose the wrong status, etc
# Dec 5th, 12:43 challgren I plan on using it for (construction) project workflow
# Dec 5th, 12:43 challgren Or online order
# Dec 5th, 12:42 challgren Car would be a perfect example
# Dec 5th, 12:42 dereuromark A while ago I asked for good use cases for it to showcase, none were given :slightly_smiling_face: That would help draw up sth.
# Dec 5th, 12:42 dereuromark I might want to add a screenshot of the live preview image functionality, that could help
# Dec 5th, 12:40 dereuromark then do it
# Dec 5th, 12:40 challgren Id rather learn statemachine vs this one
# Dec 5th, 12:40 challgren The graph helps
# Dec 5th, 12:39 dereuromark LOL
# Dec 5th, 12:39 challgren The docs seem easier, I can understand it quickly
# Dec 5th, 12:39 dereuromark "makes more sense than" why would you think that?
# Dec 5th, 12:38 dereuromark Jep. We use it for complex releases with all the suroundings necessary, asynchronous pre and post changes and jobs.
# Dec 5th, 12:37 challgren https://github.com/ludeus/cakephp3-state-machine this makes more sense that cakephp-statemachine
# Dec 5th, 12:33 angelxmoreno :eyes:
# Dec 5th, 12:30 challgren Its basically a workflow for an entity?
# Dec 5th, 12:30 dereuromark Yeah wanted to blog post about it actually...^^ since months
# Dec 5th, 12:28 challgren @dereuromark you have a cakephp-statemachine sample?
# Dec 5th, 12:02 dereuromark crowd-sourcing ftw
# Dec 5th, 12:01 dereuromark told u :slightly_smiling_face: Lean QA
# Dec 5th, 11:56 challgren OMG so many tickets!
# Dec 5th, 11:53 dereuromark haha, my False positive on null|void ticket is already lost in the other tickets opened since yesterday.... https://github.com/phpstan/phpstan/issues
# Dec 5th, 11:51 challgren Ok, the BrokerAwareExtension is in 0.11
# Dec 5th, 11:50 challgren $this->paginate[‘conditions’] was messing things up
# Dec 5th, 11:50 dereuromark @challgren Can you maybe make a PR?
# Dec 5th, 11:50 challgren Yeah I think Im going to wait this one out
# Dec 5th, 11:50 dereuromark They use lean QA: Let the developers do all the beta testing and stuff...^^ A bit annoying usually to work with the .0 release, I usually wait till the first 2 patch releases.
# Dec 5th, 11:45 gianmarxgagliardi so it works `$this->DogsCats->find()->count();`
# Dec 5th, 11:42 challgren Gah did they fuck up the editor again!
# Dec 5th, 11:41 challgren Doesn’t like `if (!$this->Auth->user(‘is_superuser’)) { unset($data[‘tenant_id’]); }` now
# Dec 5th, 11:40 admad 0.12 spews some annoying false positives
# Dec 5th, 11:40 challgren Change `BrokerAwareClassReflectionExtension` to `BrokerAwareExtension` and its fixed
# Dec 5th, 11:38 challgren More `Method App\Controller\SuperAdmin\TenantsController::view() should return Cake\Http\Response|void but return statement is missing.` than anything
# Dec 5th, 11:37 challgren From ide-helper
# Dec 5th, 11:37 challgren Yeah I got 77. Your AssociationTableMixinClassReflectionExtension is also broken with 0.12
# Dec 5th, 11:32 dereuromark The relative path change is the only issue so far. and usual false positives after a fresh major^^
# Dec 5th, 11:32 gianmarxgagliardi ```$total = $this->DogsCats->find('count')?```
# Dec 5th, 11:32 dereuromark @challgren I did for one plugin :P why?
# Dec 5th, 11:30 gianmarxgagliardi how to count the number of table cells in cakephp?
# Dec 5th, 11:27 admad you can through db connection config
# Dec 5th, 11:27 jh can we add something like this to cakephp4 by default? 'SET SESSION sql_mode = "STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY";',
# Dec 5th, 11:24 challgren Mr Plugin you update to phpstan 0.12 yet?
# Dec 5th, 10:57 fhxfhx we try to install an old cake-app and receive the 403 error, not sure what steps to take
# Dec 5th, 10:57 fhxfhx what can be the reason for a 403 error when otherwise a test file works properly ?
# Dec 5th, 10:50 gianmarxgagliardi morning
# Dec 5th, 10:50 gianmarxgagliardi I have a doubt -> https://pastebin.com/FHwvEbAW instead of adding the data is overwritten how can I make the value field dynamic? avoiding that I always overwrite the data with id 1
# Dec 5th, 10:39 spriz @noel in a controller :slightly_smiling_face:
# Dec 5th, 10:39 neon1024 Morning @spriz :waew
# Dec 5th, 10:37 noel ok cool but what is `foo.php`?
# Dec 5th, 10:25 spriz maybe even without the `action` part
# Dec 5th, 10:25 spriz something like https://gist.github.com/Spriz/a33cd766a458f8c61f3ebe7bc6002160 should suffice :slightly_smiling_face: