# |
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? |
# |
Dec 9th 2019, 13:43 |
jotpe |
If I set debugging in app.php it's working |
# |
Dec 9th 2019, 13:43 |
jotpe |
The error only appears when change debug to true in my .env file |
# |
Dec 9th 2019, 13:42 |
jotpe |
`Error: Nesting level too deep - recursive dependency?` `File /usr/www/users/xxx/xxx-dev/vendor/cakephp/cakephp/src/Error/Debugger.php` `Line: 575` |
# |
Dec 9th 2019, 13:42 |
gianmarxgagliardi |
`bin/cake.bat bake all xxx` <-with this it works |
# |
Dec 9th 2019, 13:42 |
jotpe |
I've got this error again. It disappears when I change my debug mode to false: |
# |
Dec 9th 2019, 13:41 |
gianmarxgagliardi |
@steinkel ok it works thanks |
# |
Dec 9th 2019, 13:40 |
steinkel |
no, run it from the parent folder is OK |