# |
Feb 24th 2020, 22:33 |
wizardfix |
@phantomwatson If I write ```$this->Html->link($this->Html->image('audio.png'), $result->url, ['target' => '_blank'])``` the `target` attribute gets set ok on the `<a>` element, but the angle brackets of the `<image>` tag get transformed into Html entities like `<` and `>`: I guess I'll just have to write the anchor manually :thinking_face: |
# |
Feb 24th 2020, 22:32 |
dereuromark |
use cakebox, it will solve all your issues |
# |
Feb 24th 2020, 22:31 |
kris |
Hello guys, I’m trying to install CakePHP3 or 4 locally with MAMP Pro 5.7 but it always complains the intl.so is not installed and I can’t get past that point. Does anybody know how to fix this? I would appreciate any help |
# |
Feb 24th 2020, 22:20 |
wizardfix |
@phantomwatson If I write |
# |
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 |