Log message #4228506

# At Username Text
# Feb 24th 2020, 20:58 thomas078 I have pagination like this ``` $this->paginate = ['limit' => 25, 'contain' => ['Users','Agent','PortOfLoading','PortOfDischarge','Payments','Cargos'], 'order' => ['Entries.id' => 'desc'], 'conditions' => $filters];``` And $filters like this
# Feb 24th 2020, 20:37 wizardfix Ok thanks @phantomwatson :)
# Feb 24th 2020, 20:18 phantomwatson `'_target'` doesn't appear to currently be a recognized option that gets passed up to the `<a>` parent tag, so you'll need to rely on `$this->Html->link()` or writing the `<a>` tag yourself. This might be a good opportunity for someone to issue a pull request to add support for that, though.
# Feb 24th 2020, 20:14 phantomwatson e.g. ```$this->Html->link({image code}, {url}, ['target' => '_blank']);```
# Feb 24th 2020, 20:12 phantomwatson Move `'target' => '_blank'` into the call to `Html->link()`.
# Feb 24th 2020, 19:21 wizardfix If I write `$this->Html->image("audio.png", ['target' => '_blank', 'url' => $result->url])` then Cake puts the `_blank` attribute on the `<image>` element. How do I make it put the attribute on the parent anchor tag? :thinking_face:
# Feb 24th 2020, 19:16 ndm You might want to do some debugging in the bake code, for starters check out what exactly the array _does_ contain, if it's missing `Roles`
# Feb 24th 2020, 19:07 noel `Notice Error: Undefined index: Roles in [/Users/noeldacosta/repo/mnr-be/vendor/cakephp/bake/src/View/Helper/DocBlockHelper.php, line 250]`
# 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?