# |
Jul 8th 2019, 08:35 |
neon1024 |
@challgren Perhaps, but that’s not the ticket I’m working on right now |
# |
Jul 8th 2019, 08:35 |
dereuromark |
I used a quick Control+F + loadModel on https://github.com/cakephp/cakephp/releases |
# |
Jul 8th 2019, 08:35 |
challgren |
@neon1024 upgrade that app! |
# |
Jul 8th 2019, 08:34 |
conehead |
That could be a possible reason ;) |
# |
Jul 8th 2019, 08:34 |
neon1024 |
Another mystery solved, thanks @dereuromark |
# |
Jul 8th 2019, 08:33 |
dereuromark |
so I guess 3.7.7 is just not yet 3.8.0 |
# |
Jul 8th 2019, 08:33 |
dereuromark |
"ModelAwareTrait::loadModel() now allows fully qualified namespaces as a parameter." |
# |
Jul 8th 2019, 08:33 |
dereuromark |
the changelogs clearly state that this is only supported for 3.8+ |
# |
Jul 8th 2019, 08:33 |
neon1024 |
Seems to be the same in 3.7.9 I guess I’ve got something screwy somewhere |
# |
Jul 8th 2019, 08:33 |
conehead |
I'm on 3.8 and did a quick try |
# |
Jul 8th 2019, 08:32 |
neon1024 |
I wonder why it doesn’t for me :thinking_face: |
# |
Jul 8th 2019, 08:31 |
conehead |
Using classname is working fine for me |
# |
Jul 8th 2019, 08:31 |
neon1024 |
So 3.7.7 it probably needs some class namespace breaking up |
# |
Jul 8th 2019, 08:30 |
neon1024 |
Which is fair |
# |
Jul 8th 2019, 08:30 |
neon1024 |
I guess that `$this->App\Model\Table\OrganisationsTable` is invalid |
# |
Jul 8th 2019, 08:30 |
neon1024 |
So it’s trying to set `$this->{$alias} = $factory($modelClass);` |
# |
Jul 8th 2019, 08:30 |
neon1024 |
So the actual issue seems to be that the `$alias` is `public 'alias' => string 'App\Model\Table\OrganisationsTable' (length=34)` |
# |
Jul 8th 2019, 08:29 |
neon1024 |
Okay |
# |
Jul 8th 2019, 08:25 |
admad |
don't need test suite, can just stick some `debug()` / `dd()` in the method |
# |
Jul 8th 2019, 08:23 |
neon1024 |
If it’s covered by the tests, there is probably an issue in my code perhaps a bad namespace |
# |
Jul 8th 2019, 08:23 |
neon1024 |
Well two reasons really, firstly I am working on other bits currently so don’t want to get too into something else mentally, and secondly I don’t have the test suite for the core setup so I can’t easily jump in and run the tests |
# |
Jul 8th 2019, 08:22 |
neon1024 |
It’s covered in the tests cases |
# |
Jul 8th 2019, 08:22 |
neon1024 |
https://github.com/cakephp/cakephp/blob/master/tests/TestCase/Datasource/ModelAwareTraitTest.php#L74 |
# |
Jul 8th 2019, 08:21 |
admad |
why guess when you can find out what's actually going on? :slightly_smiling_face: |
# |
Jul 8th 2019, 08:21 |
neon1024 |
I’ll have a quick look in the tests |
# |
Jul 8th 2019, 08:20 |
neon1024 |
I would guess that `$this->{$alias} = $factory($modelClass);` would be trying `$factory('\App\Model\Table\OrganisationsTable')` |
# |
Jul 8th 2019, 08:19 |
neon1024 |
I don’t see any processing except the `pluginSplit` |
# |
Jul 8th 2019, 08:10 |
admad |
dig into the method and see if the FQCN get split up properly into alias and model type |
# |
Jul 8th 2019, 08:08 |
admad |
hmm actually loadModel() does accetp FQCN too |
# |
Jul 8th 2019, 08:07 |
neon1024 |
Presumably it’s matching on the TableRegistry key then |
# |
Jul 8th 2019, 08:06 |
admad |
loadModel() doesn't accept FQCN |
# |
Jul 8th 2019, 08:05 |
neon1024 |
Bit confusing |
# |
Jul 8th 2019, 08:05 |
neon1024 |
`$this->loadModel(OrganisationsTable::class) // false` `$this->loadModel('Organisations') // OrganisationsTable` |
# |
Jul 8th 2019, 07:01 |
blancessanchez30 |
Thank you :thumbsup: |
# |
Jul 8th 2019, 07:01 |
blancessanchez30 |
I just forgot to add wildcard in declaration in `routes.php` |
# |
Jul 8th 2019, 07:00 |
blancessanchez30 |
Solved it |
# |
Jul 8th 2019, 06:40 |
blancessanchez30 |
Not working |
# |
Jul 8th 2019, 06:33 |
admad |
`return $this->redirect(['controller' => 'admins', 'action' => 'reg_success'])` |
# |
Jul 8th 2019, 06:29 |
blancessanchez30 |
should i declare all controllers and actions in `routes.php`? |
# |
Jul 8th 2019, 06:29 |
blancessanchez30 |
what should i do |
# |
Jul 8th 2019, 06:28 |
blancessanchez30 |
but it only redirects to `/admins/reg_success` |