# |
Feb 19th 2020, 14:09 |
spriz |
it's all app-logic |
# |
Feb 19th 2020, 14:09 |
spriz |
Yeah, true PITA @dereuromark Related to discussion last week - I'm not putting FKs in DB at all currently :shrug: |
# |
Feb 19th 2020, 14:08 |
khalid |
not sure if its the correct solution but best i could come around is: ```public static function setUpBeforeClass() { Configure::write('Acl.database', 'test');``` |
# |
Feb 19th 2020, 14:08 |
dereuromark |
i found it because I was listing all non assigned entities, and after removing one relation it still didnt show (field IS NULL)^^ |
# |
Feb 19th 2020, 14:07 |
dereuromark |
yeah, I had to always fix this after some relations are already broken^^ because I forgot to add it into the migration in the first place. |
# |
Feb 19th 2020, 14:05 |
spriz |
Ah, in the migration! Mindblown! |
# |
Feb 19th 2020, 14:04 |
spriz |
How do you do that again @dereuromark? :O |
# |
Feb 19th 2020, 14:03 |
khalid |
and problem is only with Controllers Tests, Model tests works fine |
# |
Feb 19th 2020, 13:58 |
neon1024 |
How are the repository splits achieved on Github for the cakephp packages? |
# |
Feb 19th 2020, 13:58 |
dereuromark |
darn, I always forget the ```->addForeignKey('other_id', 'others', ['id'], ['delete' => 'SET_NULL'])``` part for optional hasMany => belongsTo relations where the belongsTo part could be removed and thus the data integrity is not there anymore (pointing to nonexistent keys). |
# |
Feb 19th 2020, 13:56 |
khalid |
any help will be much appreciated :) |
# |
Feb 19th 2020, 13:55 |
slackebot |
(!Configure::read('Acl.database')) { Configure::write('Acl.database', 'default');} so question is how can we use both Test and Application with ACL. |
# |
Feb 19th 2020, 13:55 |
khalid |
Hi Everyone, We are using Cakephp3 and Acl plugin from Cake, but problem is when we are running UnitTests its giving The datasource configuration "" was not found. but if we go to config/app.php and add 'Acl' => ['database' => 'test'] test works but then our main Application start failing because ACL is using Database Test now for Application too not only for tests further more i have seen Cakephp/Acl/config/bootstrap.php if |
# |
Feb 19th 2020, 13:53 |
kiwi_10 |
so question is how can we use both Test and Application with ACL. |
# |
Feb 19th 2020, 13:52 |
kiwi_10 |
further more i have seen Cakephp/Acl/config/bootstrap.php if (!Configure::read('Acl.database')) { Configure::write('Acl.database', 'default');} |
# |
Feb 19th 2020, 13:52 |
kiwi_10 |
but then our main Application start failing because ACL is using Database Test now for Application too not only for tests |
# |
Feb 19th 2020, 13:51 |
kiwi_10 |
but if we go to config/app.php and add 'Acl' => ['database' => 'test'] test works |
# |
Feb 19th 2020, 13:51 |
kiwi_10 |
Hi Everyone, We are using Cakephp3 and Acl plugin from Cake, but problem is when we are running UnitTests its giving The datasource configuration "" was not found. |
# |
Feb 19th 2020, 12:27 |
jotpe |
Hi, people! |
# |
Feb 19th 2020, 12:27 |
admad |
@val https://github.com/cakephp/authorization/pull/124 |
# |
Feb 19th 2020, 12:09 |
tomrwaller |
Haha at this point @ndm probably knows more about my project than I do! |
# |
Feb 19th 2020, 12:08 |
neon1024 |
Ah, there you are. A clever person appears! |
# |
Feb 19th 2020, 12:08 |
tomrwaller |
Ah - great @ndm - I'll give that a whirl. |
# |
Feb 19th 2020, 12:08 |
tomrwaller |
Thanks @neon1024 - I've followed that which is what I'm using. |
# |
Feb 19th 2020, 12:08 |
ndm |
Multi selects use the `selectMultiple` template |
# |
Feb 19th 2020, 12:07 |
neon1024 |
You may end up needing a custom form widget, but I haven’t used those before, so not too certain |
# |
Feb 19th 2020, 12:06 |
neon1024 |
I’d check the book https://book.cakephp.org/3/en/views/helpers/form.html#customizing-the-templates-formhelper-uses |
# |
Feb 19th 2020, 12:06 |
neon1024 |
Could be |
# |
Feb 19th 2020, 12:06 |
tomrwaller |
I have inputContainer - is that not the same thing? |
# |
Feb 19th 2020, 12:04 |
neon1024 |
Probably looking for the inputWrapper template? |
# |
Feb 19th 2020, 11:53 |
tomrwaller |
But in my HTML output the select isn't picking up the class. |
# |
Feb 19th 2020, 11:53 |
tomrwaller |
And in my form-templates.php I'm returning this: 'select' => '<div class="form-group"><select class="form-control" {{attrs}} name={{name}}>{{content}}<select></div>', |
# |
Feb 19th 2020, 11:53 |
tomrwaller |
I'm presenting the select on add.php like this: echo $this->Form->select('recommendationgroup_id', $recommendationgroups, ['multiple' => true]); |
# |
Feb 19th 2020, 11:52 |
tomrwaller |
Hey all - I have a form template that I'm using to apply wrapping divs/classess to form controls but it looks like it's not picking up the wrap for a select element - does anyone know why that might be? |
# |
Feb 19th 2020, 11:51 |
neon1024 |
Rather than what I’m doing, which is `->format('Y-m-d')` and comparing as strings |
# |
Feb 19th 2020, 11:51 |
neon1024 |
Can you compare two FrozenDate objects directly? |
# |
Feb 19th 2020, 10:57 |
neon1024 |
Yeah, I have lots of Chart javascript clutting up my template which is what got me thinking about it :) Thanks for the confirmation, I will refactor one of my dashboard graphs I need in two places |
# |
Feb 19th 2020, 10:56 |
admad |
@neon1024 view cells would be a good use case for that, just you will have to use inline js as cells are self contained |
# |
Feb 19th 2020, 10:53 |
admad |
@val possibly |
# |
Feb 19th 2020, 10:52 |
neon1024 |
Anyway, just a thought :) |
# |
Feb 19th 2020, 10:51 |
neon1024 |
..but then you end up with lots of controller code, and the graphs are less contained and portalable, as you’d have to migrate the controller code to source the data if you re-used the graph |