# |
Dec 9th 2019, 18:20 |
gianmarxgagliardi |
in the meantime, someone can help me with my problem --> https://stackoverflow.com/questions/59253645/login-does-not-work-does-not-log-in-even-if-the-credentials-are-correct |
# |
Dec 9th 2019, 18:19 |
gianmarxgagliardi |
@jotpe thanks |
# |
Dec 9th 2019, 17:30 |
jotpe |
@gianmarxgagliardi I guess there is no sample project, I'll create one ;) |
# |
Dec 9th 2019, 17:16 |
gianmarxgagliardi |
the problem is that with the new guide I wouldn't know exactly where you start. Is there not an example of a project? |
# |
Dec 9th 2019, 16:33 |
slackebot2 |
test case to demonstrate this but _clients_ |
# |
Dec 9th 2019, 16:33 |
sdevore |
If you are using DebugKit as well I have seen this happen with nested entities when building the Variables tab. usually due to the ->getErrors() call in vendors/cakephp/cakephp/src/Datasource/EntityTrait.php around line 1462 (in version 3.7.x which I am currently working in. If I pass in false in ` ```'[hasErrors]' => $this->hasErrors(false),``` ` in `public function __debugInfo()` I seem to be ok. II’m planning on trying to figure out |
# |
Dec 9th 2019, 16:17 |
jotpe |
You can use the same db setup like described here: https://book.cakephp.org/3/en/tutorials-and-examples/cms/database.html#cms-tutorial-creating-the-database |
# |
Dec 9th 2019, 16:17 |
jotpe |
I would do it. Or simply test it in another app. |
# |
Dec 9th 2019, 16:14 |
gianmarxgagliardi |
should I redo the project from scratch this way? |
# |
Dec 9th 2019, 16:04 |
jotpe |
@gianmarxgagliardi yes, it's different and uses a Middleware. See https://book.cakephp.org/authentication/1/en/migration-from-the-authcomponent.html |
# |
Dec 9th 2019, 16:02 |
Ecorce |
The only solution I can see is to create another database, just for this CakePHP app... |
# |
Dec 9th 2019, 15:54 |
gianmarxgagliardi |
@jotpe it is completely different as compared to the previous guide. For example in the section "Configuring Authentication Handlers" talk about how to change the loadComponent in AppController.php ? |
# |
Dec 9th 2019, 15:41 |
Ecorce |
I wanted to use this other workaround, but I don't understand how to implement it : https://gist.github.com/burzum/06a0037c7ad8bcaf3333 |
# |
Dec 9th 2019, 15:41 |
Ecorce |
I'm sad... I really need the prefix. This is for a big project using the same database as other linked apps... |
# |
Dec 9th 2019, 15:40 |
Ecorce |
And when writing the correct joinTable, then it looks for bad foreignKeys... *prefix_table1_table2.prefix_foreign_key* |
# |
Dec 9th 2019, 15:38 |
Ecorce |
Cake looks for a join table called : **prefix_table1_prefix_table2**... which should be just prefix_table1_table2 |
# |
Dec 9th 2019, 15:37 |
Ecorce |
But it seems there are issues with associations. At least, belongsToMany. |
# |
Dec 9th 2019, 15:37 |
Ecorce |
My first try was to add in every Table initialize method a $this->table() with the tablename and its prefix. |
# |
Dec 9th 2019, 15:36 |
Ecorce |
I'm in CakePHP 3.3.16 |
# |
Dec 9th 2019, 15:36 |
Ecorce |
In trouble implementing prefixe in database config... trying to use the workarounds. |
# |
Dec 9th 2019, 15:35 |
Ecorce |
Hello everyone |
# |
Dec 9th 2019, 15:32 |
jotpe |
You're welcome :slightly_smiling_face: |
# |
Dec 9th 2019, 15:28 |
koeller |
@jotpe: Thank you so much. I did a `bin/cake plugin assets symlink` and recieved an error, that `/webroot/debug_kit` already exists. I deleted it and now everything just works fine. Funny thing is that in my other projects I don’t have a symlink in `/webroot`. |
# |
Dec 9th 2019, 15:23 |
jotpe |
The Plugin also works in 3.8 |
# |
Dec 9th 2019, 15:23 |
gianmarxgagliardi |
I'm developing with version 3.8 |
# |
Dec 9th 2019, 15:22 |
jotpe |
@gianmarxgagliardi for a new App I would start with AuthencationPlugin, since Cake4x will not wait for too long. |
# |
Dec 9th 2019, 15:21 |
gianmarxgagliardi |
@jotpe should I redo everything from scratch? |
# |
Dec 9th 2019, 15:18 |
jotpe |
https://book.cakephp.org/3/en/controllers/components/authentication.html |
# |
Dec 9th 2019, 15:17 |
jotpe |
@gianmarxgagliardi better try to get Authentication working with the Authentication Plugin, since AuthComponent is deprecated: https://book.cakephp.org/authentication/1/en/index.html |
# |
Dec 9th 2019, 15:15 |
jotpe |
did you also do `bin/cake plugin assets symlink` |
# |
Dec 9th 2019, 15:14 |
koeller |
@jotpe: Yep, tried both :( |
# |
Dec 9th 2019, 15:13 |
slackebot2 |
$this->redirect($this->Auth->redirectUrl()); } $this->Flash->error('Your username or password is incorrect.'); } }``` always prints to me: _Your username or password is incorrect._ can someone help me |
# |
Dec 9th 2019, 15:13 |
gianmarxgagliardi |
I'm following this guide -> https://book.cakephp.org/3/en/tutorials-and-examples/cms/authentication.html; after I entered email and password in the users table it gives me problems on login. ```// In src/Controller/UsersController.php public function login() { if ($this->request->is('post')) { $user = $this->Auth->identify(); if ($user) { $this->Auth->setUser($user); return |
# |
Dec 9th 2019, 15:13 |
jotpe |
@koeller you tried `bin/cake cache clear`_all and `bin/cake orm_cache clear`? |
# |
Dec 9th 2019, 14:58 |
slackebot2 |
other projects are working just fine. |
# |
Dec 9th 2019, 14:58 |
koeller |
Hi everybody, I’m having an issue with DebugKit. My app recieves a 403 when trying to load toolbar.js. When I enter the url into my browser I also recieve a 403 error. I tried a fresh install of cake and there it works fine. When copying the composer.json of the fresh install into my project, removing composer.lock and vendor and doing a composer install afterwards, I still get a 403 … Does anyone have an idea, what that might be? All my |
# |
Dec 9th 2019, 14:32 |
japerlman |
It's hard to know what examples I'm finding are for 3.x or 2.x too |
# |
Dec 9th 2019, 14:28 |
japerlman |
is what I have in my find->('all', |
# |
Dec 9th 2019, 14:28 |
japerlman |
```'fields' => ('SUM(ClientLogs.hours) AS hours')``` |
# |
Dec 9th 2019, 14:28 |
japerlman |
I'm really struggling with the different from 2.x when creating queries, can anyone help me SUM a field in the query? Everything I'm finding is saying to just run the query without the sum, then do the sum after it's returned, I don't understand why that's better. |
# |
Dec 9th 2019, 13:43 |
jotpe |
any suggestions? |