# |
Feb 24th 2020, 19:07 |
slackebot |
->addColumn('active', 'boolean', ['default' => false, 'signed' => false]) ->addColumn('role_id', 'integer', ['signed' => false]) ->addColumn('created', 'datetime') ->addColumn('modified', 'datetime') ->create();``` |
# |
Feb 24th 2020, 19:07 |
noel |
This basic example breaks the minute I add the `role_id` `belongsTo` association into the people table definition: ``` $this->table('roles') ->addColumn('name', 'string') ->addColumn('description', 'string', ['null' => true]) ->addColumn('created', 'datetime') ->addColumn('modified', 'datetime') ->create(); $this->table('people') |
# |
Feb 24th 2020, 19:06 |
noel |
Aargh... there's defs something wrong but I don't know what. |
# |
Feb 24th 2020, 18:58 |
dereuromark |
or docs |
# |
Feb 24th 2020, 18:58 |
dereuromark |
see -h |
# |
Feb 24th 2020, 18:57 |
noel |
Is there a way to temporarily disable the creation of a migration lock file? |
# |
Feb 24th 2020, 18:45 |
noel |
oh.. never mind. I must be tired. It's working like that. |
# |
Feb 24th 2020, 18:42 |
slackebot |
->addColumn('person_id', 'integer', ['signed' => false]) ->addColumn('slot', 'string', ['null' => true]) ->create();``` But as soon as I add in the m2m for `enquiries_organisations` it tanks: ```$this->table('enquiries_organisations') ->addColumn('enquiry_id', 'integer', ['signed' => false]) ->addColumn('organisation_id', 'integer', ['signed' => false]) ->create();``` |
# |
Feb 24th 2020, 18:42 |
slackebot |
['null' => true]) ->addColumn('created', 'datetime') ->addColumn('modified', 'datetime') ->create(); $this->table('organisations') ->addColumn('name', 'string') ->addColumn('created', 'datetime') ->addColumn('modified', 'datetime') ->create(); $this->table('enquiries_people') ->addColumn('enquiry_id', 'integer', ['signed' => false]) |
# |
Feb 24th 2020, 18:42 |
noel |
Ok so it's happy with this: ``` $this->table('people') ->addColumn('name', 'string') ->addColumn('surname', 'string') ->addColumn('created', 'datetime') ->addColumn('modified', 'datetime') ->create(); $this->table('enquiries') ->addColumn('ref', 'string') ->addColumn('who', 'json') ->addColumn('date', 'datetime') ->addColumn('deleted', 'datetime', |
# |
Feb 24th 2020, 18:34 |
admad |
it means you have more than one problem, using incorrect plural of `person` being one |
# |
Feb 24th 2020, 18:34 |
noel |
hmm.. but if I remove everything else from my migration it works with people... the plot thickens dickens. |
# |
Feb 24th 2020, 18:32 |
noel |
No.. I tried refactoring to `people` instead of `persons` and I get the same errors. |
# |
Feb 24th 2020, 18:31 |
dereuromark |
you might be able to set the alias manually though in the config of the relations, if you are lucky and you then bake the tests based on the existing model, it could work |
# |
Feb 24th 2020, 18:30 |
dereuromark |
Set the inflection for it to match person<=>persons, and see what happenes |
# |
Feb 24th 2020, 18:29 |
dereuromark |
I still think this should have been fixed in 4.x. You wouldnt expect this plural in technical terms usually. |
# |
Feb 24th 2020, 18:29 |
noel |
you think? |
# |
Feb 24th 2020, 18:29 |
dereuromark |
I bet it is because persons != people :) https://sandbox.dereuromark.de/sandbox/inflector?string=person |
# |
Feb 24th 2020, 18:29 |
noel |
Somehow permissions_roles test is looking for Enquiry entity, which is not related. |
# |
Feb 24th 2020, 18:28 |
noel |
And in fact causes the first m2m that was working to fail also. |
# |
Feb 24th 2020, 18:27 |
slackebot |
->addColumn('created', 'datetime') ->addColumn('modified', 'datetime') ->create(); $this->table('enquiries_persons') ->addColumn('enquiry_id', 'integer', ['signed' => false]) ->addColumn('person_id', 'integer', ['signed' => false]) ->create();``` |
# |
Feb 24th 2020, 18:27 |
noel |
But this doesn't work: ``` $this->table('persons') ->addColumn('name', 'string') ->addColumn('surname', 'string') ->addColumn('created', 'datetime') ->addColumn('modified', 'datetime') ->create(); $this->table('enquiries') ->addColumn('ref', 'string') ->addColumn('who', 'json') ->addColumn('date', 'datetime') ->addColumn('deleted', 'datetime', ['null' => true]) |
# |
Feb 24th 2020, 18:25 |
slackebot |
->addColumn('modified', 'datetime') ->create(); $this->table('permissions_roles') ->addColumn('permission_id', 'integer', ['signed' => false]) ->addColumn('role_id', 'integer', ['signed' => false]) ->create();``` |
# |
Feb 24th 2020, 18:25 |
noel |
E.g. This works fine: ```$this->table('roles') ->addColumn('name', 'string') ->addColumn('description', 'string', ['null' => true]) ->addColumn('created', 'datetime') ->addColumn('modified', 'datetime') ->create(); $this->table('permissions') ->addColumn('name', 'string') ->addColumn('description', 'string', ['null' => true]) ->addColumn('created', 'datetime') |
# |
Feb 24th 2020, 18:25 |
noel |
I also have other m2m's that are working fine. Can't see anything wrong with this one. |
# |
Feb 24th 2020, 18:24 |
noel |
It only fails to find them when baking the tests annotations, all other baked code is fine. |
# |
Feb 24th 2020, 18:21 |
noel |
Sure but I mean I can see that it can't find the association when trying to write bake tests but I have no idea why. |
# |
Feb 24th 2020, 18:19 |
dereuromark |
Did you check the line? What code is done there? And what the variable content looks like? |
# |
Feb 24th 2020, 18:17 |
noel |
Tried clearing the twig cache.. same deal |
# |
Feb 24th 2020, 18:17 |
noel |
3.8.x |
# |
Feb 24th 2020, 18:15 |
dereuromark |
could be some bad caching of twig template content though. |
# |
Feb 24th 2020, 18:14 |
dereuromark |
you should always mention the exact cake and plugin versions here. otherwise not really able to help |
# |
Feb 24th 2020, 18:13 |
slackebot |
Cake\Console\CommandRunner::run() - CORE/src/Console/CommandRunner.php, line 162 [main] - ROOT/bin/cake.php, line 12``` Any ideas what's wrong? |
# |
Feb 24th 2020, 18:13 |
slackebot |
Bake\Shell\BakeShell::Bake\Shell\{closure}() - ROOT/vendor/cakephp/bake/src/Shell/BakeShell.php, line 279 Cake\Collection\Collection::each() - CORE/src/Collection/CollectionTrait.php, line 64 Bake\Shell\BakeShell::all() - ROOT/vendor/cakephp/bake/src/Shell/BakeShell.php, line 280 Cake\Console\Shell::runCommand() - CORE/src/Console/Shell.php, line 517 Cake\Console\CommandRunner::runShell() - CORE/src/Console/CommandRunner.php, line 385 |
# |
Feb 24th 2020, 18:13 |
slackebot |
ROOT/vendor/cakephp/bake/src/Shell/Task/BakeTemplateTask.php, line 91 QuasarAdmin\Shell\Task\ModelTask::bakeTableExtension() - ROOT/plugins/QuasarAdmin/src/Shell/Task/ModelTask.php, line 155 QuasarAdmin\Shell\Task\ModelTask::bake() - ROOT/plugins/QuasarAdmin/src/Shell/Task/ModelTask.php, line 38 Bake\Shell\Task\ModelTask::main() - ROOT/vendor/cakephp/bake/src/Shell/Task/ModelTask.php, line 101 |
# |
Feb 24th 2020, 18:13 |
slackebot |
455 Twig\Template::display() - ROOT/vendor/twig/twig/src/Template.php, line 422 Twig\Template::render() - ROOT/vendor/twig/twig/src/Template.php, line 434 WyriHaximus\TwigView\View\TwigView::_render() - ROOT/vendor/wyrihaximus/twig-view/src/View/TwigView.php, line 180 Bake\View\BakeView::render() - ROOT/vendor/cakephp/bake/src/View/BakeView.php, line 146 Bake\Shell\Task\BakeTemplateTask::generate() - |
# |
Feb 24th 2020, 18:13 |
slackebot |
ROOT/vendor/cakephp/bake/src/View/Helper/DocBlockHelper.php, line 250 Twig\Template::getAttribute() - ROOT/vendor/twig/twig/src/Template.php, line 704 __TwigTemplate_f7bf778fd7b532a52105fa791346104191d92de1546cf9d454cd16fe3d54519b::doDisplay() - ROOT/tmp/cache/twigView/bd/bd0f7fe6fbda10de43c4a5f7432128f12025b660c9d629bbd8074ac352a16995.php, line 33 Twig\Template::displayWithErrorHandling() - ROOT/vendor/twig/twig/src/Template.php, line |
# |
Feb 24th 2020, 18:13 |
noel |
I'm trying to create a m2m association and I'm getting a weird bake error: ```2020-02-24 18:10:14 Notice: Notice (8): Undefined index: Enquiries in [/Users/myproject/vendor/cakephp/bake/src/View/Helper/DocBlockHelper.php, line 250] Trace: Cake\Error\BaseErrorHandler::handleError() - CORE/src/Error/BaseErrorHandler.php, line 158 Bake\View\Helper\DocBlockHelper::buildTableAnnotations() - |
# |
Feb 24th 2020, 18:06 |
dereuromark |
nope, middleware is actually invoked: https://github.com/cakephp/cakephp/issues/14321 Must be sth else. At least debugging it I found the actual error causing the 500, a test harness bug in core probably. |
# |
Feb 24th 2020, 17:49 |
dereuromark |
It still switches back to normal Exception renderer, debugging the constructor reveals "#message: "Cannot describe countries. It has 0 columns."" etc, some low level issue. Could this be happening before the middleware is activated even? |
# |
Feb 24th 2020, 17:49 |
dereuromark |
Not in master (4.x yet it seems) |