# |
Apr 25th 2019, 15:47 |
neon1024 |
`rm -rf vendor andand composer clearcache andand composer install` |
# |
Apr 25th 2019, 15:47 |
neon1024 |
Alternative is to “Nuke the site from orbit” |
# |
Apr 25th 2019, 15:47 |
neon1024 |
Between `Plugin::load()` in `bootstrap.php` and `$this->addPlugin()` in `Application.php` |
# |
Apr 25th 2019, 15:47 |
neon1024 |
..and check how you’re loading them as in Cake 3.6 *I think* there was a new way to load plugins introduced |
# |
Apr 25th 2019, 15:46 |
neon1024 |
Probably worth checking the plugins to check they support your version of cakephp |
# |
Apr 25th 2019, 15:46 |
neon1024 |
So there is one which is doing it incorrectly |
# |
Apr 25th 2019, 15:46 |
neon1024 |
Well it looks to me like plugins are adding commands for bin/cake |
# |
Apr 25th 2019, 15:45 |
this.impetus |
which makes me think bin/cake, rather than the call to bake all, is where the problem starts. |
# |
Apr 25th 2019, 15:44 |
this.impetus |
ooook... that actually results in the same `Exception: Call to a member function addMany() on null` error |
# |
Apr 25th 2019, 15:43 |
neon1024 |
Also worth a `bin/cake cache clear_all` to ensure it’s not a cached error |
# |
Apr 25th 2019, 15:43 |
this.impetus |
nah it's comforting to know that I'm rightfully stumped ;P |
# |
Apr 25th 2019, 15:42 |
neon1024 |
Yeah, and without seeing the code it’s hard to give any insight, sorry |
# |
Apr 25th 2019, 15:42 |
this.impetus |
so it's difficult to assess why it's returning null, or what it ought to have returned |
# |
Apr 25th 2019, 15:41 |
this.impetus |
I duno what `$this->app->pluginConsole()` does, or which bit of `$commands` it was intended to use |
# |
Apr 25th 2019, 15:41 |
this.impetus |
But *after* 142, `$commands` is null |
# |
Apr 25th 2019, 15:40 |
slackebot |
'Cake\Shell\OrmCacheShell', 'plugin' => 'Cake\Shell\PluginShell', 'routes' => 'Cake\Shell\RoutesShell', 'schema_cache' => 'Cake\Shell\SchemaCacheShell', 'server' => 'Cake\Shell\ServerShell', 'console' => 'App\Shell\ConsoleShell' ] } ``` |
# |
Apr 25th 2019, 15:40 |
this.impetus |
at line 142 in `vendor/cakephp/src/Console/CommandRunner.php` I ran `debug()` on `$commands`; prints ```########## DEBUG ########## object(Cake\Console\CommandCollection) { [protected] commands => [ 'version' => 'Cake\Command\VersionCommand', 'help' => 'Cake\Command\HelpCommand', 'cache' => 'Cake\Shell\CacheShell', 'completion' => 'Cake\Shell\CompletionShell', 'i18n' => 'Cake\Shell\I18nShell', 'orm_cache' => |
# |
Apr 25th 2019, 15:39 |
this.impetus |
Well I can see where the dilemma arises, but i know far too little about cake's machinery to make sense of it. Here's where I'm at: |
# |
Apr 25th 2019, 15:34 |
this.impetus |
ok I'll go down that rabbit hole, ty |
# |
Apr 25th 2019, 15:34 |
neon1024 |
That should have a stacktrade to tell you where stuff went wrong |
# |
Apr 25th 2019, 15:33 |
neon1024 |
If it’s a command line it should be in `/logs/cli-error.log` |
# |
Apr 25th 2019, 15:33 |
neon1024 |
Did you check the logs? |
# |
Apr 25th 2019, 15:33 |
neon1024 |
So maybe here, https://github.com/cakephp/cakephp/blob/c15a2e9c1933fa5a874c33d2bcb6d63efacf8876/src/Http/BaseApplication.php#L206 |
# |
Apr 25th 2019, 15:33 |
this.impetus |
It will sadden us both that i don't really understand that last sentence, alas. |
# |
Apr 25th 2019, 15:32 |
neon1024 |
So perhaps it’s a plugin with a Shell class |
# |
Apr 25th 2019, 15:32 |
this.impetus |
But I am pretty damn sure everything is right in the database. The table certainly exists, and the tables it references were extant in the project before I added the HABTM table. just `images`, `publications` and `images_publications` |
# |
Apr 25th 2019, 15:32 |
neon1024 |
https://github.com/cakephp/cakephp/blob/e6c40f7814039e68abe2c11721d0cda4b6c4cb54/src/Console/CommandCollection.php#L85 |
# |
Apr 25th 2019, 15:31 |
this.impetus |
That was my first thought |
# |
Apr 25th 2019, 15:31 |
this.impetus |
`vendor/cakephp/cakephp/src/Core/BasePlugin.php, line 248` |
# |
Apr 25th 2019, 15:31 |
neon1024 |
As `addMany()` feels like a Table class method. Which if it is, just means the table isn’t instanciated |
# |
Apr 25th 2019, 15:30 |
neon1024 |
Does the stacktrace give you a line number or class? |
# |
Apr 25th 2019, 15:30 |
this.impetus |
I know PHP, or once knew; then I moved to python, then to front-end, and now php is a distant memory I'm trying to recover haha. So anyway, the most current version of bake is indeed installed, but the error, `Exception: Call to a member function addMany() on null` remains |
# |
Apr 25th 2019, 15:30 |
neon1024 |
Well in other news, according to packagist, `cakephp/bake` doesn’t require `twig/twig`, but instead uses Wryhaximus’ twig plugin, which might in turn use twig |
# |
Apr 25th 2019, 15:29 |
neon1024 |
It’s like trying to learn Sass without knowing CSS otherwise |
# |
Apr 25th 2019, 15:28 |
neon1024 |
Yeah, do PHP first, and Cake second |
# |
Apr 25th 2019, 15:28 |
this.impetus |
I'm getting the hang of it; often it's jsut the presumption that there's a cakey or cake-specific way thigns ought to be done that stumps me |
# |
Apr 25th 2019, 15:28 |
neon1024 |
Well, pretty much all package managers are really ;) |
# |
Apr 25th 2019, 15:28 |
neon1024 |
But if you’ve used `npm` or `yarn` then `composer` is very similar |
# |
Apr 25th 2019, 15:28 |
this.impetus |
Which is where I hitherto lived. Thanks for your patience and assistance. |
# |
Apr 25th 2019, 15:27 |
neon1024 |
..but that’s more front-end developer territory imho |
# |
Apr 25th 2019, 15:27 |
neon1024 |
Not with PHP at least, no. CSS mastery might slide into backend through Javascript, Node.js and Webpack |